diff --git a/config/tests/servicemapping/servicemapping_test.go b/config/tests/servicemapping/servicemapping_test.go index 8afb1c10fe..729fe9d810 100644 --- a/config/tests/servicemapping/servicemapping_test.go +++ b/config/tests/servicemapping/servicemapping_test.go @@ -1267,6 +1267,11 @@ func TestStorageVersionIsSetAndValidIFFV1alpha1ToV1beta1IsSet(t *testing.T) { continue } if isV1alpha1ToV1beta1 { + // if this is a direct resource, the storage version is defiend + // in the kubebuilder tooling + if r.Direct { + continue + } if hasStorageVersion { t.Errorf("Resource config %v has `v1alpha1ToV1beta1: "+ "true` but doesn't have a valid `storageVersion`: "+ diff --git a/pkg/k8s/allowlist_test.go b/pkg/k8s/allowlist_test.go index 33b54251c9..c5df02a4b3 100644 --- a/pkg/k8s/allowlist_test.go +++ b/pkg/k8s/allowlist_test.go @@ -145,6 +145,11 @@ func TestOutputOnlyFieldsAreUnderObservedState(t *testing.T) { } requiredFieldsMap := map[string]bool{"observedGeneration": true, "conditions": true} optionalFieldsMap := map[string]bool{"observedState": true} + + // for direct resources, we will use the "externalRef" prop under the "status" + // to track the KCC full resource ID + optionalFieldsMap["externalRef"] = true + for k, _ := range statusProp.Properties { foundInMaps := false if _, ok := requiredFieldsMap[k]; ok { @@ -156,7 +161,7 @@ func TestOutputOnlyFieldsAreUnderObservedState(t *testing.T) { delete(optionalFieldsMap, k) } if !foundInMaps { - t.Errorf("CRD has non-boilerplate field %v under 'status'", k) + t.Errorf("CRD has non-boilerplate field '%v' under 'status'", k) } }