-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAT-16616][PLAT-16340] Improved how yba installer handles self sign…
…ed certs Summary: Allow regenerating self signed certs via yba-ctl reconfigure. If the config file has empty values for the pem files, it will regenerate the self signed certs. In addition, added a preflight check to validate cert values are set before allowing an upgrade. Test Plan: validated cert regen and preflight Reviewers: muthu, sanketh Reviewed By: muthu Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D41533
- Loading branch information
Showing
3 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
managed/yba-installer/pkg/preflight/checks/upgrade_config.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package checks | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/viper" | ||
) | ||
|
||
var UpgradeConfigCheck = upgradeConfigCheck{ | ||
"upgrade-config", | ||
true, | ||
} | ||
|
||
type upgradeConfigCheck struct { | ||
name string | ||
skipAllowed bool | ||
} | ||
|
||
func (u upgradeConfigCheck) Name() string { | ||
return u.name | ||
} | ||
|
||
func (u upgradeConfigCheck) SkipAllowed() bool { | ||
return u.skipAllowed | ||
} | ||
|
||
func (u upgradeConfigCheck) Execute() Result { | ||
res := Result{ | ||
Check: u.name, | ||
Status: StatusPassed, | ||
} | ||
|
||
// Check that certs are specified | ||
if viper.GetString("server_cert_path") == "" || viper.GetString("server_key_path") == "" { | ||
res.Status = StatusCritical | ||
res.Error = fmt.Errorf("server_cert_path and server_key_path must be set") | ||
} | ||
|
||
return res | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters