Skip to content

Commit

Permalink
Added global variables for app names
Browse files Browse the repository at this point in the history
Signed-off-by: Aayush Chouhan <[email protected]>
  • Loading branch information
achouhan09 committed Oct 7, 2024
1 parent a028faa commit e9f57fb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/diagnostics/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import (
corev1 "k8s.io/api/core/v1"
)

const (
appNoobaaCore = "NOOBAA-CORE"
appNoobaaEndpoint = "NOOBAA-ENDPOINT"
)

// RunReport runs a CLI command
func RunReport(cmd *cobra.Command, args []string) {
log := util.Logger()
Expand Down Expand Up @@ -48,9 +53,9 @@ func proxyStatus(coreApp *appsv1.StatefulSet, endpointApp *appsv1.Deployment) {

log.Print("⏳ Retrieving proxy environment variable details...\n")

printProxyStatus("NOOBAA-CORE", coreApp.Spec.Template.Spec.Containers[0].Env)
printProxyStatus(appNoobaaCore, coreApp.Spec.Template.Spec.Containers[0].Env)

printProxyStatus("NOOBAA-ENDPOINT", endpointApp.Spec.Template.Spec.Containers[0].Env)
printProxyStatus(appNoobaaEndpoint, endpointApp.Spec.Template.Spec.Containers[0].Env)

fmt.Println("")
}
Expand All @@ -61,9 +66,9 @@ func overriddenEnvVar(coreApp *appsv1.StatefulSet, endpointApp *appsv1.Deploymen

log.Print("⏳ Retrieving overridden environment variable details...\n")

printOverriddenEnvVar("NOOBAA-CORE", coreApp.Spec.Template.Spec.Containers[0].Env)
printOverriddenEnvVar(appNoobaaCore, coreApp.Spec.Template.Spec.Containers[0].Env)

printOverriddenEnvVar("NOOBAA-ENDPOINT", endpointApp.Spec.Template.Spec.Containers[0].Env)
printOverriddenEnvVar(appNoobaaEndpoint, endpointApp.Spec.Template.Spec.Containers[0].Env)

fmt.Println("")
}
Expand Down

0 comments on commit e9f57fb

Please sign in to comment.