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

Extend hidden_fields to allow more complicated field definitions #643

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

willthames
Copy link
Collaborator

SUMMARY

This allows us to ignore e.g. the last-applied-configuration annotation by specifying
metadata.annotations[kubectl.kubernetes.io/last-applied-configuration]

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

hidden_fields

@willthames
Copy link
Collaborator Author

Note that I haven't added a changelog fragment as we haven't done a release since the PR introducing this feature and the previous fragment is still valid for this change:

minor_changes:
  - k8s, k8s_info - add a hidden_fields option to allow fields to be hidden in the results of k8s and k8s_info

@softwarefactory-project-zuul
Copy link

@willthames willthames force-pushed the hide-fields branch 2 times, most recently from 0a9b5c7 to 57092c9 Compare September 4, 2023 07:09
This allows us to ignore e.g. the last-applied-configuration
annotation by specifying
`metadata.annotations[kubectl.kubernetes.io/last-applied-configuration]`
@willthames
Copy link
Collaborator Author

Note that it's currently impossible to meet both black and pep8 with regard to list slices

black wants list[left : right]

pep8 wants list[left:right]

More things seem to complain about pep8.

@softwarefactory-project-zuul
Copy link

@willthames
Copy link
Collaborator Author

I don't really understand why all the integration tests are failing, it doesn't seem that it's related to this PR (but happy to fix if I'm wrong about that)

@willthames
Copy link
Collaborator Author

The failing sanity tests on milestone and devel also seem unrelated to this PR (suspect a breaking change in devel ansible which probably needs separate investigation - has the yamllint sanity check changed?)

Needed to cope with multiple levels of bracketed keys

e.g. spec.template.spec[securityContext][runAsUser]

and implementing that lead to a much simpler version
that finds the first key and the rest, and deals with
just those two.

Added more tests to cover some of the new supported
cases.
@softwarefactory-project-zuul
Copy link

@softwarefactory-project-zuul
Copy link

Ensure test correctly captures that hidden fields should be hidden
in diffs too
@softwarefactory-project-zuul
Copy link

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

Successfully merging this pull request may close these issues.

1 participant