File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 59
59
image : " {{ .Values.image.repo }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
60
60
imagePullPolicy : {{ .Values.image.pullPolicy }}
61
61
command :
62
- - /coder-xray scan
62
+ - /coder-xray
63
+ - scan
63
64
env :
64
65
- name : CODER_URL
65
66
value : {{ .Values.coder.url }}
Original file line number Diff line number Diff line change 8
8
"github.com/spf13/cobra"
9
9
"golang.org/x/xerrors"
10
10
"k8s.io/client-go/kubernetes"
11
+ restclient "k8s.io/client-go/rest"
11
12
"k8s.io/client-go/tools/clientcmd"
12
13
13
14
"cdr.dev/slog"
@@ -59,7 +60,10 @@ func root() *cobra.Command {
59
60
return xerrors .New ("--artifactory-token is required" )
60
61
}
61
62
62
- config , err := clientcmd .BuildConfigFromFlags ("" , kubeConfig )
63
+ config , err := restclient .InClusterConfig ()
64
+ if xerrors .Is (err , restclient .ErrNotInCluster ) {
65
+ config , err = clientcmd .BuildConfigFromFlags ("" , kubeConfig )
66
+ }
63
67
if err != nil {
64
68
return xerrors .Errorf ("build kubeconfig: %w" , err )
65
69
}
You can’t perform that action at this time.
0 commit comments