Skip to content

Commit 3b5fe93

Browse files
shivagowdaHarness
authored andcommitted
feat: [AH-2806]: fix vulnerabilities (#171)
* 58defe feat: [AH-2806]: fix vulnerabilities
1 parent d67a47e commit 3b5fe93

File tree

20 files changed

+70
-63
lines changed

20 files changed

+70
-63
lines changed

cmd/artifact/command/copy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/harness/harness-cli/config"
1111
v2client "github.com/harness/harness-cli/internal/api/ar_v2"
1212
p "github.com/harness/harness-cli/util/common/progress"
13+
1314
"github.com/spf13/cobra"
1415
)
1516

cmd/artifact/command/push_maven.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/harness/harness-cli/util/common/auth"
2424
"github.com/harness/harness-cli/util/common/errors"
2525
p "github.com/harness/harness-cli/util/common/progress"
26+
2627
"github.com/spf13/cobra"
2728
)
2829

cmd/artifact/command/push_python.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/harness/harness-cli/util/common/auth"
2323
"github.com/harness/harness-cli/util/common/errors"
2424
p "github.com/harness/harness-cli/util/common/progress"
25+
2526
"github.com/spf13/cobra"
2627
)
2728

@@ -99,7 +100,7 @@ func NewPushPythonCmd(c *cmdutils.Factory) *cobra.Command {
99100

100101
},
101102
}
102-
103+
103104
cmd.Flags().StringVar(&pkgURL, "pkg-url", "", "Base URL for the Packages")
104105
cmd.MarkFlagRequired("pkg-url")
105106
return cmd

