Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,4 @@ func (opt *postgresOptions) backupPostgreSQL(targetRef api_v1beta1.TargetRef) (*
}

return resticWrapper.RunBackup(opt.backupOptions, targetRef)

}
2 changes: 1 addition & 1 deletion pkg/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var SupportedProducts = []string{"stash-enterprise", "kubedb-ext-stash"}
var licenseApiService string

func NewRootCmd() *cobra.Command {
var rootCmd = &cobra.Command{
rootCmd := &cobra.Command{
Use: "stash-postgres",
Short: `PostgreSQL backup & restore plugin for Stash by AppsCode`,
Long: `PostgreSQL backup & restore plugin for Stash by AppsCode. For more information, visit here: https://appscode.com/products/stash`,
Expand Down
8 changes: 4 additions & 4 deletions pkg/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (opt *postgresOptions) setDatabaseCredentials(appBinding *appcatalog.AppBin
if !ok {
return fmt.Errorf("can't find client cert")
}
if err := ioutil.WriteFile(filepath.Join(opt.setupOptions.ScratchDir, core.TLSCertKey), certByte, 0600); err != nil {
if err := ioutil.WriteFile(filepath.Join(opt.setupOptions.ScratchDir, core.TLSCertKey), certByte, 0o600); err != nil {
return err
}

Expand All @@ -127,12 +127,12 @@ func (opt *postgresOptions) setDatabaseCredentials(appBinding *appcatalog.AppBin
return fmt.Errorf("can't find client private key")
}

if err := ioutil.WriteFile(filepath.Join(opt.setupOptions.ScratchDir, core.TLSPrivateKeyKey), keyByte, 0600); err != nil {
if err := ioutil.WriteFile(filepath.Join(opt.setupOptions.ScratchDir, core.TLSPrivateKeyKey), keyByte, 0o600); err != nil {
return err
}
session.sh.SetEnv(EnvPGSSLKEY, filepath.Join(opt.setupOptions.ScratchDir, core.TLSPrivateKeyKey))

//TODO: this one is hard coded here but need to change later
// TODO: this one is hard coded here but need to change later
userName = opt.user
} else {
// set env for pg_dump/pg_dumpall
Expand Down Expand Up @@ -181,7 +181,7 @@ func (session *sessionWrapper) setUserArgs(args string) {

func (session *sessionWrapper) setTLSParameters(appBinding *appcatalog.AppBinding, scratchDir string) error {
if appBinding.Spec.ClientConfig.CABundle != nil {
if err := ioutil.WriteFile(filepath.Join(scratchDir, core.ServiceAccountRootCAKey), appBinding.Spec.ClientConfig.CABundle, 0600); err != nil {
if err := ioutil.WriteFile(filepath.Join(scratchDir, core.ServiceAccountRootCAKey), appBinding.Spec.ClientConfig.CABundle, 0o600); err != nil {
return err
}
session.sh.SetEnv(EnvPGSSLROOTCERT, filepath.Join(scratchDir, core.ServiceAccountRootCAKey))
Expand Down