Skip to content

Commit f85df1f

Browse files
authored
Security vulns (#762)
## What <!-- What is changing in this PR? --> ## Why <!-- Why are these changes being made? --> ## Notes <!-- Add any additional notes here -->
1 parent fd3d1c9 commit f85df1f

File tree

10 files changed

+518
-1684
lines changed

10 files changed

+518
-1684
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.5-alpine3.20 as base
1+
FROM golang:1.23.3-alpine3.20 as base
22

33
WORKDIR /go/src/github.com/codefresh-io/cli-v2
44

@@ -27,7 +27,7 @@ RUN go mod verify
2727

2828
############################### CLI ###############################
2929
### Compile
30-
FROM golang:1.22.5-alpine3.20 as codefresh-build
30+
FROM golang:1.23.3-alpine3.20 as codefresh-build
3131

3232
WORKDIR /go/src/github.com/codefresh-io/cli-v2
3333

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.1.67
1+
VERSION=v0.1.68
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")
@@ -176,4 +176,4 @@ $(GOBIN)/mockgen:
176176
$(GOBIN)/golangci-lint:
177177
@mkdir dist || true
178178
@echo installing: golangci-lint
179-
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.55.2
179+
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.62.2

cmd/commands/cluster.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ func createAddClusterManifests(opts *ClusterAddOptions, ingressUrl, server, csdp
329329
Behavior: "merge",
330330
KvPairSources: kusttypes.KvPairSources{
331331
LiteralSources: []string{
332-
fmt.Sprintf("ingressUrl=" + ingressUrl),
333-
fmt.Sprintf("contextName=" + opts.clusterName),
334-
fmt.Sprintf("server=" + server),
332+
fmt.Sprint("ingressUrl=" + ingressUrl),
333+
fmt.Sprint("contextName=" + opts.clusterName),
334+
fmt.Sprint("server=" + server),
335335
fmt.Sprintf("skipTLSValidation=%v", opts.skipTLSValidation),
336336
},
337337
},
@@ -346,7 +346,7 @@ func createAddClusterManifests(opts *ClusterAddOptions, ingressUrl, server, csdp
346346
Behavior: "merge",
347347
KvPairSources: kusttypes.KvPairSources{
348348
LiteralSources: []string{
349-
fmt.Sprintf("csdpToken=" + csdpToken),
349+
fmt.Sprint("csdpToken=" + csdpToken),
350350
},
351351
},
352352
},
@@ -401,7 +401,7 @@ func createAddClusterManifests(opts *ClusterAddOptions, ingressUrl, server, csdp
401401
return nil, "", fmt.Errorf("failed encoding annotations: %w", err)
402402
}
403403

404-
k.ConfigMapGenerator[0].KvPairSources.LiteralSources = append(k.ConfigMapGenerator[0].KvPairSources.LiteralSources, fmt.Sprintf("annotations="+annotationsStr))
404+
k.ConfigMapGenerator[0].KvPairSources.LiteralSources = append(k.ConfigMapGenerator[0].KvPairSources.LiteralSources, fmt.Sprint("annotations="+annotationsStr))
405405
}
406406

407407
if len(opts.labels) > 0 {
@@ -410,7 +410,7 @@ func createAddClusterManifests(opts *ClusterAddOptions, ingressUrl, server, csdp
410410
return nil, "", fmt.Errorf("failed encoding labels: %w", err)
411411
}
412412

413-
k.ConfigMapGenerator[0].KvPairSources.LiteralSources = append(k.ConfigMapGenerator[0].KvPairSources.LiteralSources, fmt.Sprintf("labels="+labelsStr))
413+
k.ConfigMapGenerator[0].KvPairSources.LiteralSources = append(k.ConfigMapGenerator[0].KvPairSources.LiteralSources, fmt.Sprint("labels="+labelsStr))
414414
}
415415

416416
if opts.tag != "" {
@@ -422,9 +422,6 @@ func createAddClusterManifests(opts *ClusterAddOptions, ingressUrl, server, csdp
422422
}
423423
}
424424

425-
k.FixKustomizationPostUnmarshalling()
426-
util.Die(k.FixKustomizationPreMarshalling())
427-
428425
manifests, err := kustutil.BuildKustomization(k)
429426
if err != nil {
430427
return nil, "", fmt.Errorf("failed to build kustomization: %w", err)

cmd/commands/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func newConfigGetRuntimeCommand() *cobra.Command {
222222
func runConfigGetRuntime(ctx context.Context) error {
223223
cur := cfConfig.GetCurrentContext()
224224
if cur.DefaultRuntime == "" {
225-
return fmt.Errorf(util.Doc("no default runtime is set for current context, use '<BIN> config set-runtime' to set one"))
225+
return errors.New(util.Doc("no default runtime is set for current context, use '<BIN> config set-runtime' to set one"))
226226
}
227227

228228
log.G(ctx).Infof("default runtime set to: %s", cur.DefaultRuntime)

cmd/commands/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ func runRuntimeUninstall(ctx context.Context, opts *RuntimeUninstallOptions) err
596596
if err != nil {
597597
errorMsg := fmt.Sprintf("failed to do post uninstall cleanup: %v", err)
598598
if !opts.Force {
599-
return fmt.Errorf(errorMsg)
599+
return errors.New(errorMsg)
600600
}
601601
log.G().Warn(errorMsg)
602602
}

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cf version
2323

2424
```bash
2525
# download and extract the binary
26-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.63/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.68/cf-linux-amd64.tar.gz | tar zx
2727

2828
# move the binary to your $PATH
2929
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
3636

3737
```bash
3838
# download and extract the binary
39-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.63/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.68/cf-darwin-amd64.tar.gz | tar zx
4040

4141
# move the binary to your $PATH
4242
mv ./cf-darwin-amd64 /usr/local/bin/cf

0 commit comments

Comments
 (0)