cmd/hc/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import (
1010
"runtime/pprof"
1111
"time"
1212

13-
"github.com/harness/harness-cli/cmd/iacm"
1413
"github.com/harness/harness-cli/cmd/artifact"
1514
"github.com/harness/harness-cli/cmd/auth"
1615
"github.com/harness/harness-cli/cmd/cmdutils"
16+
"github.com/harness/harness-cli/cmd/iacm"
1717
"github.com/harness/harness-cli/cmd/registry"
1818
"github.com/harness/harness-cli/config"
1919
"github.com/harness/harness-cli/util/templates"

cmd/iacm/command/plan.go

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/harness/harness-cli/config"
1717
"github.com/harness/harness-cli/util/client/iacm"
1818
"github.com/harness/harness-cli/util/common/progress"
19+
1920
"github.com/hashicorp/go-slug"
2021
"github.com/spf13/cobra"
2122
"gopkg.in/yaml.v3"
@@ -78,10 +79,10 @@ func getWorkspaceInfo(org, project, workspace, workingDirectory string) (*Worksp
7879

7980
func NewPlanCmd() *cobra.Command {
8081
var (
81-
workspaceID string
82-
orgID string
83-
projectID string
84-
targets []string
82+
workspaceID string
83+
orgID string
84+
projectID string
85+
targets []string
8586
replacements []string
8687
)
8788

@@ -126,7 +127,7 @@ streaming logs back to your terminal.`,
126127

127128
iacmClient := iacm.NewIacmClient(verbose)
128129
logClient := iacm.NewLogClient()
129-
130+
130131
p := progress.NewConsoleReporter()
131132

132133
return executePlan(cmd.Context(), iacmClient, logClient, p, orgID, projectID, workspaceID, targets, replacements)
@@ -284,7 +285,7 @@ func getRepoRootFromWorkingDirectory(workingDirectory string, workspace *iacm.Wo
284285

285286
workingDirectory = filepath.Clean(workingDirectory)
286287
repositoryPath := filepath.Clean(workspace.RepositoryPath)
287-
288+
288289
if strings.HasSuffix(workingDirectory, repositoryPath) {
289290
repoRoot := strings.TrimSuffix(workingDirectory, workspace.RepositoryPath)
290291
repoRoot = filepath.Clean(repoRoot)
@@ -332,7 +333,7 @@ func getStartingNodeID(ctx context.Context, iacmClient pipelineExecutionGetter,
332333
ticker := time.NewTicker(500 * time.Millisecond)
333334
defer ticker.Stop()
334335
timer := time.After(5 * time.Second)
335-
336+
336337
for {
337338
select {
338339
case <-ctx.Done():
@@ -372,7 +373,7 @@ func walkExecutionGraph(ctx context.Context, iacmClient *iacm.IacmClient, logCli
372373
defer ticker.Stop()
373374
stageNodeID := startingNodeID
374375
visited := map[string]struct{}{}
375-
376+
376377
for {
377378
select {
378379
case <-ctx.Done():
@@ -385,21 +386,21 @@ func walkExecutionGraph(ctx context.Context, iacmClient *iacm.IacmClient, logCli
385386
if execution.PipelineExecutionSummary == nil || execution.ExecutionGraph == nil {
386387
continue
387388
}
388-
389+
389390
stageNode := getNextActiveStage(ctx, execution.PipelineExecutionSummary.LayoutNodeMap, stageNodeID)
390391
if stageNode.NodeUuid == "" {
391392
return nil
392393
}
393-
394+
394395
_, ok := visited[stageNode.NodeUuid]
395396
if ok {
396397
continue
397398
}
398-
399+
399400
visited[stageNode.NodeUuid] = struct{}{}
400401
stageNodeID = stageNode.NodeUuid
401402
fmt.Printf(startingStageMsg, stageNode.Name)
402-
403+
403404
err = walkStage(ctx, iacmClient, logClient, org, project, executionID, stageNodeID, execution.ExecutionGraph.RootNodeId)
404405
if err != nil {
405406
return err
@@ -422,7 +423,7 @@ func walkStage(ctx context.Context, iacmClient *iacm.IacmClient, logClient *iacm
422423
defer ticker.Stop()
423424
lastStepNodeID := rootNodeID
424425
visited := map[string]struct{}{}
425-
426+
426427
for {
427428
select {
428429
case <-ctx.Done():
@@ -435,14 +436,14 @@ func walkStage(ctx context.Context, iacmClient *iacm.IacmClient, logClient *iacm
435436
if execution.PipelineExecutionSummary == nil || execution.ExecutionGraph == nil {
436437
continue
437438
}
438-
439+
439440
if lastStepNodeID == "" {
440441
lastStepNodeID = rootNodeID
441442
}
442-
443+
443444
stageNode := execution.PipelineExecutionSummary.LayoutNodeMap[stageNodeID]
444445
var stepNode iacm.ExecutionNode
445-
446+
446447
switch {
447448
case isActiveStageNode(stageNode.Status):
448449
stepNode = getNextActiveStep(*execution.ExecutionGraph, lastStepNodeID)
@@ -555,10 +556,10 @@ func isInactiveStageNode(status string) bool {
555556
}
556557

557558
func shouldIgnoreStepType(stepType string) bool {
558-
return stepType == "IACMIntegrationStageStepPMS" ||
559-
stepType == "IntegrationStageStepPMS" ||
560-
stepType == "NG_EXECUTION" ||
561-
stepType == "IACMPrepareExecution"
559+
return stepType == "IACMIntegrationStageStepPMS" ||
560+
stepType == "IntegrationStageStepPMS" ||
561+
stepType == "NG_EXECUTION" ||
562+
stepType == "IACMPrepareExecution"
562563
}
563564

564565
func getLogKeyFromStepNode(stepNode iacm.ExecutionNode) string {

cmd/iacm/command/plan_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"time"
1111

1212
"github.com/harness/harness-cli/util/client/iacm"
13+
1314
"github.com/stretchr/testify/assert"
1415
"gopkg.in/yaml.v3"
1516
)
@@ -163,7 +164,7 @@ func TestGetNextActiveStage(t *testing.T) {
163164
func TestGetNextActiveStep(t *testing.T) {
164165
tt := map[string]struct {
165166
expectedActiveStage string
166-
startingNodeID string
167+
startingNodeID string
167168
layoutNodeMap map[string]iacm.GraphLayoutNode
168169
}{
169170
"finds the next active stage": {
@@ -222,7 +223,6 @@ func TestGetNextActiveStep(t *testing.T) {
222223
}
223224
}
224225

225-
226226
func TestGetStartingNodeID(t *testing.T) {
227227
t.Run("successfully retrieve starting node", func(t *testing.T) {
228228
expectedStartingNodeID := "StartingNodeId"

cmd/iacm/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ executing on Harness servers while streaming logs back to your CLI.`,
1919
rootCmd.AddCommand(command.NewPlanCmd())
2020

2121
return rootCmd
22-
}
22+
}

cmd/registry/command/fw_explain.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import (
88
"strings"
99
"time"
1010

11-
"github.com/google/uuid"
1211
"github.com/harness/harness-cli/cmd/cmdutils"
1312
"github.com/harness/harness-cli/config"
1413
ar_v3 "github.com/harness/harness-cli/internal/api/ar_v3"
1514
client2 "github.com/harness/harness-cli/util/client"
1615
"github.com/harness/harness-cli/util/common/printer"
1716
"github.com/harness/harness-cli/util/common/progress"
18-
"github.com/rs/zerolog/log"
1917

18+
"github.com/google/uuid"
19+
"github.com/rs/zerolog/log"
2020
"github.com/spf13/cobra"
2121
)
2222

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ require (
2222
github.com/stretchr/testify v1.10.0
2323
github.com/tmaxmax/go-sse v0.11.0
2424
github.com/zhyee/zipstream v0.0.0-20230625125559-133d8d1afaa0
25-
golang.org/x/crypto v0.42.0
26-
golang.org/x/net v0.44.0
27-
golang.org/x/term v0.35.0
25+
golang.org/x/crypto v0.43.0
26+
golang.org/x/net v0.45.0
27+
golang.org/x/term v0.36.0
2828
gopkg.in/yaml.v3 v3.0.1
2929
helm.sh/helm/v3 v3.18.4
3030
)
@@ -34,7 +34,7 @@ require (
3434
github.com/Masterminds/semver/v3 v3.3.0 // indirect
3535
github.com/blang/semver/v4 v4.0.0 // indirect
3636
github.com/chai2010/gettext-go v1.0.2 // indirect
37-
github.com/containerd/containerd v1.7.27 // indirect
37+
github.com/containerd/containerd v1.7.29 // indirect
3838
github.com/containerd/errdefs v1.0.0 // indirect
3939
github.com/containerd/log v0.1.0 // indirect
4040
github.com/containerd/platforms v0.2.1 // indirect
@@ -131,7 +131,7 @@ require (
131131
github.com/vbatts/tar-split v0.12.1 // indirect
132132
golang.org/x/mod v0.28.0
133133
golang.org/x/sync v0.17.0 // indirect
134-
golang.org/x/sys v0.36.0 // indirect
135-
golang.org/x/text v0.29.0 // indirect
134+
golang.org/x/sys v0.37.0 // indirect
135+
golang.org/x/text v0.30.0 // indirect
136136
gopkg.in/ini.v1 v1.67.0
137137
)

go.sum

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNS
4646
github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA=
4747
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
4848
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
49-
github.com/containerd/containerd v1.7.27 h1:yFyEyojddO3MIGVER2xJLWoCIn+Up4GaHFquP7hsFII=
50-
github.com/containerd/containerd v1.7.27/go.mod h1:xZmPnl75Vc+BLGt4MIfu6bp+fy03gdHAn9bz+FreFR0=
49+
github.com/containerd/containerd v1.7.29 h1:90fWABQsaN9mJhGkoVnuzEY+o1XDPbg9BTC9QTAHnuE=
50+
github.com/containerd/containerd v1.7.29/go.mod h1:azUkWcOvHrWvaiUjSQH0fjzuHIwSPg1WL5PshGP4Szs=
5151
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
5252
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
5353
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
@@ -388,8 +388,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
388388
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
389389
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
390390
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
391-
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
392-
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
391+
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
392+
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
393393
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
394394
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
395395
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
@@ -405,8 +405,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
405405
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
406406
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
407407
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
408-
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
409-
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
408+
golang.org/x/net v0.45.0 h1:RLBg5JKixCy82FtLJpeNlVM0nrSqpCRYzVU1n8kj0tM=
409+
golang.org/x/net v0.45.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
410410
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=
411411
golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=
412412
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -433,22 +433,22 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
433433
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
434434
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
435435
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
436-
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
437-
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
436+
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
437+
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
438438
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
439439
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
440440
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
441441
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
442442
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
443-
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
444-
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
443+
golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
444+
golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
445445
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
446446
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
447447
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
448448
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
449449
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
450-
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
451-
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
450+
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
451+
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
452452
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
453453
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
454454
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -457,8 +457,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
457457
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
458458
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
459459
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
460-
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
461-
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
460+
golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
461+
golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
462462
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
463463
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
464464
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 commit comments

Comments
 (0)