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

Fix the bug of adding label #548

Merged
merged 1 commit into from
Feb 7, 2023
Merged

Fix the bug of adding label #548

merged 1 commit into from
Feb 7, 2023

Conversation

wenchajun
Copy link
Member

Signed-off-by: chengdehao dehaocheng@kubesphere.io

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Does this PR introduced a user-facing change?


Additional documentation, usage docs, etc.:


Signed-off-by: chengdehao <dehaocheng@kubesphere.io>
if fb.Spec.Labels != nil {
labels = fb.Spec.Labels
} else {
labels = fb.Labels
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why using fb.Labels if fb.spec.Labels is nil?
fb.spec.Labels should be the only place to set labels for the fluentbit daemonset and its pod as defined in
https://github.com/fluent/fluent-operator/blob/master/apis/fluentbit/v1alpha2/fluentbit_types.go#L71

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the label is not set in advance, an empty error is displayed. This error message is prompted empty selector is invalid for daemonset. This way, if the user does not configure the label parameters, the default parameters are used, and if they are used, the user-configured ones fb.spec.Labels are used.

@benjaminhuo benjaminhuo merged commit 3ac35e2 into fluent:master Feb 7, 2023
@wenchajun wenchajun deleted the label branch April 6, 2023 08:53
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.

None yet

2 participants