You've already forked sap-jenkins-library
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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user