Skip to content

Replacements should support an inline value as a source #5516

@grozan

Description

@grozan

Eschewed features

  • This issue is not requesting templating, unstuctured edits, build-time side-effects from args or env vars, or any other eschewed feature.

What would you like to have added?

As suggested in other issues, like here, it would be very nice to be able to specify a value directly, inline.
The target value is not always a field of another object. It can simply be a value that the user knows/wants.

Why is this needed?

There is the workaround of declaring a new object like a configmap and annotating it with config.kubernetes.io/local-config: "true" but this adds extra complexity and bloat to the definition of the desired state IMO

A simple replacement should look something like

replacements:
- source:
    value: bar
  targets:
  - select:
      name: hello
      kind: Job
    fieldPaths:
    - spec.template.spec.containers.[name=hello].env.[name=foo].value

without any kind of place holder object to define

Can you accomplish the motivating task without this feature, and if so, how?

yes, with a "fake" object as mentioned, but it's not an elegant solution at all

What other solutions have you considered?

json patches, but they don't support defining list items by their name ("/spec/template/spec/containers/[name=hello]/env/[name=foo].value" is NOT possible) as mentioned in other issues like #4950

Anything else we should know?

No response

Feature ownership

  • I am interested in contributing this feature myself! 🎉

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions