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

Remove resource kind from resource names #329

Closed
wants to merge 18 commits into from

Conversation

lindhe
Copy link
Contributor

@lindhe lindhe commented Nov 11, 2023

The Kubernetes objects created by this Helm chart were littered with the "-pod" suffix for resource names and labels. Notably, this was the case for non-pod resources. This change removes that suffix.

I also noticed that the secrets had a -secrets suffix, and services had sometimes -svc and sometimes -service infixes which are also removed with in change. It is always clear from the manifest what resource kind one is working with; so I see no need to over-specify this into the .metadata.name field as well.

Fixes #327

@lindhe
Copy link
Contributor Author

lindhe commented Nov 11, 2023

What's the chart version bump policy? Should I bump the chart version, or is that done automatically and/or in a later stage or the release process? Do you consider this a breaking change?

@lindhe lindhe changed the title Remove "-pod" suffix Remove misleading suffixes in resource names Nov 11, 2023
@lindhe
Copy link
Contributor Author

lindhe commented Nov 11, 2023

I saw that the secrets had a -secrets suffix, and services had sometimes -svc and sometimes -service infixes which I've also removed now. Again: there's no need to specify the resource kind in the name.

@lindhe lindhe changed the title Remove misleading suffixes in resource names Remove resource kind suffixes/infixes in resource names Nov 11, 2023
@lindhe lindhe changed the title Remove resource kind suffixes/infixes in resource names Remove resource kind from resource names Nov 11, 2023
@lindhe
Copy link
Contributor Author

lindhe commented Nov 11, 2023

Do not merge this yet, the tests aren't yet working when removing the -secret suffix.

@lindhe
Copy link
Contributor Author

lindhe commented Nov 11, 2023

I cannot remove the -secret suffix from neuvector-controller-secret without the tests breaking. Might be something wrong with the tests. If someone could help me figure this out, it would be swell.

What I'm doing:

sed -i 's/neuvector-controller-secret/neuvector-controller/g' charts/core/templates/controller* test/deployment_test.go
cd test
go test

@becitsthere
Copy link
Contributor

We will bump up the version when release.

However, we will not accept this patch. Having the resource kind in the name might not be necessary, it also doesn't hurt to have it. Extensive change like this will likely break the upgrade case.

@lindhe
Copy link
Contributor Author

lindhe commented Nov 14, 2023

Having the resource kind in the name might not be necessary, it also doesn't hurt to have it.

Quite alright. But can we please be consistent with it then? Let's add the resource kind to all names. And maybe we can remove the "pod" suffix from the non-pod resources. This too "does not hurt", but surely it's not a good thing to have a name that indicates the wrong kind...

Extensive change like this will likely break the upgrade case.

I'm happy to break this change into smaller parts, if you think that would be better.

@lindhe
Copy link
Contributor Author

lindhe commented Nov 20, 2023

@becitsthere What do you say? How do we best make the naming more consistent?

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.

Incorrect and inconsistent resource names
2 participants