From 50003ea15d0ba2ca3421ee26994c32bc45abc695 Mon Sep 17 00:00:00 2001 From: Tomasz Mielech Date: Tue, 20 Jul 2021 12:20:44 +0200 Subject: [PATCH 1/4] Adjust the code not to use deprecated version --- CHANGELOG.md | 1 + README.md | 58 +++++++++---------- pkg/deployment/deployment_suite_test.go | 2 +- pkg/deployment/features/maintenance.go | 5 +- pkg/deployment/features/upgrade.go | 5 +- pkg/deployment/pod/builder.go | 4 +- pkg/deployment/pod/encryption.go | 4 -- pkg/deployment/pod/jwt.go | 31 +--------- pkg/deployment/pod/sni.go | 7 +-- pkg/deployment/pod/tls.go | 7 +-- pkg/deployment/pod/upgrade.go | 7 +-- pkg/deployment/pod/upgrade_version_check.go | 7 +-- .../reconcile/plan_builder_rotate_upgrade.go | 2 +- pkg/deployment/resources/pod_creator.go | 11 +--- .../resources/pod_creator_agent_args_test.go | 15 +++-- .../resources/pod_creator_arangod.go | 8 +-- .../pod_creator_coordinator_args_test.go | 15 +++-- .../pod_creator_dbserver_args_test.go | 17 ++++-- .../resources/pod_creator_probes.go | 25 ++------ .../resources/pod_creator_single_args_test.go | 19 +++--- pkg/deployment/resources/pod_termination.go | 7 +-- pkg/util/constants/constants.go | 4 +- 22 files changed, 107 insertions(+), 154 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f11e70752..68384e5c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) +- Drop support for ArangoDB <= 3.5 (versions already EOL) ## [1.2.0](https://github.com/arangodb/kube-arangodb/tree/1.2.0) (2021-07-16) - Enable "Operator Internal Metrics Exporter" by default diff --git a/README.md b/README.md index a25a9b84e..bb33c6240 100644 --- a/README.md +++ b/README.md @@ -38,32 +38,32 @@ covers individual newer features separately. | Platform | Kubernetes Version | ArangoDB Version | State | Remarks | Provider Remarks | |---------------------|--------------------|------------------|------------|-----------------------|------------------------------------| -| Google GKE | 1.17 | >= 3.5.0 | Production | Don't use micro nodes | | -| Google GKE | 1.18 | >= 3.5.0 | Production | Don't use micro nodes | | -| Google GKE | 1.19 | >= 3.5.0 | Production | Don't use micro nodes | | -| Google GKE | 1.20 | >= 3.5.0 | Production | Don't use micro nodes | | -| Azure AKS | 1.18 | >= 3.5.0 | Production | | | -| Azure AKS | 1.19 | >= 3.5.0 | Production | | | -| Azure AKS | 1.20 | >= 3.5.0 | Production | | | -| Amazon EKS | 1.16 | >= 3.5.0 | Production | | [Amazon EKS](./docs/providers/eks) | -| Amazon EKS | 1.17 | >= 3.5.0 | Production | | [Amazon EKS](./docs/providers/eks) | -| Amazon EKS | 1.18 | >= 3.5.0 | Production | | [Amazon EKS](./docs/providers/eks) | -| Amazon EKS | 1.19 | >= 3.5.0 | Production | | [Amazon EKS](./docs/providers/eks) | -| Amazon EKS | 1.20 | >= 3.5.0 | Production | | [Amazon EKS](./docs/providers/eks) | -| IBM Cloud | 1.17 | >= 3.5.0 | Deprecated | | | -| IBM Cloud | 1.18 | >= 3.5.0 | Production | | | -| IBM Cloud | 1.19 | >= 3.5.0 | Production | | | -| IBM Cloud | 1.20 | >= 3.5.0 | Production | | | -| OpenShift | 3.11 | >= 3.5.0 | Production | | | -| OpenShift | 4.2 | >= 3.5.0 | Production | | | -| BareMetal (kubeadm) | 1.16 | >= 3.5.0 | Production | | | -| BareMetal (kubeadm) | 1.17 | >= 3.5.0 | Production | | | -| BareMetal (kubeadm) | 1.18 | >= 3.5.0 | Production | | | -| BareMetal (kubeadm) | 1.19 | >= 3.5.0 | Production | | | -| BareMetal (kubeadm) | 1.20 | >= 3.5.0 | Production | | | -| BareMetal (kubeadm) | 1.21 | >= 3.5.0 | Production | | | -| Minikube | 1.14+ | >= 3.5.0 | Devel Only | | | -| Other | 1.14+ | >= 3.5.0 | Devel Only | | | +| Google GKE | 1.17 | >= 3.6.0 | Production | Don't use micro nodes | | +| Google GKE | 1.18 | >= 3.6.0 | Production | Don't use micro nodes | | +| Google GKE | 1.19 | >= 3.6.0 | Production | Don't use micro nodes | | +| Google GKE | 1.20 | >= 3.6.0 | Production | Don't use micro nodes | | +| Azure AKS | 1.18 | >= 3.6.0 | Production | | | +| Azure AKS | 1.19 | >= 3.6.0 | Production | | | +| Azure AKS | 1.20 | >= 3.6.0 | Production | | | +| Amazon EKS | 1.16 | >= 3.6.0 | Production | | [Amazon EKS](./docs/providers/eks) | +| Amazon EKS | 1.17 | >= 3.6.0 | Production | | [Amazon EKS](./docs/providers/eks) | +| Amazon EKS | 1.18 | >= 3.6.0 | Production | | [Amazon EKS](./docs/providers/eks) | +| Amazon EKS | 1.19 | >= 3.6.0 | Production | | [Amazon EKS](./docs/providers/eks) | +| Amazon EKS | 1.20 | >= 3.6.0 | Production | | [Amazon EKS](./docs/providers/eks) | +| IBM Cloud | 1.17 | >= 3.6.0 | Deprecated | | | +| IBM Cloud | 1.18 | >= 3.6.0 | Production | | | +| IBM Cloud | 1.19 | >= 3.6.0 | Production | | | +| IBM Cloud | 1.20 | >= 3.6.0 | Production | | | +| OpenShift | 3.11 | >= 3.6.0 | Production | | | +| OpenShift | 4.2 | >= 3.6.0 | Production | | | +| BareMetal (kubeadm) | 1.16 | >= 3.6.0 | Production | | | +| BareMetal (kubeadm) | 1.17 | >= 3.6.0 | Production | | | +| BareMetal (kubeadm) | 1.18 | >= 3.6.0 | Production | | | +| BareMetal (kubeadm) | 1.19 | >= 3.6.0 | Production | | | +| BareMetal (kubeadm) | 1.20 | >= 3.6.0 | Production | | | +| BareMetal (kubeadm) | 1.21 | >= 3.6.0 | Production | | | +| Minikube | 1.14+ | >= 3.6.0 | Devel Only | | | +| Other | 1.14+ | >= 3.6.0 | Devel Only | | | Feature-wise production readiness table: @@ -89,9 +89,9 @@ Feature-wise production readiness table: | JWT Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.jwt-rotation | N/A | | Encryption Key Rotation Support | 1.0.4 | > 3.7.0 | Enterprise | Alpha | False | --deployment.feature.encryption-rotation | N/A | | Encryption Key Rotation Support | 1.1.0 | > 3.7.0 | Enterprise | Production | True | --deployment.feature.encryption-rotation | N/A | -| Version Check | 1.1.4 | >= 3.5.0 | Community, Enterprise | Alpha | False | --deployment.feature.upgrade-version-check | N/A | -| Operator Maintenance Management Support | 1.0.7 | >= 3.5.0 | Community, Enterprise | Alpha | False | --deployment.feature.maintenance | N/A | -| Operator Maintenance Management Support | 1.2.0 | >= 3.5.0 | Community, Enterprise | Production | True | --deployment.feature.maintenance | N/A | +| Version Check | 1.1.4 | >= 3.6.0 | Community, Enterprise | Alpha | False | --deployment.feature.upgrade-version-check | N/A | +| Operator Maintenance Management Support | 1.0.7 | >= 3.6.0 | Community, Enterprise | Alpha | False | --deployment.feature.maintenance | N/A | +| Operator Maintenance Management Support | 1.2.0 | >= 3.6.0 | Community, Enterprise | Production | True | --deployment.feature.maintenance | N/A | | Operator Internal Metrics Exporter | 1.1.9 | >= 3.6.0 | Community, Enterprise | Alpha | False | --deployment.feature.metrics-exporter | N/A | | Operator Internal Metrics Exporter | 1.2.0 | >= 3.6.0 | Community, Enterprise | Production | True | --deployment.feature.metrics-exporter | N/A | diff --git a/pkg/deployment/deployment_suite_test.go b/pkg/deployment/deployment_suite_test.go index 7ded8b599..4892e7225 100644 --- a/pkg/deployment/deployment_suite_test.go +++ b/pkg/deployment/deployment_suite_test.go @@ -57,7 +57,7 @@ import ( const ( testNamespace = "default" testDeploymentName = "test" - testVersion = "3.5.2" + testVersion = "3.7.0" testImage = "arangodb/arangodb:" + testVersion testCASecretName = "testCA" testJWTSecretName = "testJWT" diff --git a/pkg/deployment/features/maintenance.go b/pkg/deployment/features/maintenance.go index 83042526c..686b11246 100644 --- a/pkg/deployment/features/maintenance.go +++ b/pkg/deployment/features/maintenance.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package features @@ -29,7 +30,7 @@ func init() { var maintenance = &feature{ name: "maintenance", description: "Database maintenance mode management", - version: "3.5.0", + version: "3.6.0", enterpriseRequired: false, enabledByDefault: true, } diff --git a/pkg/deployment/features/upgrade.go b/pkg/deployment/features/upgrade.go index a5e59a687..ecb84f27a 100644 --- a/pkg/deployment/features/upgrade.go +++ b/pkg/deployment/features/upgrade.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package features @@ -29,7 +30,7 @@ func init() { var upgradeVersionCheck Feature = &feature{ name: "upgrade-version-check", description: "Enable initContainer with pre version check", - version: "3.5.0", + version: "3.6.0", enterpriseRequired: false, enabledByDefault: false, } diff --git a/pkg/deployment/pod/builder.go b/pkg/deployment/pod/builder.go index 6c4da686c..221ded490 100644 --- a/pkg/deployment/pod/builder.go +++ b/pkg/deployment/pod/builder.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package pod @@ -47,6 +48,5 @@ type Input struct { type Builder interface { Args(i Input) k8sutil.OptionPairs Volumes(i Input) ([]core.Volume, []core.VolumeMount) - Envs(i Input) []core.EnvVar Verify(i Input, cachedStatus interfaces.Inspector) error } diff --git a/pkg/deployment/pod/encryption.go b/pkg/deployment/pod/encryption.go index d5fd9d11c..3e768f1c2 100644 --- a/pkg/deployment/pod/encryption.go +++ b/pkg/deployment/pod/encryption.go @@ -124,10 +124,6 @@ func Encryption() Builder { type encryption struct{} -func (e encryption) Envs(i Input) []core.EnvVar { - return nil -} - func (e encryption) Args(i Input) k8sutil.OptionPairs { if !IsEncryptionEnabled(i) { return nil diff --git a/pkg/deployment/pod/jwt.go b/pkg/deployment/pod/jwt.go index 99ca89c3b..4c2b83b15 100644 --- a/pkg/deployment/pod/jwt.go +++ b/pkg/deployment/pod/jwt.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package pod @@ -45,17 +46,6 @@ func IsAuthenticated(i Input) bool { return i.Deployment.IsAuthenticated() } -func VersionHasJWTSecretKeyfile(v driver.Version) bool { - if v.CompareTo("3.3.22") >= 0 && v.CompareTo("3.4.0") < 0 { - return true - } - if v.CompareTo("3.4.2") >= 0 { - return true - } - - return false -} - func JWTSecretFolder(name string) string { return fmt.Sprintf("%s-jwt-folder", name) } @@ -70,19 +60,6 @@ func JWT() Builder { type jwt struct{} -func (e jwt) Envs(i Input) []core.EnvVar { - if !IsAuthenticated(i) { - return nil - } - - if !VersionHasJWTSecretKeyfile(i.Version) { - return []core.EnvVar{k8sutil.CreateEnvSecretKeySelector(constants.EnvArangodJWTSecret, - i.Deployment.Authentication.GetJWTSecretName(), constants.SecretKeyToken)} - } - - return nil -} - func (e jwt) Args(i Input) k8sutil.OptionPairs { if !IsAuthenticated(i) { // Without authentication @@ -95,11 +72,9 @@ func (e jwt) Args(i Input) k8sutil.OptionPairs { if VersionHasJWTSecretKeyfolder(i.Version, i.Enterprise) { options.Add("--server.jwt-secret-folder", k8sutil.ClusterJWTSecretVolumeMountDir) - } else if VersionHasJWTSecretKeyfile(i.Version) { + } else { keyPath := filepath.Join(k8sutil.ClusterJWTSecretVolumeMountDir, constants.SecretKeyToken) options.Add("--server.jwt-secret-keyfile", keyPath) - } else { - options.Addf("--server.jwt-secret", "$(%s)", constants.EnvArangodJWTSecret) } return options diff --git a/pkg/deployment/pod/sni.go b/pkg/deployment/pod/sni.go index b1e1e474b..b1a3b1ea2 100644 --- a/pkg/deployment/pod/sni.go +++ b/pkg/deployment/pod/sni.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package pod @@ -61,10 +62,6 @@ func SNI() Builder { type sni struct{} -func (s sni) Envs(i Input) []core.EnvVar { - return nil -} - func (s sni) isSupported(i Input) bool { if !i.Deployment.TLS.IsSecure() { return false diff --git a/pkg/deployment/pod/tls.go b/pkg/deployment/pod/tls.go index a17708b39..29cff0baa 100644 --- a/pkg/deployment/pod/tls.go +++ b/pkg/deployment/pod/tls.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package pod @@ -55,10 +56,6 @@ func TLS() Builder { type tls struct{} -func (s tls) Envs(i Input) []core.EnvVar { - return nil -} - func (s tls) Verify(i Input, cachedStatus interfaces.Inspector) error { if !IsTLSEnabled(i) { return nil diff --git a/pkg/deployment/pod/upgrade.go b/pkg/deployment/pod/upgrade.go index 3290599da..b6bbccd03 100644 --- a/pkg/deployment/pod/upgrade.go +++ b/pkg/deployment/pod/upgrade.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package pod @@ -35,10 +36,6 @@ func AutoUpgrade() Builder { type autoUpgrade struct{} -func (u autoUpgrade) Envs(i Input) []core.EnvVar { - return nil -} - func (u autoUpgrade) Verify(i Input, cachedStatus interfaces.Inspector) error { return nil } diff --git a/pkg/deployment/pod/upgrade_version_check.go b/pkg/deployment/pod/upgrade_version_check.go index ed662fb33..4e0e04350 100644 --- a/pkg/deployment/pod/upgrade_version_check.go +++ b/pkg/deployment/pod/upgrade_version_check.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package pod @@ -54,10 +55,6 @@ func (u upgradeVersionCheck) Volumes(i Input) ([]core.Volume, []core.VolumeMount return nil, nil } -func (u upgradeVersionCheck) Envs(i Input) []core.EnvVar { - return nil -} - func (u upgradeVersionCheck) Verify(i Input, cachedStatus interfaces.Inspector) error { return nil } diff --git a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go index 691010a6c..d38897d7b 100644 --- a/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go +++ b/pkg/deployment/reconcile/plan_builder_rotate_upgrade.go @@ -327,7 +327,7 @@ func podNeedsRotation(ctx context.Context, log zerolog.Logger, apiObject k8sutil if m.PodSpecVersion != checksum { if _, err := json.Marshal(renderedPod); err == nil { - log.Info().Str("id", m.ID).Str("Before", m.PodSpecVersion).Str("After", checksum).Msgf("XXXXXXXXXXX Pod needs rotation - checksum does not match") + log.Info().Str("id", m.ID).Str("Before", m.PodSpecVersion).Str("After", checksum).Msgf("Pod needs rotation - checksum does not match") } return true, "Pod needs rotation - checksum does not match" } diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index aa55ad46c..fba05b008 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -49,7 +49,6 @@ import ( "github.com/arangodb/kube-arangodb/pkg/deployment/pod" - driver "github.com/arangodb/go-driver" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/constants" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" @@ -59,10 +58,6 @@ import ( "k8s.io/client-go/kubernetes" ) -func versionHasAdvertisedEndpoint(v driver.Version) bool { - return v.CompareTo("3.4.0") >= 0 -} - // createArangodArgsWithUpgrade creates command line arguments for an arangod server upgrade in the given group. func createArangodArgsWithUpgrade(cachedStatus interfaces.Inspector, input pod.Input) ([]string, error) { return createArangodArgs(cachedStatus, input, pod.AutoUpgrade().Args(input)...) @@ -105,8 +100,6 @@ func createArangodArgs(cachedStatus interfaces.Inspector, input pod.Input, addit options.Merge(pod.SNI().Args(input)) - versionHasAdvertisedEndpoint := versionHasAdvertisedEndpoint(input.Version) - endpoint, err := pod.GenerateMemberEndpoint(cachedStatus, input.ApiObject, input.Deployment, input.Group, input.Member) if err != nil { return nil, err @@ -145,7 +138,7 @@ func createArangodArgs(cachedStatus interfaces.Inspector, input pod.Input, addit options.Add("--cluster.my-role", "COORDINATOR") options.Add("--foxx.queues", input.Deployment.Features.GetFoxxQueues()) options.Add("--server.statistics", "true") - if input.Deployment.ExternalAccess.HasAdvertisedEndpoint() && versionHasAdvertisedEndpoint { + if input.Deployment.ExternalAccess.HasAdvertisedEndpoint() { options.Add("--cluster.my-advertised-endpoint", input.Deployment.ExternalAccess.GetAdvertisedEndpoint()) } case api.ServerGroupSingle: @@ -156,7 +149,7 @@ func createArangodArgs(cachedStatus interfaces.Inspector, input pod.Input, addit options.Add("--replication.automatic-failover", "true") options.Add("--cluster.my-address", myTCPURL) options.Add("--cluster.my-role", "SINGLE") - if input.Deployment.ExternalAccess.HasAdvertisedEndpoint() && versionHasAdvertisedEndpoint { + if input.Deployment.ExternalAccess.HasAdvertisedEndpoint() { options.Add("--cluster.my-advertised-endpoint", input.Deployment.ExternalAccess.GetAdvertisedEndpoint()) } } diff --git a/pkg/deployment/resources/pod_creator_agent_args_test.go b/pkg/deployment/resources/pod_creator_agent_args_test.go index 1eb3f64e9..0579a96f2 100644 --- a/pkg/deployment/resources/pod_creator_agent_args_test.go +++ b/pkg/deployment/resources/pod_creator_agent_args_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,13 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Ewout Prangsma +// Author Tomasz Mielech // package resources import ( + "path/filepath" "testing" "github.com/arangodb/kube-arangodb/pkg/deployment/resources/inspector" @@ -37,6 +39,8 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) type inspectorMock interface { @@ -89,6 +93,7 @@ func (i inspectorMockStruct) Get(t *testing.T) inspectorInterface.Inspector { // TestCreateArangodArgsAgent tests createArangodArgs for agent. func TestCreateArangodArgsAgent(t *testing.T) { + jwtSecretFile := filepath.Join(k8sutil.ClusterJWTSecretVolumeMountDir, constants.SecretKeyToken) // Default deployment { apiObject := &api.ArangoDeployment{ @@ -138,7 +143,7 @@ func TestCreateArangodArgsAgent(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=false", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -199,7 +204,7 @@ func TestCreateArangodArgsAgent(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=false", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -262,7 +267,7 @@ func TestCreateArangodArgsAgent(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=tcp://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=false", "--server.storage-engine=rocksdb", }, @@ -380,7 +385,7 @@ func TestCreateArangodArgsAgent(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=false", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", diff --git a/pkg/deployment/resources/pod_creator_arangod.go b/pkg/deployment/resources/pod_creator_arangod.go index 1f4e8afdf..82aad9239 100644 --- a/pkg/deployment/resources/pod_creator_arangod.go +++ b/pkg/deployment/resources/pod_creator_arangod.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// Author Tomasz Mielech +// Author Tomasz Mielech // package resources @@ -144,10 +144,6 @@ func (a *ArangoDContainer) GetImage() string { func (a *ArangoDContainer) GetEnvs() []core.EnvVar { envs := NewEnvBuilder() - if env := pod.JWT().Envs(a.member.AsInput()); len(env) > 0 { - envs.Add(true, env...) - } - if a.spec.License.HasSecretName() { env := k8sutil.CreateEnvSecretKeySelector(constants.EnvArangoLicenseKey, a.spec.License.GetSecretName(), constants.SecretKeyToken) diff --git a/pkg/deployment/resources/pod_creator_coordinator_args_test.go b/pkg/deployment/resources/pod_creator_coordinator_args_test.go index cb04b9fb2..7eb9130bc 100644 --- a/pkg/deployment/resources/pod_creator_coordinator_args_test.go +++ b/pkg/deployment/resources/pod_creator_coordinator_args_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,13 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Ewout Prangsma +// Author Tomasz Mielech // package resources import ( + "path/filepath" "testing" "github.com/stretchr/testify/require" @@ -34,10 +36,13 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) // TestCreateArangodArgsCoordinator tests createArangodArgs for coordinator. func TestCreateArangodArgsCoordinator(t *testing.T) { + jwtSecretFile := filepath.Join(k8sutil.ClusterJWTSecretVolumeMountDir, constants.SecretKeyToken) // Default deployment { apiObject := &api.ArangoDeployment{ @@ -85,7 +90,7 @@ func TestCreateArangodArgsCoordinator(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -143,7 +148,7 @@ func TestCreateArangodArgsCoordinator(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -261,7 +266,7 @@ func TestCreateArangodArgsCoordinator(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=tcp://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", }, @@ -375,7 +380,7 @@ func TestCreateArangodArgsCoordinator(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=mmfiles", "--ssl.ecdh-curve=", diff --git a/pkg/deployment/resources/pod_creator_dbserver_args_test.go b/pkg/deployment/resources/pod_creator_dbserver_args_test.go index 00825749a..1f3b75dcb 100644 --- a/pkg/deployment/resources/pod_creator_dbserver_args_test.go +++ b/pkg/deployment/resources/pod_creator_dbserver_args_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,13 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Ewout Prangsma +// Author Tomasz Mielech // package resources import ( + "path/filepath" "testing" "github.com/stretchr/testify/require" @@ -34,10 +36,13 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" ) // TestCreateArangodArgsDBServer tests createArangodArgs for dbserver. func TestCreateArangodArgsDBServer(t *testing.T) { + jwtSecretFile := filepath.Join(k8sutil.ClusterJWTSecretVolumeMountDir, constants.SecretKeyToken) // Default deployment { apiObject := &api.ArangoDeployment{ @@ -85,7 +90,7 @@ func TestCreateArangodArgsDBServer(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -143,7 +148,7 @@ func TestCreateArangodArgsDBServer(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -202,7 +207,7 @@ func TestCreateArangodArgsDBServer(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -262,7 +267,7 @@ func TestCreateArangodArgsDBServer(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=tcp://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", }, @@ -376,7 +381,7 @@ func TestCreateArangodArgsDBServer(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=mmfiles", "--ssl.ecdh-curve=", diff --git a/pkg/deployment/resources/pod_creator_probes.go b/pkg/deployment/resources/pod_creator_probes.go index cff2cc02b..309bf1232 100644 --- a/pkg/deployment/resources/pod_creator_probes.go +++ b/pkg/deployment/resources/pod_creator_probes.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Adam Janikowski +// Author Tomasz Mielech // package resources @@ -289,18 +290,8 @@ func (r *Resources) probeBuilderReadinessCoreSelect() probeBuilder { } func (r *Resources) probeBuilderReadinessCoreOperator(spec api.DeploymentSpec, group api.ServerGroup, version driver.Version) (Probe, error) { - localPath := "/_api/version" - switch spec.GetMode() { - case api.DeploymentModeActiveFailover: - localPath = "/_admin/echo" - } - // /_admin/server/availability is the way to go, it is available since 3.3.9 - if version.CompareTo("3.3.9") >= 0 { - localPath = "/_admin/server/availability" - } - - args, err := r.probeCommand(spec, localPath) + args, err := r.probeCommand(spec, "/_admin/server/availability") if err != nil { return nil, err } @@ -313,16 +304,8 @@ func (r *Resources) probeBuilderReadinessCoreOperator(spec api.DeploymentSpec, g } func (r *Resources) probeBuilderReadinessCore(spec api.DeploymentSpec, group api.ServerGroup, version driver.Version) (Probe, error) { - localPath := "/_api/version" - switch spec.GetMode() { - case api.DeploymentModeActiveFailover: - localPath = "/_admin/echo" - } - // /_admin/server/availability is the way to go, it is available since 3.3.9 - if version.CompareTo("3.3.9") >= 0 { - localPath = "/_admin/server/availability" - } + localPath := "/_admin/server/availability" authorization := "" if spec.IsAuthenticated() { diff --git a/pkg/deployment/resources/pod_creator_single_args_test.go b/pkg/deployment/resources/pod_creator_single_args_test.go index 5fd4ac6e7..b75547d52 100644 --- a/pkg/deployment/resources/pod_creator_single_args_test.go +++ b/pkg/deployment/resources/pod_creator_single_args_test.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,11 +18,13 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Ewout Prangsma +// Author Tomasz Mielech // package resources import ( + "path/filepath" "testing" "github.com/stretchr/testify/require" @@ -33,11 +35,14 @@ import ( api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util" + "github.com/arangodb/kube-arangodb/pkg/util/constants" + "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" "github.com/stretchr/testify/assert" ) // TestCreateArangodArgsSingle tests createArangodArgs for single server. func TestCreateArangodArgsSingle(t *testing.T) { + jwtSecretFile := filepath.Join(k8sutil.ClusterJWTSecretVolumeMountDir, constants.SecretKeyToken) // Default deployment { apiObject := &api.ArangoDeployment{ @@ -69,7 +74,7 @@ func TestCreateArangodArgsSingle(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -111,7 +116,7 @@ func TestCreateArangodArgsSingle(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -155,7 +160,7 @@ func TestCreateArangodArgsSingle(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=tcp://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", }, @@ -195,7 +200,7 @@ func TestCreateArangodArgsSingle(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=mmfiles", "--ssl.ecdh-curve=", @@ -278,7 +283,7 @@ func TestCreateArangodArgsSingle(t *testing.T) { "--log.output=+", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", @@ -338,7 +343,7 @@ func TestCreateArangodArgsSingle(t *testing.T) { "--replication.automatic-failover=true", "--server.authentication=true", "--server.endpoint=ssl://[::]:8529", - "--server.jwt-secret=$(ARANGOD_JWT_SECRET)", + "--server.jwt-secret-keyfile=" + jwtSecretFile, "--server.statistics=true", "--server.storage-engine=rocksdb", "--ssl.ecdh-curve=", diff --git a/pkg/deployment/resources/pod_termination.go b/pkg/deployment/resources/pod_termination.go index 346d13ca6..d5dd59de2 100644 --- a/pkg/deployment/resources/pod_termination.go +++ b/pkg/deployment/resources/pod_termination.go @@ -148,9 +148,7 @@ func (r *Resources) prepareDBServerPodTermination(ctx context.Context, log zerol resignJobAvailable := false currentVersion := memberStatus.ArangoVersion if currentVersion != "" { - if currentVersion.CompareTo("3.4.7") > 0 && currentVersion.CompareTo("3.5") < 0 { - resignJobAvailable = true - } else if currentVersion.CompareTo("3.5.0") > 0 { + if currentVersion.CompareTo("3.5.0") > 0 { resignJobAvailable = true } } @@ -167,7 +165,7 @@ func (r *Resources) prepareDBServerPodTermination(ctx context.Context, log zerol log.Warn().Err(err).Msg("Failed to get node for member") return errors.WithStack(err) } else if node.Spec.Unschedulable { - if !r.context.GetSpec().IsNetworkAttachedVolumes() || !resignJobAvailable { + if !r.context.GetSpec().IsNetworkAttachedVolumes() { dbserverDataWillBeGone = true } } @@ -192,6 +190,7 @@ func (r *Resources) prepareDBServerPodTermination(ctx context.Context, log zerol } // Is this a simple pod restart? + // TODO if !dbserverDataWillBeGone && !resignJobAvailable { log.Debug().Msg("Pod is just being restarted, safe to remove dbserver pod") return nil diff --git a/pkg/util/constants/constants.go b/pkg/util/constants/constants.go index 10fbf0a60..1ed45cf20 100644 --- a/pkg/util/constants/constants.go +++ b/pkg/util/constants/constants.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2020 ArangoDB GmbH, Cologne, Germany +// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // // Author Ewout Prangsma +// Author Tomasz Mielech // package constants @@ -30,7 +31,6 @@ const ( EnvOperatorPodIP = "MY_POD_IP" EnvArangoLicenseKey = "ARANGO_LICENSE_KEY" // Contains the License Key for the Docker Image - EnvArangodJWTSecret = "ARANGOD_JWT_SECRET" // Contains JWT secret for the ArangoDB cluster EnvArangoSyncMonitoringToken = "ARANGOSYNC_MONITORING_TOKEN" // Constains monitoring token for ArangoSync servers SecretEncryptionKey = "key" // Key in a Secret.Data used to store an 32-byte encryption key From e8f160045c14dcf29898773c32dc9f637841e754 Mon Sep 17 00:00:00 2001 From: Tomasz Mielech Date: Tue, 20 Jul 2021 13:44:22 +0200 Subject: [PATCH 2/4] remove unused condition for restarting pod --- pkg/deployment/resources/pod_termination.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pkg/deployment/resources/pod_termination.go b/pkg/deployment/resources/pod_termination.go index d5dd59de2..128d1c86b 100644 --- a/pkg/deployment/resources/pod_termination.go +++ b/pkg/deployment/resources/pod_termination.go @@ -145,14 +145,6 @@ func (r *Resources) prepareDBServerPodTermination(ctx context.Context, log zerol return nil } - resignJobAvailable := false - currentVersion := memberStatus.ArangoVersion - if currentVersion != "" { - if currentVersion.CompareTo("3.5.0") > 0 { - resignJobAvailable = true - } - } - // Check node the pod is scheduled on dbserverDataWillBeGone := false if !r.context.GetScope().IsNamespaced() && p.Spec.NodeName != "" { @@ -189,13 +181,6 @@ func (r *Resources) prepareDBServerPodTermination(ctx context.Context, log zerol dbserverDataWillBeGone = true } - // Is this a simple pod restart? - // TODO - if !dbserverDataWillBeGone && !resignJobAvailable { - log.Debug().Msg("Pod is just being restarted, safe to remove dbserver pod") - return nil - } - // Inspect cleaned out state ctxChild, cancel = context.WithTimeout(ctx, arangod.GetRequestTimeout()) defer cancel() From 92649ba3df5f787f77ea860cedaf1ab615ffe613 Mon Sep 17 00:00:00 2001 From: ajanikow <12255597+ajanikow@users.noreply.github.com> Date: Mon, 25 Oct 2021 15:17:34 +0000 Subject: [PATCH 3/4] Review --- pkg/deployment/pod/builder.go | 1 + pkg/deployment/pod/encryption.go | 4 ++++ pkg/deployment/pod/jwt.go | 4 ++++ pkg/deployment/pod/sni.go | 4 ++++ pkg/deployment/pod/tls.go | 4 ++++ pkg/deployment/pod/upgrade.go | 4 ++++ pkg/deployment/pod/upgrade_version_check.go | 4 ++++ pkg/deployment/resources/pod_creator.go | 1 - 8 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pkg/deployment/pod/builder.go b/pkg/deployment/pod/builder.go index 0970aa106..bd5eb5b7e 100644 --- a/pkg/deployment/pod/builder.go +++ b/pkg/deployment/pod/builder.go @@ -48,5 +48,6 @@ type Input struct { type Builder interface { Args(i Input) k8sutil.OptionPairs Volumes(i Input) ([]core.Volume, []core.VolumeMount) + Envs(i Input) []core.EnvVar Verify(i Input, cachedStatus interfaces.Inspector) error } diff --git a/pkg/deployment/pod/encryption.go b/pkg/deployment/pod/encryption.go index 39b7e0ce8..bf6a9b586 100644 --- a/pkg/deployment/pod/encryption.go +++ b/pkg/deployment/pod/encryption.go @@ -126,6 +126,10 @@ func Encryption() Builder { type encryption struct{} +func (e encryption) Envs(i Input) []core.EnvVar { + return nil +} + func (e encryption) Args(i Input) k8sutil.OptionPairs { if !IsEncryptionEnabled(i) { return nil diff --git a/pkg/deployment/pod/jwt.go b/pkg/deployment/pod/jwt.go index a7dfb5d56..fab1114ce 100644 --- a/pkg/deployment/pod/jwt.go +++ b/pkg/deployment/pod/jwt.go @@ -60,6 +60,10 @@ func JWT() Builder { type jwt struct{} +func (e jwt) Envs(i Input) []core.EnvVar { + return nil +} + func (e jwt) Args(i Input) k8sutil.OptionPairs { if !IsAuthenticated(i) { // Without authentication diff --git a/pkg/deployment/pod/sni.go b/pkg/deployment/pod/sni.go index cd69e7825..9e20e9229 100644 --- a/pkg/deployment/pod/sni.go +++ b/pkg/deployment/pod/sni.go @@ -62,6 +62,10 @@ func SNI() Builder { type sni struct{} +func (s sni) Envs(i Input) []core.EnvVar { + return nil +} + func (s sni) isSupported(i Input) bool { if !i.Deployment.TLS.IsSecure() { return false diff --git a/pkg/deployment/pod/tls.go b/pkg/deployment/pod/tls.go index 04304ab89..f55ef38f2 100644 --- a/pkg/deployment/pod/tls.go +++ b/pkg/deployment/pod/tls.go @@ -56,6 +56,10 @@ func TLS() Builder { type tls struct{} +func (s tls) Envs(i Input) []core.EnvVar { + return nil +} + func (s tls) Verify(i Input, cachedStatus interfaces.Inspector) error { if !IsTLSEnabled(i) { return nil diff --git a/pkg/deployment/pod/upgrade.go b/pkg/deployment/pod/upgrade.go index e8bb41547..71ef8c218 100644 --- a/pkg/deployment/pod/upgrade.go +++ b/pkg/deployment/pod/upgrade.go @@ -36,6 +36,10 @@ func AutoUpgrade() Builder { type autoUpgrade struct{} +func (u autoUpgrade) Envs(i Input) []core.EnvVar { + return nil +} + func (u autoUpgrade) Verify(i Input, cachedStatus interfaces.Inspector) error { return nil } diff --git a/pkg/deployment/pod/upgrade_version_check.go b/pkg/deployment/pod/upgrade_version_check.go index 014c13b6e..9afeccd5a 100644 --- a/pkg/deployment/pod/upgrade_version_check.go +++ b/pkg/deployment/pod/upgrade_version_check.go @@ -37,6 +37,10 @@ func UpgradeVersionCheck() Builder { type upgradeVersionCheck struct{} +func (u upgradeVersionCheck) Envs(i Input) []core.EnvVar { + return nil +} + func (u upgradeVersionCheck) Args(i Input) k8sutil.OptionPairs { if features.UpgradeVersionCheck().Enabled() { switch i.Group { diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index f5a583229..0e40b71b0 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -50,7 +50,6 @@ import ( inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" - "github.com/arangodb/go-driver" "k8s.io/apimachinery/pkg/types" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" From 65b075c3ace40f99df42eb3f1ce4bc05f16b0ee7 Mon Sep 17 00:00:00 2001 From: ajanikow <12255597+ajanikow@users.noreply.github.com> Date: Tue, 26 Oct 2021 08:13:58 +0000 Subject: [PATCH 4/4] FMT --- pkg/deployment/resources/pod_creator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index 0e40b71b0..8d526fca6 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -51,7 +51,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces" "k8s.io/apimachinery/pkg/types" - + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/pod" "github.com/arangodb/kube-arangodb/pkg/util/constants"