Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect immutable field changes #730

Open
okozachenko1203 opened this issue Jan 23, 2025 · 1 comment
Open

Detect immutable field changes #730

okozachenko1203 opened this issue Jan 23, 2025 · 1 comment

Comments

@okozachenko1203
Copy link

Is it possible to add the information in the change list if the change is for immutable fields of the resource type.

I was able to get the change path in dyff output format.

spec.selector.matchLabels.component  (Deployment/default/memcached-memcached)
  ± value change
    - server
    + server-new

I can see the default helm diff template in the code base.

package diff
const defaultTemplateReport = `[
{{- $global := . -}}
{{- range $idx, $entry := . -}}
{
"api": "{{ $entry.API }}",
"kind": "{{ $entry.Kind }}",
"namespace": "{{ $entry.Namespace }}",
"name": "{{ $entry.Name }}",
"change": "{{ $entry.Change }}"
}{{ if not (last $idx $global) }},{{ end }}
{{- end }}]`

It would be good if we can render the change path (for instance, spec.selector.matchLabels.component) in the tpl.

@yxxhero
Copy link
Collaborator

yxxhero commented Jan 24, 2025

@okozachenko1203 PR is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants