1
0
mirror of synced 2026-02-06 19:05:55 +00:00

misc: use errors.As instead of type checking

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
Hidde Beydals
2023-10-13 10:25:38 +02:00
parent ce3e264c7d
commit 22134b1233

View File

@@ -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[")) {