-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from kubefirst/feat-restore-certs
feat-restore-certs
- Loading branch information
Showing
10 changed files
with
472 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
"github.com/kubefirst/kubefirst/internal/ssl" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// backupSslCmd represents the backupSsl command | ||
var backupSslCmd = &cobra.Command{ | ||
Use: "backupSSL", | ||
Short: "Backup Secrets (cert-manager/certificates) to bucket kubefirst-<DOMAIN>", | ||
Long: `This command create a backupt of secrets from certmanager certificates to bucket named kubefirst-<DOMAIN> | ||
where can be used on provisioning phase with the flag --recycle-ssl`, | ||
|
||
Run: func(cmd *cobra.Command, args []string) { | ||
_, err := ssl.GetBackupCertificates() | ||
if err != nil { | ||
log.Panic(err) | ||
} | ||
fmt.Println("Backup certificates finished successfully") | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(backupSslCmd) | ||
} |
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
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,31 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/kubefirst/kubefirst/internal/ssl" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// restoreSSLCmd represents the restoreSSL command | ||
var restoreSSLCmd = &cobra.Command{ | ||
Use: "restoreSSL", | ||
Short: "A brief description of your command", | ||
Long: `A longer description that spans multiple lines and likely contains examples | ||
and usage of using your command. For example: | ||
Cobra is a CLI library for Go that empowers applications. | ||
This application is a tool to generate the needed files | ||
to quickly create a Cobra application.`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("restoreSSL called") | ||
err := ssl.RestoreSSL() | ||
if err != nil { | ||
fmt.Println("Bucket not found, missing SSL backup, assuming first installation") | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(restoreSSLCmd) | ||
} |
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
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
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
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
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
Oops, something went wrong.