|
@@ -110,12 +110,6 @@ func ErrorContains(out error, want string) bool {
|
|
|
// We MUST NOT check the name or key property here. It MAY be defaulted by the provider.
|
|
// We MUST NOT check the name or key property here. It MAY be defaulted by the provider.
|
|
|
func ValidateSecretSelector(store esv1beta1.GenericStore, ref esmeta.SecretKeySelector) error {
|
|
func ValidateSecretSelector(store esv1beta1.GenericStore, ref esmeta.SecretKeySelector) error {
|
|
|
clusterScope := store.GetObjectKind().GroupVersionKind().Kind == esv1beta1.ClusterSecretStoreKind
|
|
clusterScope := store.GetObjectKind().GroupVersionKind().Kind == esv1beta1.ClusterSecretStoreKind
|
|
|
- if ref.Name == "" {
|
|
|
|
|
- return fmt.Errorf("secret name is required")
|
|
|
|
|
- }
|
|
|
|
|
- if ref.Key == "" {
|
|
|
|
|
- return fmt.Errorf("secret key is required")
|
|
|
|
|
- }
|
|
|
|
|
if clusterScope && ref.Namespace == nil {
|
|
if clusterScope && ref.Namespace == nil {
|
|
|
return fmt.Errorf("cluster scope requires namespace")
|
|
return fmt.Errorf("cluster scope requires namespace")
|
|
|
}
|
|
}
|