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.
Browse files
Browse the repository at this point in the history
* 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: Hillium <maruruku@stu.csust.edu.cn> Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com> Co-authored-by: kennytm <kennytm@gmail.com>
- Loading branch information
1 parent
2d64507
commit 51937b2
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