@@ -82,76 +82,6 @@ func ToWaitClusterClientSecretInstruction(_, _, k8sVersion string) (*applyinator
8282 return instruction , nil
8383}
8484
85- func ToUpdateClientSecretInstruction (_ , _ , k8sVersion string ) (* applyinator.OneTimeInstruction , error ) {
86- cmd , err := self .Self ()
87- if err != nil {
88- return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
89- }
90- instruction := & applyinator.OneTimeInstruction {}
91- instruction .Name = "update-client-secret"
92- instruction .SaveOutput = true
93- instruction .Args = []string {"update-client-secret" }
94- instruction .Env = kubectl .Env (k8sVersion )
95- instruction .Command = cmd
96- return instruction , nil
97- }
98-
99- func ToScaleDownFleetControllerInstruction (_ , _ , k8sVersion string ) (* applyinator.OneTimeInstruction , error ) {
100- cmd , err := self .Self ()
101- if err != nil {
102- return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
103- }
104- instruction := & applyinator.OneTimeInstruction {}
105- instruction .Name = "scale-down-fleet-controller"
106- instruction .SaveOutput = true
107- instruction .Args = []string {"retry" , kubectl .Command (k8sVersion ), "-n" , "cattle-fleet-system" , "scale" , "--replicas" , "0" , "deploy/fleet-controller" }
108- instruction .Env = kubectl .Env (k8sVersion )
109- instruction .Command = cmd
110- return instruction , nil
111- }
112-
113- func ToScaleUpFleetControllerInstruction (_ , _ , k8sVersion string ) (* applyinator.OneTimeInstruction , error ) {
114- cmd , err := self .Self ()
115- if err != nil {
116- return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
117- }
118- instruction := & applyinator.OneTimeInstruction {}
119- instruction .Name = "scale-up-fleet-controller"
120- instruction .SaveOutput = true
121- instruction .Args = []string {"retry" , kubectl .Command (k8sVersion ), "-n" , "cattle-fleet-system" , "scale" , "--replicas" , "1" , "deploy/fleet-controller" }
122- instruction .Env = kubectl .Env (k8sVersion )
123- instruction .Command = cmd
124- return instruction , nil
125- }
126-
127- func ToDeleteRancherWebhookValidationConfiguration (k8sVersion string ) (* applyinator.OneTimeInstruction , error ) {
128- cmd , err := self .Self ()
129- if err != nil {
130- return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
131- }
132- instruction := & applyinator.OneTimeInstruction {}
133- instruction .Name = "delete-rancher-webhook-validation-configuration"
134- instruction .SaveOutput = true
135- instruction .Args = []string {"retry" , kubectl .Command (k8sVersion ), "delete" , "validatingwebhookconfiguration" , "rancher.cattle.io" }
136- instruction .Env = kubectl .Env (k8sVersion )
137- instruction .Command = cmd
138- return instruction , nil
139- }
140-
141- func ToRestartRancherWebhookInstruction (k8sVersion string ) (* applyinator.OneTimeInstruction , error ) {
142- cmd , err := self .Self ()
143- if err != nil {
144- return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
145- }
146- instruction := & applyinator.OneTimeInstruction {}
147- instruction .Name = "restart-rancher-webhook"
148- instruction .SaveOutput = true
149- instruction .Args = []string {"retry" , kubectl .Command (k8sVersion ), "-n" , "cattle-system" , "rollout" , "restart" , "deploy/rancher-webhook" }
150- instruction .Env = kubectl .Env (k8sVersion )
151- instruction .Command = cmd
152- return instruction , nil
153- }
154-
15585func ToCreateStvAggregationSecret (k8sVersion string ) (* applyinator.OneTimeInstruction , error ) {
15686 cmd , err := self .Self ()
15787 if err != nil {
@@ -165,19 +95,3 @@ func ToCreateStvAggregationSecret(k8sVersion string) (*applyinator.OneTimeInstru
16595 instruction .Command = cmd
16696 return instruction , nil
16797}
168-
169- // Needs to patch status subresource
170- // k patch cluster.provisioning local -n fleet-local --subresource=status --type=merge --patch '{"status":{"fleetWorkspaceName": "fleet-local"}}'
171- func PatchLocalProvisioningClusterStatus (_ , _ , k8sVersion string ) (* applyinator.OneTimeInstruction , error ) {
172- cmd , err := self .Self ()
173- if err != nil {
174- return nil , fmt .Errorf ("resolving location of %s: %w" , os .Args [0 ], err )
175- }
176- instruction := & applyinator.OneTimeInstruction {}
177- instruction .Name = "patch-provisioning-cluster-status"
178- instruction .SaveOutput = true
179- instruction .Args = []string {"retry" , kubectl .Command (k8sVersion ), "-n" , "fleet-local" , "patch" , "cluster.provisioning" , "local" , "--subresource=status" , "--type=merge" , "--patch" , "{\" status\" :{\" fleetWorkspaceName\" : \" fleet-local\" }}" }
180- instruction .Env = kubectl .Env (k8sVersion )
181- instruction .Command = cmd
182- return instruction , nil
183- }
0 commit comments