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

Replace usage of kustomize edit add resource in the notebooks with an alternative #111

Closed
HumairAK opened this issue Oct 28, 2021 · 9 comments
Assignees
Labels
good first issue Good for newcomers kind/documentation Categorizes issue or PR as related to documentation. kind/experience Indicates an issue/PR is related to human interaction and experience. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@HumairAK
Copy link
Member

kustomize cli will reformat the file and also append changes to at the bottom, this makes kustomization.yaml files like the ones here really hard to read (we alphabetically sort these for human readability).

One instance where this has already caused some issues can be found here: operate-first/apps#1236

@HumairAK HumairAK added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. kind/experience Indicates an issue/PR is related to human interaction and experience. good first issue Good for newcomers kind/documentation Categorizes issue or PR as related to documentation. labels Oct 28, 2021
@HumairAK
Copy link
Member Author

Also should update the markdowns that these instructions are taken from.

@durandom
Copy link
Member

I suggest to not use the opfcli for that at all.
Can't we use python to manipulate the yaml files?
Or cat <<HERE documents.
So that it's not hidden from the reader what is actually added to those files.

@tumido @fridex what's a good YAML manipulation package in python?

@fridex
Copy link

fridex commented Oct 29, 2021

I suggest to not use the opfcli for that at all. Can't we use python to manipulate the yaml files? Or cat <<HERE documents. So that it's not hidden from the reader what is actually added to those files.

@tumido @fridex what's a good YAML manipulation package in python?

PyYAML is a library to manipulate content in YAML files in Python. It does its job on the content level, not on the formatting level (if that is relevant here).

@tumido
Copy link
Member

tumido commented Nov 9, 2021

This is a never ending story and ongoing issue across all history of Operate First. I don't think this is a valid issue.

Yes, kustomize doesn't care about alphabetical order, instead it raises error on duplicate resources and supports a remove command. I think we should scrape this alphabetical order idea and rather embrace the component collections proposed by @larsks at https://github.com/operate-first/SRE/issues/369 We can either work hard on tooling and workarounds and scripts to support manual processing of automatically genereated resources or rather focus on going fully automated. I think alphabetical sorting is not important to the machines so we should rather embrace it and work towards more automated solution with less moving parts.

If a standardized tool formats a resource, there's a high chance that the output format is deterministic and if we apply the same tool on the resource again, it results in 0 diff. So if a tool prefers a formatting and we as maintainers can accept that formatting, we should start using it and favor it instead of battling the tools every time on every PR.

Yes, YAML is a whitespaced markup language, but in different flavors/versions/standards it uses different amount of spaces to indent nested properties. Actually even different versions of kustomize as well as kubectl and oc will use either 2 or 4 spaces to indent - all rely on go-yaml library and this is a loong story on its own. There's nothing we should be doing in this case - because patching an already patched tool for a hacked solution is not good pattern. kubernetes-sigs/kustomize#3946 Either go fix it upstream or live with it.

We have a nice saying in Czech for this, not sure about the equivalent in English - "vyrábět narovnávák na ohejbák" - to create a "straightening tool" for a "bender tool" meaning that at first you work hard to bend something and then work even harder to straighten it again... This issue seems like it's suggesting such approach. I think we should invest our energy elsewhere.

@tumido
Copy link
Member

tumido commented Nov 9, 2021

I suggest to not use the opfcli for that at all.

👍 to that... less custom tooling is always better.

@sesheta
Copy link
Member

sesheta commented Feb 7, 2022

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@sesheta sesheta added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 7, 2022
@sesheta
Copy link
Member

sesheta commented Mar 9, 2022

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

@sesheta sesheta added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 9, 2022
@sesheta
Copy link
Member

sesheta commented Apr 8, 2022

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

@sesheta sesheta closed this as completed Apr 8, 2022
@sesheta
Copy link
Member

sesheta commented Apr 8, 2022

@sesheta: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/documentation Categorizes issue or PR as related to documentation. kind/experience Indicates an issue/PR is related to human interaction and experience. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

6 participants