Skip to content

Commit

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

Signed-off-by: 1gtm <1gtm@appscode.com>
  • Loading branch information
1gtm committed Mar 1, 2022
1 parent c2388a1 commit bb5196e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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-elasticsearch",
Short: `Elasticsearch backup & restore plugin for Stash by AppsCode`,
Long: `Elasticsearch backup & restore plugin for Stash by AppsCode. For more information, visit here: https://appscode.com/products/stash`,
Expand Down
5 changes: 3 additions & 2 deletions pkg/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (session *sessionWrapper) setUserArgs(args string) {
}

func (session *sessionWrapper) setTLSParameters(appBinding *appcatalog.AppBinding, scratchDir string) error {
session.sh.SetEnv("NODE_TLS_REJECT_UNAUTHORIZED", "0") //xref: https://github.com/taskrabbit/elasticsearch-dump#bypassing-self-sign-certificate-errors
session.sh.SetEnv("NODE_TLS_REJECT_UNAUTHORIZED", "0") // xref: https://github.com/taskrabbit/elasticsearch-dump#bypassing-self-sign-certificate-errors
if appBinding.Spec.ClientConfig.CABundle != nil {
if err := ioutil.WriteFile(filepath.Join(scratchDir, ESCACertFile), appBinding.Spec.ClientConfig.CABundle, os.ModePerm); err != nil {
return err
Expand Down Expand Up @@ -141,6 +141,7 @@ func (opt esOptions) waitForDBReady(appBinding *appcatalog.AppBinding) error {
klog.Infoln("Performing multielasticdump on", hostname)
return nil
}

func clearDir(dir string) error {
if err := os.RemoveAll(dir); err != nil {
return fmt.Errorf("unable to clean datadir: %v. Reason: %v", dir, err)
Expand All @@ -160,5 +161,5 @@ func writeAuthFile(filename string, cred *core.Secret) error {
must(meta_util.GetBytesForKeys(cred.Data, core.BasicAuthUsernameKey, ESUser)),
must(meta_util.GetBytesForKeys(cred.Data, core.BasicAuthPasswordKey, ESPassword)),
)
return ioutil.WriteFile(filename, []byte(authKeys), 0400) // only redable to owner
return ioutil.WriteFile(filename, []byte(authKeys), 0o400) // only redable to owner
}

0 comments on commit bb5196e

Please sign in to comment.