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

Add support for helm extraFlags when installing Rancher #67

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions rancher/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ func appendRCAlphaFlags(flags []string, version string, channel string) []string
* @param hostname Hostname/URL to use for the deployment
* @param channel Rancher channel to use (stable, latest, prime, prime-optimus, alpha, prime-optimus-alpha)
* @param version Rancher version to install (latest, devel)
* @param headVersion Rancher head version to install (2.7, 2.8, 2.9)
* @param headVersion Rancher head version to install (2.7, 2.8, 2.9, 2.10, head)
* @param ca CA to use (selfsigned, private)
* @param proxy Define if a a proxy should be configured/used
* @param extraFlags Optional helm flags for installing Rancher (start from extraEnv[2])
* @returns Nothing or an error
*/
// NOTE: AddNode does not have unit test as it is not easy to mock
func DeployRancherManager(hostname, channel, version, headVersion, ca, proxy string) error {
func DeployRancherManager(hostname, channel, version, headVersion, ca, proxy string, extraFlags ...[]string) error {
var password = "rancherpassword"
if envPW := os.Getenv("RANCHER_PASSWORD"); envPW != "" {
password = envPW
Expand Down Expand Up @@ -167,5 +168,10 @@ func DeployRancherManager(hostname, channel, version, headVersion, ca, proxy str
)
}

// Append extra flags if any
for _, extra := range extraFlags {
flags = append(flags, extra...)
}

return kubectl.RunHelmBinaryWithCustomErr(flags...)
}
Loading