@@ -52,6 +52,90 @@ func ToWaitSUCInstruction(_, _, k8sVersion string) (*applyinator.Instruction, er
52
52
}, nil
53
53
}
54
54
55
+ func ToWaitMccLocalManagedSystemUpgradeControllerInstruction (k8sVersion string ) (* applyinator.Instruction , error ) {
56
+ cmd , err := self .Self ()
57
+ if err != nil {
58
+ return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
59
+ }
60
+ return & applyinator.Instruction {
61
+ Name : "wait-system-upgrade-controller" ,
62
+ SaveOutput : true ,
63
+ Args : []string {"retry" , kubectl .Command (k8sVersion ), "-n" , "fleet-local" , "get" , "managedchart" , "mcc-local-managed-system-upgrade-controller" },
64
+ Env : kubectl .Env (k8sVersion ),
65
+ Command : cmd ,
66
+ }, nil
67
+ }
68
+
69
+ func ToPatchSUCServiceAccountInstruction (k8sVersion string ) (* applyinator.Instruction , error ) {
70
+ cmd , err := self .Self ()
71
+ if err != nil {
72
+ return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
73
+ }
74
+ return & applyinator.Instruction {
75
+ Name : "patch-system-upgrade-controller-serviceaccount" ,
76
+ SaveOutput : true ,
77
+ Args : []string {"retry" , kubectl .Command (k8sVersion ), "annotate" , "--overwrite" , "serviceaccount" , "-n" , "cattle-system" , "system-upgrade-controller" , "meta.helm.sh/release-name=mcc-local-managed-system-upgrade-controller" },
78
+ Env : kubectl .Env (k8sVersion ),
79
+ Command : cmd ,
80
+ }, nil
81
+ }
82
+
83
+ func ToPatchSUCConfigMapInstruction (k8sVersion string ) (* applyinator.Instruction , error ) {
84
+ cmd , err := self .Self ()
85
+ if err != nil {
86
+ return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
87
+ }
88
+ return & applyinator.Instruction {
89
+ Name : "patch-system-upgrade-controller-configmap" ,
90
+ SaveOutput : true ,
91
+ Args : []string {"retry" , kubectl .Command (k8sVersion ), "annotate" , "--overwrite" , "configmap" , "-n" , "cattle-system" , "system-upgrade-controller-config" , "meta.helm.sh/release-name=mcc-local-managed-system-upgrade-controller" },
92
+ Env : kubectl .Env (k8sVersion ),
93
+ Command : cmd ,
94
+ }, nil
95
+ }
96
+
97
+ func ToPatchSUCClusterRoleBindingInstruction (k8sVersion string ) (* applyinator.Instruction , error ) {
98
+ cmd , err := self .Self ()
99
+ if err != nil {
100
+ return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
101
+ }
102
+ return & applyinator.Instruction {
103
+ Name : "patch-system-upgrade-controller-clusterrolebinding" ,
104
+ SaveOutput : true ,
105
+ Args : []string {"retry" , kubectl .Command (k8sVersion ), "annotate" , "--overwrite" , "clusterrolebinding" , "-n" , "cattle-system" , "system-upgrade-controller" , "meta.helm.sh/release-name=mcc-local-managed-system-upgrade-controller" },
106
+ Env : kubectl .Env (k8sVersion ),
107
+ Command : cmd ,
108
+ }, nil
109
+ }
110
+
111
+ func ToPatchSUCDeploymentInstruction (k8sVersion string ) (* applyinator.Instruction , error ) {
112
+ cmd , err := self .Self ()
113
+ if err != nil {
114
+ return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
115
+ }
116
+ return & applyinator.Instruction {
117
+ Name : "patch-system-upgrade-controller-deployment" ,
118
+ SaveOutput : true ,
119
+ Args : []string {"retry" , kubectl .Command (k8sVersion ), "annotate" , "--overwrite" , "deployment" , "-n" , "cattle-system" , "system-upgrade-controller" , "meta.helm.sh/release-name=mcc-local-managed-system-upgrade-controller" },
120
+ Env : kubectl .Env (k8sVersion ),
121
+ Command : cmd ,
122
+ }, nil
123
+ }
124
+
125
+ func ToDeleteSUCInstruction (k8sVersion string ) (* applyinator.Instruction , error ) {
126
+ cmd , err := self .Self ()
127
+ if err != nil {
128
+ return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
129
+ }
130
+ return & applyinator.Instruction {
131
+ Name : "patch-system-upgrade-controller-deployment" ,
132
+ SaveOutput : true ,
133
+ Args : []string {"retry" , kubectl .Command (k8sVersion ), "delete" , "bundle" , "-n" , "cattle-system" , "mcc-local-managed-system-upgrade-controller" },
134
+ Env : kubectl .Env (k8sVersion ),
135
+ Command : cmd ,
136
+ }, nil
137
+ }
138
+
55
139
func ToWaitSUCPlanInstruction (_ , _ , k8sVersion string ) (* applyinator.Instruction , error ) {
56
140
cmd , err := self .Self ()
57
141
if err != nil {
0 commit comments