Printing overrided vars in cli command noobaa diagnostics report#1445
Printing overrided vars in cli command noobaa diagnostics report#1445aayushchouhan09 merged 2 commits intonoobaa:masterfrom
noobaa diagnostics report#1445Conversation
|
@achouhan09 Could you please update the testing instructions in the PR? |
|
I was just wondering - is there a reason we're only checking the core pod for overrides? I think it'd be very useful and important to check one of the endpoints as well |
@Neon-White Yes, make sense. I have added a check for endpoint as well. Thanks |
080d4f2 to
a834825
Compare
@Neon-White @achouhan09 Do we also need to add the proxy check on the endpoint? |
Not sure, but for proxy changes I need to update the operator deployment and then it will get reflected to other pods, so for proxy status we can check for any one of the core/endpoint is updated or not. @Neon-White pls correct me if I am wrong. |
|
@achouhan09 @liranmauda Ideally, this is how users would configure their proxies, which would be a reliable way to detect it. |
Signed-off-by: Aayush Chouhan <achouhan@redhat.com>
Great! |
a834825 to
266508b
Compare
Signed-off-by: Aayush Chouhan <achouhan@redhat.com>
266508b to
6eaff91
Compare
| fmt.Print("Overridden Environment Variables Check (NOOBAA-CORE):\n----------------------------------\n") | ||
| foundCoreEnv := false | ||
| for _, envVar := range coreApp.Spec.Template.Spec.Containers[0].Env { | ||
| if strings.HasPrefix(envVar.Name, "CONFIG_JS_") { | ||
| fmt.Printf(" ✔ %s : %s\n", envVar.Name, envVar.Value) | ||
| foundCoreEnv = true | ||
| } | ||
| } | ||
| if !foundCoreEnv { | ||
| fmt.Printf(" ❌ No overridden environment variables found.") | ||
| } | ||
| fmt.Println("") | ||
|
|
||
| fmt.Print("Overridden Environment Variables Check (ENDPOINT):\n----------------------------------\n") | ||
| foundEndpointEnv := false | ||
| for _, envVar := range endpointApp.Spec.Template.Spec.Containers[0].Env { | ||
| if strings.HasPrefix(envVar.Name, "CONFIG_JS_") { | ||
| fmt.Printf(" ✔ %s : %s\n", envVar.Name, envVar.Value) | ||
| foundEndpointEnv = true | ||
| } | ||
| } | ||
| if !foundEndpointEnv { | ||
| fmt.Printf(" ❌ No overridden environment variables found.") | ||
| } |
There was a problem hiding this comment.
This duplication can be a function that gets a kubernetes object and is called twice, once for core sts and a second time for endpoint deployment.
@achouhan09 Create a new PR that consolidates those into a single function.
| coreApp := util.KubeObject(bundle.File_deploy_internal_statefulset_core_yaml).(*appsv1.StatefulSet) | ||
| coreApp.Namespace = options.Namespace | ||
| if !util.KubeCheck(coreApp) { | ||
| log.Fatalf(`❌ Could not get core StatefulSet %q in Namespace %q`, | ||
| coreApp.Name, coreApp.Namespace) | ||
| } | ||
|
|
||
| // Fetching endpoint configurations | ||
| endpointApp := util.KubeObject(bundle.File_deploy_internal_deployment_endpoint_yaml).(*appsv1.Deployment) | ||
| endpointApp.Namespace = options.Namespace | ||
| if !util.KubeCheck(endpointApp) { | ||
| log.Fatalf(`❌ Could not get endpoint Deployment %q in Namespace %q`, | ||
| endpointApp.Name, endpointApp.Namespace) | ||
| } |
There was a problem hiding this comment.
This duplication can be a function that gets a kubernetes object and is called twice, once for core sts and a second time for endpoint deployment.
@achouhan09 Create a new PR that consolidates those into a single function.
Explain the changes
noobaa diagnostics report.Output:

Testing Instructions:
noobaa diagnostics reportcli command to check the status.