Skip to content

Commit

Permalink
align env var keys with public docs (#232)
Browse files Browse the repository at this point in the history
Signed-off-by: Milica Cvrkota <[email protected]>
  • Loading branch information
Milica-Cvrkota-IBM authored Jan 10, 2025
1 parent e911aba commit 536714d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 48 deletions.
12 changes: 6 additions & 6 deletions api/v1/inline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
6 changes: 3 additions & 3 deletions pkg/k8s/object/builders/agent/daemonset/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions pkg/k8s/object/builders/agent/daemonset/daemonset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 9 additions & 9 deletions pkg/k8s/object/builders/common/env/env_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const (
MavenRepoURLEnv
MavenRepoFeaturesPath
MavenRepoSharedPath
MirrorFeaturesRepoUrlEnv
MirrorFeaturesRepoUsernameEnv
MirrorFeaturesRepoPasswordEnv
MirrorReleaseRepoUrlEnv
MirrorReleaseRepoUsernameEnv
MirrorReleaseRepoPasswordEnv
MirrorSharedRepoUrlEnv
MirrorSharedRepoUsernameEnv
MirrorSharedRepoPasswordEnv
Expand Down Expand Up @@ -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:
Expand Down
54 changes: 27 additions & 27 deletions pkg/k8s/object/builders/common/env/env_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -77,9 +77,9 @@ func TestEnvBuilderBuild(t *testing.T) {
MavenRepoURLEnv,
MavenRepoFeaturesPath,
MavenRepoSharedPath,
MirrorFeaturesRepoUrlEnv,
MirrorFeaturesRepoUsernameEnv,
MirrorFeaturesRepoPasswordEnv,
MirrorReleaseRepoUrlEnv,
MirrorReleaseRepoUsernameEnv,
MirrorReleaseRepoPasswordEnv,
MirrorSharedRepoUrlEnv,
MirrorSharedRepoUsernameEnv,
MirrorSharedRepoPasswordEnv,
Expand Down Expand Up @@ -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"},
Expand Down

0 comments on commit 536714d

Please sign in to comment.