-
Notifications
You must be signed in to change notification settings - Fork 145
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(support-bundle): agent doesn't respect node-selector and taint-toleration #1798
fix(support-bundle): agent doesn't respect node-selector and taint-toleration #1798
Conversation
32994ae
to
5251c1b
Compare
@c3y1huang rancher/support-bundle-kit#68 merged. Please create a new image and update this PR. |
5251c1b
to
6839096
Compare
Local test results:
|
ea2744d
to
247b621
Compare
This should be merged with longhorn/longhorn-tests#1286. |
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. Just a few comments needed to resolve.
P.S. for common utils, epseically they could be shared with other modules, we can add to https://github.com/longhorn/go-common-lib.
a0f838c
to
a4cb6f0
Compare
@@ -615,6 +616,12 @@ func (c *SupportBundleController) createSupportBundleManagerDeployment(supportBu | |||
func (c *SupportBundleController) newSupportBundleManager(supportBundle *longhorn.SupportBundle, | |||
nodeSelector map[string]string, tolerations []corev1.Toleration, | |||
imagePullPolicy corev1.PullPolicy, priorityClass, registrySecret string) *appsv1.Deployment { | |||
|
|||
tolerationSetting, err := c.ds.GetSetting(types.SettingNameTaintToleration) |
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.
I mean you can use tolerations []corev1.Toleration
instead of querying the setting again.
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.
Got it, I was confused because toleration []corev1.Toleration
is unmarshalled from the setting, directly using it needs to be put back to a string again.
I've moved the unmarshalling into the same method so it won't be called again. PTAL, thank you.
a4cb6f0
to
4dc693e
Compare
Ref: 5614 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
Ref: 5614 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
4dc693e
to
7c9ce22
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. It's good that you added unit tests.
cc @longhorn/dev unit tests matter.
fmt.Printf("testing %v\n", name) | ||
|
||
toleration, err := UnmarshalTolerations(test.input) | ||
if !reflect.DeepEqual(toleration, test.expectedToleration) { |
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.
nit: There should be some assert functions able to use?
t.Errorf("unexpected toleration:\nGot: %v\nWant: %v", toleration, test.expectedToleration) | ||
} | ||
|
||
if test.expectError && err == nil { |
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.
nit: The same. Suggest using assert like https://pkg.go.dev/github.com/stretchr/testify/assert.
@Mergifyio backport v1.4.x |
✅ Backports have been created
|
longhorn/longhorn#5614