Skip to content

Commit 464445e

Browse files
authored
CR-19186-account-admin-check (#700)
## What fix helm values validation to check for user's admin role correctly. previous check was looking for codefresh-admin role, and not acocunt-admin. ## Why the previous check would fail to all of our customers. ## Notes after it is merged - need to update the gitops helm chart to use the new version.
1 parent 05da914 commit 464445e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.1.48
1+
VERSION=v0.1.49
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")

cmd/commands/helm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func validateWithUserToken(ctx context.Context, opts *HelmValidateValuesOptions,
201201
return "", "", err
202202
}
203203

204-
if user.IsAdmin == nil || !*user.IsAdmin {
204+
if !user.IsActiveAccountAdmin() {
205205
return "", "", fmt.Errorf("user \"%s\" does not have Admin role in account \"%s\"", user.Name, *user.ActiveAccount.Name)
206206
}
207207

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/argoproj/argo-events v0.17.1-0.20220327045437-70eaafe9afec
1010
github.com/argoproj/argo-workflows/v3 v3.3.1
1111
github.com/briandowns/spinner v1.18.1
12-
github.com/codefresh-io/go-sdk v0.56.0
12+
github.com/codefresh-io/go-sdk v0.57.0
1313
github.com/fatih/color v1.13.0
1414
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
1515
github.com/go-git/go-billy/v5 v5.3.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h
288288
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
289289
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
290290
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
291-
github.com/codefresh-io/go-sdk v0.56.0 h1:eMtwi1KGTVwt9Hyq4FrPLNg7fz8IykpEKfwpGh9Hb2k=
292-
github.com/codefresh-io/go-sdk v0.56.0/go.mod h1:CcoVmTFWHGkbrSW8LyOGB/vJe5Vzr3iC/pNE2QIBTyg=
291+
github.com/codefresh-io/go-sdk v0.57.0 h1:+CYSyVRz1/Eip6cPF9MFlC0D94z7cNQA+IM5FQY8hXQ=
292+
github.com/codefresh-io/go-sdk v0.57.0/go.mod h1:CcoVmTFWHGkbrSW8LyOGB/vJe5Vzr3iC/pNE2QIBTyg=
293293
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
294294
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
295295
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=

0 commit comments

Comments
 (0)