mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-08 00:37:27 +00:00
misc: use errors.As instead of type checking
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
parent
ce3e264c7d
commit
22134b1233
1 changed files with 2 additions and 4 deletions
|
|
@ -539,10 +539,8 @@ func maskDockerconfigjsonSopsData(dataMap map[string]string, encode bool) error
|
|||
func maskBase64EncryptedSopsData(dataMap map[string]string, mask string) error {
|
||||
for k, v := range dataMap {
|
||||
data, err := base64.StdEncoding.DecodeString(v)
|
||||
if err != nil {
|
||||
if _, ok := err.(base64.CorruptInputError); ok {
|
||||
return err
|
||||
}
|
||||
if corruptErr := base64.CorruptInputError(0); errors.As(err, &corruptErr) {
|
||||
return corruptErr
|
||||
}
|
||||
|
||||
if bytes.Contains(data, []byte("sops")) && bytes.Contains(data, []byte("ENC[")) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue