This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* backup: don't log secret of s3. * br_s3: always print log. * *: remove query string on logging arguments. * br_s3: reset BR_LOG_TO_TERM on fail. * Apply suggestions from code review Co-authored-by: kennytm <kennytm@gmail.com> * Apply suggestions from code review Co-authored-by: kennytm <kennytm@gmail.com> * *: remove query string on logging arguments. Co-authored-by: kennytm <kennytm@gmail.com>
- Loading branch information
Showing
8 changed files
with
102 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0. | ||
|
||
package task | ||
|
||
import ( | ||
"fmt" | ||
|
||
. "github.com/pingcap/check" | ||
"github.com/spf13/pflag" | ||
) | ||
|
||
var _ = Suite(&testCommonSuite{}) | ||
|
||
type testCommonSuite struct{} | ||
|
||
type fakeValue string | ||
|
||
func (f fakeValue) String() string { | ||
return string(f) | ||
} | ||
|
||
func (f fakeValue) Set(string) error { | ||
panic("implement me") | ||
} | ||
|
||
func (f fakeValue) Type() string { | ||
panic("implement me") | ||
} | ||
|
||
func (*testCommonSuite) TestUrlNoQuery(c *C) { | ||
flag := &pflag.Flag{ | ||
Name: flagStorage, | ||
Value: fakeValue("s3://some/what?secret=a123456789&key=987654321"), | ||
} | ||
|
||
field := flagToZapField(flag) | ||
c.Assert(field.Key, Equals, flagStorage) | ||
c.Assert(field.Interface.(fmt.Stringer).String(), Equals, "s3://some/what") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters