Skip to content

Commit b7a719b

Browse files
authored
[cherry-pick] make fmt (#993) (#997)
/cherry-pick Signed-off-by: 1gtm <1gtm@appscode.com>
1 parent 0e9f274 commit b7a719b

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

pkg/backup.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,4 @@ func (opt *postgresOptions) backupPostgreSQL(targetRef api_v1beta1.TargetRef) (*
229229
}
230230

231231
return resticWrapper.RunBackup(opt.backupOptions, targetRef)
232-
233232
}

pkg/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var SupportedProducts = []string{"stash-enterprise", "kubedb-ext-stash"}
2929
var licenseApiService string
3030

3131
func NewRootCmd() *cobra.Command {
32-
var rootCmd = &cobra.Command{
32+
rootCmd := &cobra.Command{
3333
Use: "stash-postgres",
3434
Short: `PostgreSQL backup & restore plugin for Stash by AppsCode`,
3535
Long: `PostgreSQL backup & restore plugin for Stash by AppsCode. For more information, visit here: https://appscode.com/products/stash`,

pkg/util.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (opt *postgresOptions) setDatabaseCredentials(appBinding *appcatalog.AppBin
117117
if !ok {
118118
return fmt.Errorf("can't find client cert")
119119
}
120-
if err := ioutil.WriteFile(filepath.Join(opt.setupOptions.ScratchDir, core.TLSCertKey), certByte, 0600); err != nil {
120+
if err := ioutil.WriteFile(filepath.Join(opt.setupOptions.ScratchDir, core.TLSCertKey), certByte, 0o600); err != nil {
121121
return err
122122
}
123123

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

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

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

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

0 commit comments

Comments
 (0)