From 536714d017506a88964de6bee7f7959536eab5e6 Mon Sep 17 00:00:00 2001 From: Milica-Cvrkota-IBM <109787570+Milica-Cvrkota-IBM@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:08:10 +0100 Subject: [PATCH] align env var keys with public docs (#232) Signed-off-by: Milica Cvrkota --- api/v1/inline_types.go | 12 ++--- .../builders/agent/daemonset/daemonset.go | 6 +-- .../agent/daemonset/daemonset_test.go | 6 +-- .../object/builders/common/env/env_builder.go | 18 +++---- .../builders/common/env/env_builder_test.go | 54 +++++++++---------- 5 files changed, 48 insertions(+), 48 deletions(-) diff --git a/api/v1/inline_types.go b/api/v1/inline_types.go index 46215c72..5cf65f01 100644 --- a/api/v1/inline_types.go +++ b/api/v1/inline_types.go @@ -164,15 +164,15 @@ type BaseAgentSpec struct { // Sets the INSTANA_MVN_REPOSITORY_SHARED_PATH environment variable // +kubebuilder:validation:Optional MvnRepoSharedPath string `json:"instanaMvnRepoSharedPath,omitempty"` - // Sets the INSTANA_FEATURES_REPOSITORY_MIRROR_URL environment variable + // Sets the AGENT_RELEASE_REPOSITORY_MIRROR_URL environment variable // +kubebuilder:validation:Optional - MirrorFeaturesRepoUrl string `json:"instanaFeaturesRepoMirrorUrl,omitempty"` - // Sets the INSTANA_FEATURES_REPOSITORY_MIRROR_USERNAME environment variable + MirrorReleaseRepoUrl string `json:"agentReleaseRepoMirrorUrl,omitempty"` + // Sets the AGENT_RELEASE_REPOSITORY_MIRROR_USERNAME environment variable // +kubebuilder:validation:Optional - MirrorFeaturesRepoUsername string `json:"instanaFeaturesRepoMirrorUsername,omitempty"` - // Sets the INSTANA_FEATURES_REPOSITORY_MIRROR_PASSWORD environment variable + MirrorReleaseRepoUsername string `json:"agentReleaseRepoMirrorUsername,omitempty"` + // Sets the AGENT_RELEASE_REPOSITORY_MIRROR_PASSWORD environment variable // +kubebuilder:validation:Optional - MirrorFeaturesRepoPassword string `json:"instanaFeaturesRepoMirrorPassword,omitempty"` + MirrorReleaseRepoPassword string `json:"agentReleaseRepoMirrorPassword,omitempty"` // Sets the INSTANA_SHARED_REPOSITORY_MIRROR_URL environment variable // +kubebuilder:validation:Optional MirrorSharedRepoUrl string `json:"instanaSharedRepoMirrorUrl,omitempty"` diff --git a/pkg/k8s/object/builders/agent/daemonset/daemonset.go b/pkg/k8s/object/builders/agent/daemonset/daemonset.go index ff6bb202..d5f46fcc 100644 --- a/pkg/k8s/object/builders/agent/daemonset/daemonset.go +++ b/pkg/k8s/object/builders/agent/daemonset/daemonset.go @@ -83,9 +83,9 @@ func (d *daemonSetBuilder) getEnvVars() []corev1.EnvVar { env.MavenRepoURLEnv, env.MavenRepoFeaturesPath, env.MavenRepoSharedPath, - env.MirrorFeaturesRepoUrlEnv, - env.MirrorFeaturesRepoUsernameEnv, - env.MirrorFeaturesRepoPasswordEnv, + env.MirrorReleaseRepoUrlEnv, + env.MirrorReleaseRepoUsernameEnv, + env.MirrorReleaseRepoPasswordEnv, env.MirrorSharedRepoUrlEnv, env.MirrorSharedRepoUsernameEnv, env.MirrorSharedRepoPasswordEnv, diff --git a/pkg/k8s/object/builders/agent/daemonset/daemonset_test.go b/pkg/k8s/object/builders/agent/daemonset/daemonset_test.go index 6028cde8..b1808dd1 100644 --- a/pkg/k8s/object/builders/agent/daemonset/daemonset_test.go +++ b/pkg/k8s/object/builders/agent/daemonset/daemonset_test.go @@ -152,9 +152,9 @@ func TestDaemonSetBuilder_getEnvVars(t *testing.T) { env.MavenRepoURLEnv, env.MavenRepoFeaturesPath, env.MavenRepoSharedPath, - env.MirrorFeaturesRepoUrlEnv, - env.MirrorFeaturesRepoUsernameEnv, - env.MirrorFeaturesRepoPasswordEnv, + env.MirrorReleaseRepoUrlEnv, + env.MirrorReleaseRepoUsernameEnv, + env.MirrorReleaseRepoPasswordEnv, env.MirrorSharedRepoUrlEnv, env.MirrorSharedRepoUsernameEnv, env.MirrorSharedRepoPasswordEnv, diff --git a/pkg/k8s/object/builders/common/env/env_builder.go b/pkg/k8s/object/builders/common/env/env_builder.go index bcda9873..22975ea8 100644 --- a/pkg/k8s/object/builders/common/env/env_builder.go +++ b/pkg/k8s/object/builders/common/env/env_builder.go @@ -29,9 +29,9 @@ const ( MavenRepoURLEnv MavenRepoFeaturesPath MavenRepoSharedPath - MirrorFeaturesRepoUrlEnv - MirrorFeaturesRepoUsernameEnv - MirrorFeaturesRepoPasswordEnv + MirrorReleaseRepoUrlEnv + MirrorReleaseRepoUsernameEnv + MirrorReleaseRepoPasswordEnv MirrorSharedRepoUrlEnv MirrorSharedRepoUsernameEnv MirrorSharedRepoPasswordEnv @@ -113,18 +113,18 @@ func (e *envBuilder) build(envVar EnvVar) *corev1.EnvVar { return stringToEnvVar("INSTANA_MVN_REPOSITORY_FEATURES_PATH", e.agent.Spec.Agent.MvnRepoFeaturesPath) case MavenRepoSharedPath: return stringToEnvVar("INSTANA_MVN_REPOSITORY_SHARED_PATH", e.agent.Spec.Agent.MvnRepoSharedPath) - case MirrorFeaturesRepoUrlEnv: - return stringToEnvVar("INSTANA_FEATURES_REPOSITORY_MIRROR_URL", e.agent.Spec.Agent.MirrorFeaturesRepoUrl) - case MirrorFeaturesRepoUsernameEnv: - return stringToEnvVar("INSTANA_FEATURES_REPOSITORY_MIRROR_USERNAME", e.agent.Spec.Agent.MirrorFeaturesRepoUsername) + case MirrorReleaseRepoUrlEnv: + return stringToEnvVar("AGENT_RELEASE_REPOSITORY_MIRROR_URL", e.agent.Spec.Agent.MirrorReleaseRepoUrl) + case MirrorReleaseRepoUsernameEnv: + return stringToEnvVar("AGENT_RELEASE_REPOSITORY_MIRROR_USERNAME", e.agent.Spec.Agent.MirrorReleaseRepoUsername) case MirrorSharedRepoUrlEnv: return stringToEnvVar("INSTANA_SHARED_REPOSITORY_MIRROR_URL", e.agent.Spec.Agent.MirrorSharedRepoUrl) case MirrorSharedRepoUsernameEnv: return stringToEnvVar("INSTANA_SHARED_REPOSITORY_MIRROR_USERNAME", e.agent.Spec.Agent.MirrorSharedRepoUsername) case MirrorSharedRepoPasswordEnv: return stringToEnvVar("INSTANA_SHARED_REPOSITORY_MIRROR_PASSWORD", e.agent.Spec.Agent.MirrorSharedRepoPassword) - case MirrorFeaturesRepoPasswordEnv: - return stringToEnvVar("INSTANA_FEATURES_REPOSITORY_MIRROR_PASSWORD", e.agent.Spec.Agent.MirrorFeaturesRepoPassword) + case MirrorReleaseRepoPasswordEnv: + return stringToEnvVar("AGENT_RELEASE_REPOSITORY_MIRROR_PASSWORD", e.agent.Spec.Agent.MirrorReleaseRepoPassword) case ProxyHostEnv: return stringToEnvVar("INSTANA_AGENT_PROXY_HOST", e.agent.Spec.Agent.ProxyHost) case ProxyPortEnv: diff --git a/pkg/k8s/object/builders/common/env/env_builder_test.go b/pkg/k8s/object/builders/common/env/env_builder_test.go index ab6c6d7f..29c102a7 100644 --- a/pkg/k8s/object/builders/common/env/env_builder_test.go +++ b/pkg/k8s/object/builders/common/env/env_builder_test.go @@ -40,27 +40,27 @@ func TestEnvBuilderBuild(t *testing.T) { Zone: instanav1.Name{Name: "INSTANA_AGENT_SPEC_ZONE_NAME"}, Cluster: instanav1.Name{Name: "INSTANA_AGENT_SPEC_CLUSTER_NAME"}, Agent: instanav1.BaseAgentSpec{ - EndpointHost: "INSTANA_AGENT_ENDPOINT_HOST", - EndpointPort: "INSTANA_AGENT_ENDPOINT_PORT", - MvnRepoUrl: "INSTANA_MVN_REPOSITORY_URL", - MvnRepoFeaturesPath: "INSTANA_MVN_REPOSITORY_FEATURES_PATH", - MvnRepoSharedPath: "INSTANA_MVN_REPOSITORY_SHARED_PATH", - MirrorFeaturesRepoUrl: "INSTANA_FEATURES_REPOSITORY_MIRROR_URL", - MirrorFeaturesRepoUsername: "INSTANA_FEATURES_REPOSITORY_MIRROR_USERNAME", - MirrorFeaturesRepoPassword: "INSTANA_FEATURES_REPOSITORY_MIRROR_PASSWORD", - MirrorSharedRepoUrl: "INSTANA_SHARED_REPOSITORY_MIRROR_URL", - MirrorSharedRepoUsername: "INSTANA_SHARED_REPOSITORY_MIRROR_USERNAME", - MirrorSharedRepoPassword: "INSTANA_SHARED_REPOSITORY_MIRROR_PASSWORD", - ProxyHost: "INSTANA_AGENT_PROXY_HOST", - ProxyPort: "", - ProxyProtocol: "INSTANA_AGENT_PROXY_PROTOCOL", - ProxyUser: "INSTANA_AGENT_PROXY_USER", - ProxyPassword: "INSTANA_AGENT_PROXY_PASSWORD", - ProxyUseDNS: true, - ListenAddress: "INSTANA_AGENT_HTTP_LISTEN", - RedactKubernetesSecrets: "INSTANA_KUBERNETES_REDACT_SECRETS", - Mode: "INSTANA_BASE_AGENT_SPEC_MODE", - KeysSecret: "INSTANA_AGENT_KEYS_SECRET", + EndpointHost: "INSTANA_AGENT_ENDPOINT_HOST", + EndpointPort: "INSTANA_AGENT_ENDPOINT_PORT", + MvnRepoUrl: "INSTANA_MVN_REPOSITORY_URL", + MvnRepoFeaturesPath: "INSTANA_MVN_REPOSITORY_FEATURES_PATH", + MvnRepoSharedPath: "INSTANA_MVN_REPOSITORY_SHARED_PATH", + MirrorReleaseRepoUrl: "AGENT_RELEASE_REPOSITORY_MIRROR_URL", + MirrorReleaseRepoUsername: "AGENT_RELEASE_REPOSITORY_MIRROR_USERNAME", + MirrorReleaseRepoPassword: "AGENT_RELEASE_REPOSITORY_MIRROR_PASSWORD", + MirrorSharedRepoUrl: "INSTANA_SHARED_REPOSITORY_MIRROR_URL", + MirrorSharedRepoUsername: "INSTANA_SHARED_REPOSITORY_MIRROR_USERNAME", + MirrorSharedRepoPassword: "INSTANA_SHARED_REPOSITORY_MIRROR_PASSWORD", + ProxyHost: "INSTANA_AGENT_PROXY_HOST", + ProxyPort: "", + ProxyProtocol: "INSTANA_AGENT_PROXY_PROTOCOL", + ProxyUser: "INSTANA_AGENT_PROXY_USER", + ProxyPassword: "INSTANA_AGENT_PROXY_PASSWORD", + ProxyUseDNS: true, + ListenAddress: "INSTANA_AGENT_HTTP_LISTEN", + RedactKubernetesSecrets: "INSTANA_KUBERNETES_REDACT_SECRETS", + Mode: "INSTANA_BASE_AGENT_SPEC_MODE", + KeysSecret: "INSTANA_AGENT_KEYS_SECRET", Env: map[string]string{ "USER_SPECIFIED_ENV_VAR1": "USER_SPECIFIED_ENV_VAR_VAL1", "USER_SPECIFIED_ENV_VAR2": "USER_SPECIFIED_ENV_VAR_VAL2", @@ -77,9 +77,9 @@ func TestEnvBuilderBuild(t *testing.T) { MavenRepoURLEnv, MavenRepoFeaturesPath, MavenRepoSharedPath, - MirrorFeaturesRepoUrlEnv, - MirrorFeaturesRepoUsernameEnv, - MirrorFeaturesRepoPasswordEnv, + MirrorReleaseRepoUrlEnv, + MirrorReleaseRepoUsernameEnv, + MirrorReleaseRepoPasswordEnv, MirrorSharedRepoUrlEnv, MirrorSharedRepoUsernameEnv, MirrorSharedRepoPasswordEnv, @@ -119,9 +119,9 @@ func TestEnvBuilderBuild(t *testing.T) { {Name: "INSTANA_MVN_REPOSITORY_URL", Value: "INSTANA_MVN_REPOSITORY_URL"}, {Name: "INSTANA_MVN_REPOSITORY_FEATURES_PATH", Value: "INSTANA_MVN_REPOSITORY_FEATURES_PATH"}, {Name: "INSTANA_MVN_REPOSITORY_SHARED_PATH", Value: "INSTANA_MVN_REPOSITORY_SHARED_PATH"}, - {Name: "INSTANA_FEATURES_REPOSITORY_MIRROR_URL", Value: "INSTANA_FEATURES_REPOSITORY_MIRROR_URL"}, - {Name: "INSTANA_FEATURES_REPOSITORY_MIRROR_USERNAME", Value: "INSTANA_FEATURES_REPOSITORY_MIRROR_USERNAME"}, - {Name: "INSTANA_FEATURES_REPOSITORY_MIRROR_PASSWORD", Value: "INSTANA_FEATURES_REPOSITORY_MIRROR_PASSWORD"}, + {Name: "AGENT_RELEASE_REPOSITORY_MIRROR_URL", Value: "AGENT_RELEASE_REPOSITORY_MIRROR_URL"}, + {Name: "AGENT_RELEASE_REPOSITORY_MIRROR_USERNAME", Value: "AGENT_RELEASE_REPOSITORY_MIRROR_USERNAME"}, + {Name: "AGENT_RELEASE_REPOSITORY_MIRROR_PASSWORD", Value: "AGENT_RELEASE_REPOSITORY_MIRROR_PASSWORD"}, {Name: "INSTANA_SHARED_REPOSITORY_MIRROR_URL", Value: "INSTANA_SHARED_REPOSITORY_MIRROR_URL"}, {Name: "INSTANA_SHARED_REPOSITORY_MIRROR_USERNAME", Value: "INSTANA_SHARED_REPOSITORY_MIRROR_USERNAME"}, {Name: "INSTANA_SHARED_REPOSITORY_MIRROR_PASSWORD", Value: "INSTANA_SHARED_REPOSITORY_MIRROR_PASSWORD"},