Skip to content

Commit

Permalink
Clean up deploy autoauth. (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-rieke committed Jan 28, 2024
1 parent e9e0167 commit d447304
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/utils/autoUtil.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func AutoAuth(config *DriverConfig,
}

// New values available for the cert file
if secretIDPtr != nil && *secretIDPtr != "" && appRoleIDPtr != nil && *appRoleIDPtr != "" {
if secretIDPtr != nil && len(*secretIDPtr) > 0 && appRoleIDPtr != nil && len(*appRoleIDPtr) > 0 {
override = true
}

Expand Down Expand Up @@ -148,7 +148,8 @@ func AutoAuth(config *DriverConfig,
var approleID string
var dump []byte

if override {
if override || appRoleConfig == "deployauth" {
// Nothing...
} else {
scanner := bufio.NewScanner(os.Stdin)
// Enter ID tokens
Expand Down Expand Up @@ -221,7 +222,7 @@ func AutoAuth(config *DriverConfig,
}

dump = []byte(certConfigData)
} else if override && !exists {
} else if (override && !exists) || appRoleConfig == "deployauth" {
if !config.IsShell {
LogInfo(config, "No approle file exists, continuing without saving config IDs")
}
Expand All @@ -239,7 +240,7 @@ func AutoAuth(config *DriverConfig,
}

// Do not save IDs if overriding and no approle file exists
if !override || exists {
if (!override || exists) && appRoleConfig != "deployauth" {

// Create hidden folder
if _, err := os.Stat(userHome + "/.tierceron"); os.IsNotExist(err) {
Expand Down

0 comments on commit d447304

Please sign in to comment.