@@ -54,35 +54,22 @@ func startClusterUpgrade(
54
54
if err != nil {
55
55
return fmt .Errorf ("failed to get current installation: %w" , err )
56
56
}
57
- newins := & embeddedclusterv1beta1.Installation {
58
- TypeMeta : metav1.TypeMeta {
59
- APIVersion : embeddedclusterv1beta1 .GroupVersion .String (),
60
- Kind : "Installation" ,
61
- },
62
- ObjectMeta : metav1.ObjectMeta {
63
- Name : time .Now ().Format ("20060102150405" ),
64
- Labels : map [string ]string {
65
- "replicated.com/disaster-recovery" : "ec-install" ,
66
- },
67
- },
68
- Spec : embeddedclusterv1beta1.InstallationSpec {
69
- ClusterID : current .Spec .ClusterID ,
70
- MetricsBaseURL : current .Spec .MetricsBaseURL ,
71
- HighAvailability : current .Spec .HighAvailability ,
72
- AirGap : current .Spec .AirGap ,
73
- Network : current .Spec .Network ,
74
- Proxy : current .Spec .Proxy ,
75
- Artifacts : artifacts ,
76
- Config : & newcfg ,
77
- EndUserK0sConfigOverrides : current .Spec .EndUserK0sConfigOverrides ,
78
- BinaryName : current .Spec .BinaryName ,
79
- LicenseInfo : & embeddedclusterv1beta1.LicenseInfo {IsDisasterRecoverySupported : license .Spec .IsDisasterRecoverySupported },
57
+
58
+ newInstall := current
59
+ newInstall .ObjectMeta = metav1.ObjectMeta {
60
+ Name : time .Now ().Format ("20060102150405" ),
61
+ Labels : map [string ]string {
62
+ "replicated.com/disaster-recovery" : "ec-install" ,
80
63
},
81
64
}
65
+ newInstall .Spec .Artifacts = artifacts
66
+ newInstall .Spec .Config = & newcfg
67
+ newInstall .Spec .LicenseInfo = & embeddedclusterv1beta1.LicenseInfo {IsDisasterRecoverySupported : license .Spec .IsDisasterRecoverySupported }
68
+ newInstall .Status = embeddedclusterv1beta1.InstallationStatus {}
82
69
83
70
log .Printf ("Starting cluster upgrade to version %s..." , newcfg .Version )
84
71
85
- err = runClusterUpgrade (ctx , k8sClient , newins , registrySettings , license , versionLabel )
72
+ err = runClusterUpgrade (ctx , k8sClient , newInstall , registrySettings , license , versionLabel )
86
73
if err != nil {
87
74
return fmt .Errorf ("run cluster upgrade: %w" , err )
88
75
}
0 commit comments