@@ -996,21 +996,38 @@ func ecBackupAnnotations(ctx context.Context, kbClient kbclient.Client, in *embe
996996 annotations ["kots.io/embedded-cluster-id" ] = util .EmbeddedClusterID ()
997997 annotations ["kots.io/embedded-cluster-version" ] = util .EmbeddedClusterVersion ()
998998 annotations ["kots.io/embedded-cluster-is-ha" ] = strconv .FormatBool (in .Spec .HighAvailability )
999- if in .Spec .AdminConsole != nil && in .Spec .AdminConsole .Port > 0 {
1000- annotations ["kots.io/embedded-cluster-admin-console-port" ] = strconv .Itoa (in .Spec .AdminConsole .Port )
1001- }
1002- if in .Spec .LocalArtifactMirror != nil && in .Spec .LocalArtifactMirror .Port > 0 {
1003- annotations ["kots.io/embedded-cluster-local-artifact-mirror-port" ] = strconv .Itoa (in .Spec .LocalArtifactMirror .Port )
1004- }
1005999
10061000 if in .Spec .Network != nil {
10071001 annotations ["kots.io/embedded-cluster-pod-cidr" ] = in .Spec .Network .PodCIDR
10081002 annotations ["kots.io/embedded-cluster-service-cidr" ] = in .Spec .Network .ServiceCIDR
10091003 }
10101004
1005+ if in .Spec .RuntimeConfig != nil {
1006+ rcAnnotations := ecRuntimeConfigToBackupAnnotations (in .Spec .RuntimeConfig )
1007+ for k , v := range rcAnnotations {
1008+ annotations [k ] = v
1009+ }
1010+ }
1011+
10111012 return annotations , nil
10121013}
10131014
1015+ func ecRuntimeConfigToBackupAnnotations (runtimeConfig * embeddedclusterv1beta1.RuntimeConfigSpec ) map [string ]string {
1016+ annotations := map [string ]string {}
1017+
1018+ if runtimeConfig .AdminConsole .Port > 0 {
1019+ annotations ["kots.io/embedded-cluster-admin-console-port" ] = strconv .Itoa (runtimeConfig .AdminConsole .Port )
1020+ }
1021+ if runtimeConfig .LocalArtifactMirror .Port > 0 {
1022+ annotations ["kots.io/embedded-cluster-local-artifact-mirror-port" ] = strconv .Itoa (runtimeConfig .LocalArtifactMirror .Port )
1023+ }
1024+ if runtimeConfig .DataDir != "" {
1025+ annotations ["kots.io/embedded-cluster-data-dir" ] = runtimeConfig .DataDir
1026+ }
1027+
1028+ return annotations
1029+ }
1030+
10141031// ecIncludedNamespaces returns the namespaces that should be included in an embedded cluster backup
10151032func ecIncludedNamespaces (in * embeddedclusterv1beta1.Installation ) []string {
10161033 includedNamespaces := []string {"embedded-cluster" , "kube-system" , "openebs" }
0 commit comments