Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

In BuildOn UI, "Individual Build Report" → "Individual Build Metadata" Status field is "Initiated" and not changing to any of the next status "In progress/Success/Failure"

...

In few environments, externalized variables like "k8s_namespace" & "k8s_serviceaccount" using os.environ is not fetching the values. In such case, use the namespace and servceaccount names directly.

For example:

AS-IS:

result = os.popen("curl -k -s `(kubectl config view | grep server | cut -f 2- -d \":\" | tr -d \" \")`/api/v1/namespaces/"+k8s_namespace+"/pods --header \"Authorization: Bearer `(kubectl describe secret $(kubectl get secrets | grep "+k8s_serviceaccount+" | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t')`\"").read()

TO-BE:

result = os.popen("curl -k -s `(kubectl config view | grep server | cut -f 2- -d \":\" | tr -d \" \")`/api/v1/namespaces/default/pods --header \"Authorization: Bearer `(kubectl describe secret $(kubectl get secrets | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t')`\"").read()