canonical / charmed-kubeflow-chisme

Shared Utilities used across Charmed Kubeflow
Apache License 2.0
1 stars 4 forks source link

_get_missing_kubernetes_resources() will not validate applied namespaced k8s resources without a namespace #77

Open orfeas-k opened 1 year ago

orfeas-k commented 1 year ago

Context

KubernetesComponent's function _get_missing_kubernetes_resources() returns desired resources that the Component expects to be present in the Kubernetes cluster but are not. However, it won't be able to verify namespaced K8s resources that are provided without a namespace and thus it will return the the resource is missing while it will have been applied successfully. E.g. if we provide a template with a Role (which is a namespaced resource) but without a namespace in its metadata, Kubernetes will append a (default?) namesapce to it when applying it. As a result, _get_missing_kubernetes_resources() will then not locate the resource applied.

Reproduce

Using a charm that follows Reconcile style (aka Base charm class):

Proposed Solution

We should either: