You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-07-05 00:59:01 +02:00
fix(helm): Remove double deployment of helm charts (#1947)
* Remove double deployment of helm charts * Adapt unit test Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
This commit is contained in:
@ -166,7 +166,6 @@ func runHelmDeploy(config kubernetesDeployOptions, command command.ExecRunner, s
|
|||||||
command.Stdout(stdout)
|
command.Stdout(stdout)
|
||||||
log.Entry().Info("Calling helm upgrade ...")
|
log.Entry().Info("Calling helm upgrade ...")
|
||||||
log.Entry().Debugf("Helm parameters %v", upgradeParams)
|
log.Entry().Debugf("Helm parameters %v", upgradeParams)
|
||||||
command.RunExecutable("helm", upgradeParams...)
|
|
||||||
if err := command.RunExecutable("helm", upgradeParams...); err != nil {
|
if err := command.RunExecutable("helm", upgradeParams...); err != nil {
|
||||||
log.Entry().WithError(err).Fatal("Helm upgrade call failed")
|
log.Entry().WithError(err).Fatal("Helm upgrade call failed")
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,8 @@ func TestRunKubernetesDeploy(t *testing.T) {
|
|||||||
|
|
||||||
runKubernetesDeploy(opts, &e, &stdout)
|
runKubernetesDeploy(opts, &e, &stdout)
|
||||||
|
|
||||||
assert.Equal(t, "helm", e.Calls[1].Exec, "Wrong upgrade command")
|
assert.Equal(t, 1, len(e.Calls), "Wrong number of upgrade commands")
|
||||||
|
assert.Equal(t, "helm", e.Calls[0].Exec, "Wrong upgrade command")
|
||||||
assert.Equal(t, []string{
|
assert.Equal(t, []string{
|
||||||
"upgrade",
|
"upgrade",
|
||||||
"deploymentName",
|
"deploymentName",
|
||||||
@ -166,7 +167,7 @@ func TestRunKubernetesDeploy(t *testing.T) {
|
|||||||
"testCluster",
|
"testCluster",
|
||||||
"--testParam",
|
"--testParam",
|
||||||
"testValue",
|
"testValue",
|
||||||
}, e.Calls[1].Params, "Wrong upgrade parameters")
|
}, e.Calls[0].Params, "Wrong upgrade parameters")
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("test kubectl - create secret/kubeconfig", func(t *testing.T) {
|
t.Run("test kubectl - create secret/kubeconfig", func(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user