Skip to content

Commit 381e814

Browse files
committed
copy current.spec
1 parent 9138cf9 commit 381e814

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

pkg/embeddedcluster/upgrade.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,22 @@ func startClusterUpgrade(
5555
return fmt.Errorf("failed to get current installation: %w", err)
5656
}
5757

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",
58+
newInstall := &embeddedclusterv1beta1.Installation{
59+
TypeMeta: metav1.TypeMeta{
60+
APIVersion: embeddedclusterv1beta1.GroupVersion.String(),
61+
Kind: "Installation",
6362
},
63+
ObjectMeta: metav1.ObjectMeta{
64+
Name: time.Now().Format("20060102150405"),
65+
Labels: map[string]string{
66+
"replicated.com/disaster-recovery": "ec-install",
67+
},
68+
},
69+
Spec: current.Spec,
6470
}
6571
newInstall.Spec.Artifacts = artifacts
6672
newInstall.Spec.Config = &newcfg
6773
newInstall.Spec.LicenseInfo = &embeddedclusterv1beta1.LicenseInfo{IsDisasterRecoverySupported: license.Spec.IsDisasterRecoverySupported}
68-
newInstall.Status = embeddedclusterv1beta1.InstallationStatus{}
6974

7075
log.Printf("Starting cluster upgrade to version %s...", newcfg.Version)
7176

0 commit comments

Comments
 (0)