Skip to content

Commit

Permalink
tiny fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tennix committed Feb 27, 2019
1 parent a58e58c commit b6000b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/e2e/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package e2e

import (
"database/sql"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
Expand Down Expand Up @@ -60,13 +59,14 @@ type Response struct {
func testCreate(ns, clusterName string) {
By(fmt.Sprintf("When create the TiDB cluster: %s/%s", ns, clusterName))
instanceName := getInstanceName(ns, clusterName)
err := createSecret(ns, clusterName)
Expect(err).NotTo(HaveOccurred())

cmdStr := fmt.Sprintf("helm install /charts/tidb-cluster -f /tidb-cluster-values.yaml"+
" -n %s --namespace=%s --set clusterName=%s,tidb.passwordSecretName=%s",
instanceName, ns, clusterName, ns+"-"+clusterName)
_, err = execCmd(cmdStr)
_, err := execCmd(cmdStr)
Expect(err).NotTo(HaveOccurred())

err = createSecret(ns, clusterName)
Expect(err).NotTo(HaveOccurred())

By("Then all members should running")
Expand Down Expand Up @@ -602,7 +602,7 @@ func createSecret(ns, clusterName string) error {
Namespace: ns,
},
Data: map[string][]byte{
"root": []byte(base64.StdEncoding.EncodeToString([]byte(password))),
"root": []byte(password),
},
Type: corev1.SecretTypeOpaque,
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func clearOperator() error {
return err
}
err = kubeCli.CoreV1().Secrets(fixture.ns).Delete(fixture.ns+"-"+fixture.clusterName, nil)
if err != nil && apierrs.IsNotFound(err) {
if err != nil && !apierrs.IsNotFound(err) {
return err
}
}
Expand Down

0 comments on commit b6000b5

Please sign in to comment.