Skip to content

Commit 3c25de9

Browse files
authored
[cherry-pick] make fmt (#1107) (#1115)
/cherry-pick Signed-off-by: 1gtm <1gtm@appscode.com>
1 parent b78c499 commit 3c25de9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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-elasticsearch",
3434
Short: `Elasticsearch backup & restore plugin for Stash by AppsCode`,
3535
Long: `Elasticsearch backup & restore plugin for Stash by AppsCode. For more information, visit here: https://appscode.com/products/stash`,

pkg/utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (session *sessionWrapper) setUserArgs(args string) {
108108
}
109109

110110
func (session *sessionWrapper) setTLSParameters(appBinding *appcatalog.AppBinding, scratchDir string) error {
111-
session.sh.SetEnv("NODE_TLS_REJECT_UNAUTHORIZED", "0") //xref: https://github.com/taskrabbit/elasticsearch-dump#bypassing-self-sign-certificate-errors
111+
session.sh.SetEnv("NODE_TLS_REJECT_UNAUTHORIZED", "0") // xref: https://github.com/taskrabbit/elasticsearch-dump#bypassing-self-sign-certificate-errors
112112
if appBinding.Spec.ClientConfig.CABundle != nil {
113113
if err := ioutil.WriteFile(filepath.Join(scratchDir, ESCACertFile), appBinding.Spec.ClientConfig.CABundle, os.ModePerm); err != nil {
114114
return err
@@ -141,6 +141,7 @@ func (opt esOptions) waitForDBReady(appBinding *appcatalog.AppBinding) error {
141141
klog.Infoln("Performing multielasticdump on", hostname)
142142
return nil
143143
}
144+
144145
func clearDir(dir string) error {
145146
if err := os.RemoveAll(dir); err != nil {
146147
return fmt.Errorf("unable to clean datadir: %v. Reason: %v", dir, err)
@@ -160,5 +161,5 @@ func writeAuthFile(filename string, cred *core.Secret) error {
160161
must(meta_util.GetBytesForKeys(cred.Data, core.BasicAuthUsernameKey, ESUser)),
161162
must(meta_util.GetBytesForKeys(cred.Data, core.BasicAuthPasswordKey, ESPassword)),
162163
)
163-
return ioutil.WriteFile(filename, []byte(authKeys), 0400) // only redable to owner
164+
return ioutil.WriteFile(filename, []byte(authKeys), 0o400) // only redable to owner
164165
}

0 commit comments

Comments
 (0)