mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-05 17:44:44 +00:00
Migrate sourcesecret package to runtime/secrets APIs
The sourcesecret package now uses pkg/runtime/secrets factory functions instead of the previous monolithic approach. This provides standardized secret generation with consistent validation and error handling across all authentication types. Signed-off-by: cappyzawa <cappyzawa@gmail.com>
This commit is contained in:
parent
8176d88801
commit
8b95a09319
19 changed files with 212 additions and 85 deletions
|
|
@ -83,10 +83,12 @@ func createSecretHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||
}
|
||||
|
||||
var certFile, keyFile []byte
|
||||
if secretHelmArgs.tlsCrtFile != "" && secretHelmArgs.tlsKeyFile != "" {
|
||||
if secretHelmArgs.tlsCrtFile != "" {
|
||||
if certFile, err = os.ReadFile(secretHelmArgs.tlsCrtFile); err != nil {
|
||||
return fmt.Errorf("failed to read cert file: %w", err)
|
||||
}
|
||||
}
|
||||
if secretHelmArgs.tlsKeyFile != "" {
|
||||
if keyFile, err = os.ReadFile(secretHelmArgs.tlsKeyFile); err != nil {
|
||||
return fmt.Errorf("failed to read key file: %w", err)
|
||||
}
|
||||
|
|
@ -102,7 +104,7 @@ func createSecretHelmCmdRun(cmd *cobra.Command, args []string) error {
|
|||
TLSCrt: certFile,
|
||||
TLSKey: keyFile,
|
||||
}
|
||||
secret, err := sourcesecret.Generate(opts)
|
||||
secret, err := sourcesecret.GenerateHelm(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue