Skip to content

Commit

Permalink
[cherry-pick] make fmt (#993) (#998)
Browse files Browse the repository at this point in the history
/cherry-pick

Signed-off-by: 1gtm <[email protected]>
  • Loading branch information
1gtm authored Mar 1, 2022
1 parent 6335e10 commit a65687e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
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

0 comments on commit a65687e

Please sign in to comment.