Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

metadata.namespace not injected for manual resources #4

Open
ankon opened this issue Oct 10, 2017 · 1 comment
Open

metadata.namespace not injected for manual resources #4

ankon opened this issue Oct 10, 2017 · 1 comment

Comments

@ankon
Copy link
Contributor

ankon commented Oct 10, 2017

Assuming a resource manifest has:

apiVersion: batch/v1
kind: Job
metadata:
  name: manual-job
  annotations:
    bootstrap.k8s.collaborne.com/manual: "true"
...

kubernetes-bootstrap should adjust the manifest in the output to have metadata.namesapce set, regardless of whether the resource is intended for manual execution. This would avoid issues where the operator misses to provide the --namespace argument to kubectl apply when actually applying the resource.

@ankon
Copy link
Contributor Author

ankon commented Feb 14, 2019

The problem here is that without a connection to a Kubernetes server we cannot determine whether a particular resource requires a namespace or not.

The check for that is here:

if (k8sResource.namespaced) {
resource.metadata.namespace = properties.environment;
}

ankon added a commit that referenced this issue Feb 14, 2019
This should make it more obvious that this really is what should be used.

Related-to: #4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant