Skip to content

Commit cdc2824

Browse files
authored
New error code for Secret not found (#33)
Updated from `ackerr.NotFound` to `SecretNotFound`
1 parent 8da9852 commit cdc2824

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/errors/error.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ var (
5555
// SecretTypeNotSupported is returned if non opaque secret is used.
5656
SecretTypeNotSupported = fmt.Errorf(
5757
"only opaque secrets can be used")
58+
// SecretNotFound is returned if specified kubernetes secret is not found.
59+
SecretNotFound = fmt.Errorf(
60+
"kubernetes secret not found")
5861
)
5962

6063
// AWSError returns the type conversion for the supplied error to an aws-sdk-go

pkg/runtime/reconciler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (r *reconciler) SecretValueFromReference(
105105
}
106106
var secret corev1.Secret
107107
if err := r.kc.Get(ctx, nsn, &secret); err != nil {
108-
return "", err
108+
return "", ackerr.SecretNotFound
109109
}
110110

111111
// Currently we have only Opaque secrets in scope.
@@ -118,7 +118,7 @@ func (r *reconciler) SecretValueFromReference(
118118
return valuestr, nil
119119
}
120120

121-
return "", ackerr.NotFound
121+
return "", ackerr.SecretNotFound
122122
}
123123

124124
// Reconcile implements `controller-runtime.Reconciler` and handles reconciling

0 commit comments

Comments
 (0)