Skip to content

Commit

Permalink
fix(support-bundle): pass taint-toleration to agent
Browse files Browse the repository at this point in the history
Ref: 5614

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
  • Loading branch information
c3y1huang committed Mar 23, 2023
1 parent 31db98f commit 513525b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions controller/support_bundle_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ func (c *SupportBundleController) newSupportBundleManager(supportBundle *longhor
Name: "SUPPORT_BUNDLE_NODE_SELECTOR",
Value: c.getNodeSelectorString(nodeSelector),
},
{
Name: "SUPPORT_BUNDLE_TAINT_TOLERATION",
Value: c.getTaintTolerationString(),
},
},
Ports: []corev1.ContainerPort{
{
Expand Down Expand Up @@ -724,3 +728,12 @@ func (c *SupportBundleController) getNodeSelectorString(nodeSelector map[string]
}
return strings.Join(list, ",")
}

func (c *SupportBundleController) getTaintTolerationString() string {
setting, err := c.ds.GetSetting(types.SettingNameTaintToleration)
if err != nil {
c.logger.WithError(err).Warnf("Failed to get %v setting for SupportBundle", types.SettingNameTaintToleration)
return ""
}
return strings.ReplaceAll(setting.Value, ";", ",")
}

0 comments on commit 513525b

Please sign in to comment.