Skip to content

Commit a38c002

Browse files
authored
feat(ec): consolidate data directories (#4935)
* feat(ec): consolidate data directories * f * f * f
1 parent 3255275 commit a38c002

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ require (
4949
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
5050
github.com/pkg/errors v0.9.1
5151
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
52-
github.com/replicatedhq/embedded-cluster/kinds v1.14.3
52+
github.com/replicatedhq/embedded-cluster/kinds v1.15.0
5353
github.com/replicatedhq/kotskinds v0.0.0-20240718194123-1018dd404e95
5454
github.com/replicatedhq/kurlkinds v1.5.0
5555
github.com/replicatedhq/troubleshoot v0.103.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,8 @@ github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDO
13421342
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
13431343
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
13441344
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
1345-
github.com/replicatedhq/embedded-cluster/kinds v1.14.3 h1:4TdzuMT7paGk+sjtWIQZ8WpyOr5a3u++VUcZfvfnzoE=
1346-
github.com/replicatedhq/embedded-cluster/kinds v1.14.3/go.mod h1:eCRG7AjsENoi62kguGWKbYWMuri8uR+QV1yarvn/MBY=
1345+
github.com/replicatedhq/embedded-cluster/kinds v1.15.0 h1:hqlDSjyZ+kBnyPaE9GSjZN2TVZKgNc8b9tF2XgXcR8w=
1346+
github.com/replicatedhq/embedded-cluster/kinds v1.15.0/go.mod h1:eCRG7AjsENoi62kguGWKbYWMuri8uR+QV1yarvn/MBY=
13471347
github.com/replicatedhq/kotskinds v0.0.0-20240718194123-1018dd404e95 h1:JhwPz4Bgbz5iYl3UV2EB+HnF9oW/eCRi+hASAz+J6XI=
13481348
github.com/replicatedhq/kotskinds v0.0.0-20240718194123-1018dd404e95/go.mod h1:QjhIUu3+OmHZ09u09j3FCoTt8F3BYtQglS+OLmftu9I=
13491349
github.com/replicatedhq/kurlkinds v1.5.0 h1:zZ0PKNeh4kXvSzVGkn62DKTo314GxhXg1TSB3azURMc=

pkg/kotsadmsnapshot/backup.go

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
10151032
func ecIncludedNamespaces(in *embeddedclusterv1beta1.Installation) []string {
10161033
includedNamespaces := []string{"embedded-cluster", "kube-system", "openebs"}

0 commit comments

Comments
 (0)