This message was deleted.
# general
s
This message was deleted.
m
Good find! Please do file a bug for this.
c
This is actually on purpose. The OpenAPI schema makes it tricky to determine when something is namespaced or not, so it’s difficult to know when we should append a generated namespace to the id.
Since the goal of
getResource
was to identify resources such that they’re unique to other resources in the YAML/Chart objects, we decided the “easiest” thing to do was to generate the id out of the data the user had given us.
g
but in Kubernetes if something is not namespaced, it is always "default"
c
Some objects don’t have namespaces, though.
Like v1/Namespace.
These objects, CRDs, etc. aren’t auto-namespaced to
"default"
, so I think
getResource
would have to (1) determine which resources are NOT namespaced, and (2) append
"default"
to the beginning of the ID if it exists.
lmk if you think this is wrong, but that’s why it is the way it is.
g
true - my thinking comes from this: I guess Charts work similarly to ConfigGroup. And when you apply a Chart, only the Chart developer knows if he/she added the "namespace" to metadata.
(what I try to do is that: I converted a Chart to manifests, with "helm template ...")
and with kubectl we would just look for the pod name, to use it if I deployed the chart to "default" namespace
c
I agree that it makes a better UX, I’m just not sure how to determine programmatically that a resource is namespaced.
g
add an internal flag, invisible to us, only used by the tool?
c
Hmm, I’m saying, I’m not sure how to tell the tool which resources to append
"default"
to. For example, v1/Namespace has no namespace, but this is not indicated by the schema as far as I know…. So I’m not sure how the tool can know not to add
"default"
in this case?
g
btw: I agree that this is nowhere critical, just tripped me up 🙂
c
No, no, I’m glad you brought it up.
bottom of the page, maybe this could be used?
I mean run:
kubectl api-resources --namespaced=false
and use the output to flag things that are not in a namespace
c
That implies the info should be in the api Resources entries of the OpenAPI spec, but I also think that’s not available until fairly recently.
hmm
I will investigate.
If it’s available back to 1.5 then we should just use this.
This == the data in the OpenAPI spec.
g
@creamy-potato-29402 would it be OK if I send a question in DM? Not sure if I found a problem, or just doing something wrong.
c
Of course