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
BUG 2082099: Fix finalizer string too long #1178
Conversation
Hi @Vincent056. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test Thank you for the fix @Vincent056! |
if !ok { | ||
return nil, errors.New("cannot determine node name") | ||
} | ||
// Make sure the length of finalizer is not longer than 63 characters | ||
if len(nodeName) > 55 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make it a const
to fix the CI.
An e2e test would also be nice. |
3f27522
to
924e0ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some nits
@@ -33,6 +33,11 @@ import ( | |||
"sigs.k8s.io/security-profiles-operator/internal/pkg/util" | |||
) | |||
|
|||
const ( | |||
// node name length limit | |||
nodeNameLenLimit = 55 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a complete nit, but can you change a comment to include that the finalizer can be up to 63 chars in lenght and 55 + len("-deleted") = 63? We might also want to use a constant instead of -deleted
so that both are next to each other.
"sigs.k8s.io/security-profiles-operator/internal/pkg/config" | ||
) | ||
|
||
// Expected shorten the node name if length exceed the limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, validation error
So far I've had the best results with fixing the gci issues by running gci manually, something like:
There is also the
Don't forget to remove and reinstall golangci-lint if you have an old version locally. |
766162f
to
0810659
Compare
@jhrozek It seems like |
Can you try adding |
390f407
to
8c491ab
Compare
Shorten finalizer string if it is over the limit
8c491ab
to
3c097d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
I restarted the flatcar test, the failure looks like a install-time fluke
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhrozek, Vincent056 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind bug
What this PR does / why we need it:
This PR shorten the finalizer string if it is over the limit size of 63
Does this PR have test?
Yes
Does this PR introduce a user-facing change?
No
####Which issue(s) this PR fixes:
Fixes: BZ 2082099