File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,19 @@ func NewClient(integrationVersion string) (Client, error) {
2323 connectToken , _ := os .LookupEnv ("OP_CONNECT_TOKEN" )
2424 serviceAccountToken , _ := os .LookupEnv ("OP_SERVICE_ACCOUNT_TOKEN" )
2525
26+ if connectHost != "" && connectToken != "" && serviceAccountToken != "" {
27+ return nil , errors .New ("invalid configuration. Either Connect or Service Account credentials should be set, not both" )
28+ }
29+
2630 if serviceAccountToken != "" {
2731 return sdk .NewClient (sdk.Config {
2832 ServiceAccountToken : serviceAccountToken ,
2933 IntegrationName : "1password-operator" ,
3034 IntegrationVersion : integrationVersion ,
3135 })
32- } else if connectHost != "" && connectToken != "" {
36+ }
37+
38+ if connectHost != "" && connectToken != "" {
3339 return connect .NewClient (connect.Config {
3440 ConnectHost : connectHost ,
3541 ConnectToken : connectToken ,
You can’t perform that action at this time.
0 commit comments