kraan icon indicating copy to clipboard operation
kraan copied to clipboard

Update reason and message fields with details of apply progress

Open nab-gha opened this issue 4 years ago • 0 comments

At present when a layer is being applied the reason field of the status condition is set to AddonsLayer is being applied. It would be informative to populate the reason and message fields with more details, i.e. the name of the helm release we are waiting for and the most recent events. For example, given a helm release deployment failing due to test failures we could get events for helm releases

kubectl get events -n mgmt -o json | jq -r '.items[] | select(."involvedObject"."kind" == "HelmRelease") '
{
  "apiVersion": "v1",
  "count": 14,
  "eventTime": null,
  "firstTimestamp": "2020-09-09T09:14:08Z",
  "involvedObject": {
    "apiVersion": "helm.fluxcd.io/v1",
    "kind": "HelmRelease",
    "name": "microservice-1",
    "namespace": "mgmt",
    "resourceVersion": "1050516",
    "uid": "21f2c5bc-f211-4514-8b55-c1decffa965b"
  },
  "kind": "Event",
  "lastTimestamp": "2020-09-09T09:38:09Z",
  "message": "(combined from similar events): synchronization of release 'microservice-test-1' in namespace 'mgmt' failed: test failed: pod microservice-test-1-podinfo-grpc-test-12rqo failed",
  "metadata": {
    "creationTimestamp": "2020-09-09T09:14:08Z",
    "name": "microservice-1.163312b203b2a122",
    "namespace": "mgmt",
    "resourceVersion": "1057305",
    "selfLink": "/api/v1/namespaces/mgmt/events/microservice-1.163312b203b2a122",
    "uid": "398c8c58-42df-43e5-82d0-9fd2192c1592"
  },
  "reason": "FailedReleaseSync",
  "reportingComponent": "",
  "reportingInstance": "",
  "source": {
    "component": "helm-operator"
  },
  "type": "Warning"
}

it would be helpful if the reason could be updated with something like

waiting for  'microservice-test-1' in namespace 'mgmt', FailedReleaseSync

and the message with

 "(combined from similar events): synchronization of release 'microservice-test-1' in namespace 'mgmt' failed: test failed: pod microservice-test-1-podinfo-grpc-test-12rqo failed"

nab-gha avatar Sep 09 '20 09:09 nab-gha