You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You would expect the name found to include the version, but its taking its information from a bit of the dataset that doesn't yet have versions (they haven't been calculated yet).
A solution could be something like this (in WorkloadCommon):
def update_env_for_versions(self, objects):
for object in objects.root:
rendered_name = object.root.metadata.name
containers = self.root.spec.template.spec.containers
for container in containers:
for env in container.env:
if "valueFrom" in env and "secretKeyRef" in env["valueFrom"]:
if env["valueFrom"].secretKeyRef.name == rendered_name.rsplit('-', 1)[0]:
env["valueFrom"].secretKeyRef.name = rendered_name
called after workload.add_volumes_for_objects(secrets)
I can't help but feel theres a neater solution, this could do unexpected things. It also only does secrets.
Applogies for the lack of PR, my generator is hacked about quite a bit in ways you wouldn't want and I'm pushed for time. I'll try and backport the other bits that are globally applicable and do a PR for this if no one can see a better solution.
The env["valueFrom"] pains me, but python insisted...
The text was updated successfully, but these errors were encountered:
If you do this with a versioned secret:
You would expect the name found to include the version, but its taking its information from a bit of the dataset that doesn't yet have versions (they haven't been calculated yet).
A solution could be something like this (in
WorkloadCommon
):called after
workload.add_volumes_for_objects(secrets)
I can't help but feel theres a neater solution, this could do unexpected things. It also only does secrets.
Applogies for the lack of PR, my generator is hacked about quite a bit in ways you wouldn't want and I'm pushed for time. I'll try and backport the other bits that are globally applicable and do a PR for this if no one can see a better solution.
The
env["valueFrom"]
pains me, but python insisted...The text was updated successfully, but these errors were encountered: