1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00

fix(helmExecute): explicitly set buildDescriptorFile if the chartPath is configured (#4063)

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
This commit is contained in:
Pavel Busko
2022-10-13 11:11:00 +02:00
committed by GitHub
parent 37a3504152
commit cf301a758f

View File

@@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"path"
"path/filepath"
"github.com/SAP/jenkins-library/pkg/kubernetes"
"github.com/SAP/jenkins-library/pkg/log"
@@ -44,11 +45,19 @@ func helmExecute(config helmExecuteOptions, telemetryData *telemetry.CustomData,
VersioningScheme: "library",
}
artifact, err := versioning.GetArtifact("helm", "", &artifactOpts, utils)
buildDescriptorFile := ""
if helmConfig.ChartPath != "" {
buildDescriptorFile = filepath.Join(helmConfig.ChartPath, "Chart.yaml")
}
artifact, err := versioning.GetArtifact("helm", buildDescriptorFile, &artifactOpts, utils)
if err != nil {
log.Entry().WithError(err).Fatalf("getting artifact information failed: %v", err)
}
artifactInfo, err := artifact.GetCoordinates()
if err != nil {
log.Entry().WithError(err).Fatalf("getting artifact coordinates failed: %v", err)
}
helmConfig.DeploymentName = artifactInfo.ArtifactID