Skip to content

Commit 24d75a1

Browse files
Addressing Helm tests failure (#3265)
* Addressing Helm tests failure * Updating artifactory version in go.mod and go.sum
1 parent 1dd72be commit 24d75a1

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

buildtools/cli.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ func GetCommands() []cli.Command {
350350
UsageText: helmcommand.GetArguments(),
351351
ArgsUsage: common.CreateEnvVars(),
352352
SkipFlagParsing: true,
353-
HideHelp: true,
353+
Hidden: true,
354354
BashComplete: corecommon.CreateBashCompletionFunc(),
355355
Category: buildToolsCategory,
356356
Action: HelmCmd,
@@ -1437,6 +1437,9 @@ func extractHelmServerDetails(args []string) ([]string, *coreConfig.ServerDetail
14371437
if err != nil {
14381438
return cleanedArgs, nil, err
14391439
}
1440+
if serverDetails == nil {
1441+
return cleanedArgs, nil, fmt.Errorf("no default server configuration found. Please configure a server using 'jfrog config add' or specify a server using --server-id")
1442+
}
14401443
return cleanedArgs, serverDetails, nil
14411444
}
14421445

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/jfrog/build-info-go v1.12.5-0.20251209171349-eb030db986f9
2020
github.com/jfrog/gofrog v1.7.6
2121
github.com/jfrog/jfrog-cli-application v1.0.2-0.20251208114900-b3cc968c8e3d
22-
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251210120128-176c677fed4c
22+
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251211071646-7cebb31a31f0
2323
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251210085744-f8481d179ac5
2424
github.com/jfrog/jfrog-cli-evidence v0.8.3-0.20251204144808-73fa744851c0
2525
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20251205121610-171eb9b0000e
@@ -282,7 +282,7 @@ replace github.com/docker/docker => github.com/docker/docker v27.5.1+incompatibl
282282

283283
replace github.com/gfleury/go-bitbucket-v1 => github.com/gfleury/go-bitbucket-v1 v0.0.0-20230825095122-9bc1711434ab
284284

285-
//replace github.com/jfrog/jfrog-cli-artifactory => github.com/naveenku-jfrog/jfrog-cli-artifactory v0.0.0-20251129184826-6834d2c05c2e
285+
//replace github.com/jfrog/jfrog-cli-artifactory => github.com/naveenku-jfrog/jfrog-cli-artifactory v0.0.0-20251210184507-0c8d138690cb
286286

287287
//replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20251006061821-8b1be6a65215
288288

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,8 +1216,8 @@ github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYL
12161216
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
12171217
github.com/jfrog/jfrog-cli-application v1.0.2-0.20251208114900-b3cc968c8e3d h1:0o6tj4nPP9uCscyfPbKBUcCaIYof42irwii6XsBB8zM=
12181218
github.com/jfrog/jfrog-cli-application v1.0.2-0.20251208114900-b3cc968c8e3d/go.mod h1:xum2HquWO5uExa/A7MQs3TgJJVEeoqTR+6Z4mfBr1Xw=
1219-
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251210120128-176c677fed4c h1:uMs18TfF/472CsaoI3HAsvyo9B8ChFh855BdicqoT4c=
1220-
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251210120128-176c677fed4c/go.mod h1:7cCaRhXorlbyXZgiW5bplCExFxlnROaG21K12d8inpQ=
1219+
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251211071646-7cebb31a31f0 h1:NbMgMcU2I+zdBWbwZagbKwmsmY96ikNatpwMs0M1Kv8=
1220+
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20251211071646-7cebb31a31f0/go.mod h1:7cCaRhXorlbyXZgiW5bplCExFxlnROaG21K12d8inpQ=
12211221
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251210085744-f8481d179ac5 h1:GYE67ubwl+ZRw3CcXFUi49EwwQp6k+qS8sX0QuHDHO8=
12221222
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20251210085744-f8481d179ac5/go.mod h1:BMoGi2rG0udCCeaghqlNgiW3fTmT+TNnfTnBoWFYgcg=
12231223
github.com/jfrog/jfrog-cli-evidence v0.8.3-0.20251204144808-73fa744851c0 h1:8S1vE1PeVtrzWkKL0N39cX6XLLNV0It+f6xjRKjw7Ug=

helm_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"time"
1717

1818
buildinfo "github.com/jfrog/build-info-go/entities"
19+
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
1920
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
2021
coreTests "github.com/jfrog/jfrog-cli-core/v2/utils/tests"
2122
"github.com/jfrog/jfrog-cli/utils/tests"
@@ -41,6 +42,23 @@ func initHelmTest(t *testing.T) {
4142
if artifactoryCli == nil {
4243
initArtifactoryCli()
4344
}
45+
46+
// Set up home directory configuration so GetDefaultServerConf() can find the server
47+
createJfrogHomeConfig(t, true)
48+
49+
// Initialize serverDetails for Helm tests (similar to maven_test.go)
50+
serverDetails = &config.ServerDetails{
51+
Url: *tests.JfrogUrl,
52+
ArtifactoryUrl: *tests.JfrogUrl + tests.ArtifactoryEndpoint,
53+
SshKeyPath: *tests.JfrogSshKeyPath,
54+
SshPassphrase: *tests.JfrogSshPassphrase,
55+
}
56+
if *tests.JfrogAccessToken != "" {
57+
serverDetails.AccessToken = *tests.JfrogAccessToken
58+
} else {
59+
serverDetails.User = *tests.JfrogUser
60+
serverDetails.Password = *tests.JfrogPassword
61+
}
4462
}
4563

4664
func isArtifactoryAccessible(t *testing.T) bool {
@@ -368,6 +386,13 @@ spec:
368386
err = os.WriteFile(filepath.Join(templatesDir, "deployment.yaml"), []byte(deploymentYaml), 0644)
369387
require.NoError(t, err)
370388

389+
// Create an empty Chart.lock file for charts without dependencies
390+
// This is required because Helm FlexPack tries to read Chart.lock even when it doesn't exist
391+
chartLockYaml := `dependencies: []
392+
`
393+
err = os.WriteFile(filepath.Join(chartDir, "Chart.lock"), []byte(chartLockYaml), 0644)
394+
require.NoError(t, err)
395+
371396
return chartDir
372397
}
373398

0 commit comments

Comments
 (0)