-
Notifications
You must be signed in to change notification settings - Fork 373
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
Fix controller issue in handling empty pod labels for labelidentity #5404
Conversation
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
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, please back-port this to the maintained releases.
416199d
to
e9edd06
Compare
// As defined in https://github.com/kubernetes/apimachinery/blob/3e2600dc79feea6cdc8a9224bc8a6a7fcfee1466/pkg/labels/labels.go#L90 | ||
emptyLabels = "<none>" |
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.
Should we call labels.Set(...).String()
instead of labels.FormatLabels(...)
to return a clearer format? I think the latter is only used when printing the labels in kubectl for human readaibility.
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.
Yeah I think we could do that. Updated
When a Pod is created without any labels at all, its labelidentity will include "pod:<none>" as defined by FormatLabels in apimachinery. This case is not handled correctly by the label group index and can cause the controller to crash. Signed-off-by: Dyanngg <dingyang@vmware.com>
e9edd06
to
c89b01f
Compare
/test-multicluster-e2e |
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
/test-multicluster-e2e |
2 similar comments
/test-multicluster-e2e |
/test-multicluster-e2e |
/skip-all |
@Dyanngg please backport it to applicable releases. |
…fter upgrade This is a follow-up on PR antrea-io#5404 which intends to address issue antrea-io#5403. In upgrade cases, Antrea controller will still receive LabelIdentity add events for LabelIdentities created by previous controller, which it needs to handle correctly. Also, the stale controller logic needs to be updated to ensure that LabelIdentities created with old normalization method are cleaned up after upgrade. Signed-off-by: Dyanngg <dingyang@vmware.com>
…fter upgrade (#5449) This is a follow-up on PR #5404 which intends to address issue #5403. In upgrade cases, Antrea controller will still receive LabelIdentity add events for LabelIdentities created by previous controller, which it needs to handle correctly. Also, the stale controller logic needs to be updated to ensure that LabelIdentities created with old normalization method are cleaned up after upgrade. Signed-off-by: Dyanngg <dingyang@vmware.com>
…fter upgrade This is a follow-up on PR antrea-io#5404 which intends to address issue antrea-io#5403. In upgrade cases, Antrea controller will still receive LabelIdentity add events for LabelIdentities created by previous controller, which it needs to handle correctly. Also, the stale controller logic needs to be updated to ensure that LabelIdentities created with old normalization method are cleaned up after upgrade. Signed-off-by: Dyanngg <dingyang@vmware.com>
…fter upgrade (#5452) This is a follow-up on PR #5404 which intends to address issue #5403. In upgrade cases, Antrea controller will still receive LabelIdentity add events for LabelIdentities created by previous controller, which it needs to handle correctly. Also, the stale controller logic needs to be updated to ensure that LabelIdentities created with old normalization method are cleaned up after upgrade. Signed-off-by: Dyanngg <dingyang@vmware.com>
…fter upgrade This is a follow-up on PR antrea-io#5404 which intends to address issue antrea-io#5403. In upgrade cases, Antrea controller will still receive LabelIdentity add events for LabelIdentities created by previous controller, which it needs to handle correctly. Also, the stale controller logic needs to be updated to ensure that LabelIdentities created with old normalization method are cleaned up after upgrade. Signed-off-by: Dyanngg <dingyang@vmware.com>
…fter upgrade This is a follow-up on PR antrea-io#5404 which intends to address issue antrea-io#5403. In upgrade cases, Antrea controller will still receive LabelIdentity add events for LabelIdentities created by previous controller, which it needs to handle correctly. Also, the stale controller logic needs to be updated to ensure that LabelIdentities created with old normalization method are cleaned up after upgrade. Signed-off-by: Dyanngg <dingyang@vmware.com>
…fter upgrade (#5458) This is a follow-up on PR #5404 which intends to address issue #5403. In upgrade cases, Antrea controller will still receive LabelIdentity add events for LabelIdentities created by previous controller, which it needs to handle correctly. Also, the stale controller logic needs to be updated to ensure that LabelIdentities created with old normalization method are cleaned up after upgrade. Signed-off-by: Dyanngg <dingyang@vmware.com>
…fter upgrade (#5459) This is a follow-up on PR #5404 which intends to address issue #5403. In upgrade cases, Antrea controller will still receive LabelIdentity add events for LabelIdentities created by previous controller, which it needs to handle correctly. Also, the stale controller logic needs to be updated to ensure that LabelIdentities created with old normalization method are cleaned up after upgrade. Signed-off-by: Dyanngg <dingyang@vmware.com>
Fixes #5403
When a Pod is created without any labels at all, its labelidentity will include
pod:<none>
as defined by FormatLabels in apimachinery. This case is not handled correctly by the label group index and can cause the controller to crash.