diff --git a/internal/api/v20240610preview/conversion_fuzz_test.go b/internal/api/v20240610preview/conversion_fuzz_test.go index 764c711a42..8575f4b89d 100644 --- a/internal/api/v20240610preview/conversion_fuzz_test.go +++ b/internal/api/v20240610preview/conversion_fuzz_test.go @@ -66,6 +66,14 @@ func TestRoundTripInternalExternalInternal(t *testing.T) { // ClusterServiceID does not roundtrip through the external type because it is purely an internal detail j.ClusterServiceID = ocm.InternalID{} }, + func(j *api.CustomerManagedEncryptionProfile, c randfill.Continue) { + c.FillNoCustom(j) + // we cannot properly roundtrip a zero value here, so nil when that happens + zeroValueKMS := api.KmsEncryptionProfile{} + if j.Kms != nil && *j.Kms == zeroValueKMS { + j.Kms = nil + } + }, }, rand.NewSource(seed)) // Try a few times, since runTest uses random values. diff --git a/internal/api/v20251223preview/conversion_fuzz_test.go b/internal/api/v20251223preview/conversion_fuzz_test.go index bedd2cbacf..b5ef7a88c9 100644 --- a/internal/api/v20251223preview/conversion_fuzz_test.go +++ b/internal/api/v20251223preview/conversion_fuzz_test.go @@ -66,6 +66,14 @@ func TestRoundTripInternalExternalInternal(t *testing.T) { // ClusterServiceID does not roundtrip through the external type because it is purely an internal detail j.ClusterServiceID = ocm.InternalID{} }, + func(j *api.CustomerManagedEncryptionProfile, c randfill.Continue) { + c.FillNoCustom(j) + // we cannot properly roundtrip a zero value here, so nil when that happens + zeroValueKMS := api.KmsEncryptionProfile{} + if j.Kms != nil && *j.Kms == zeroValueKMS { + j.Kms = nil + } + }, }, rand.NewSource(seed)) // Try a few times, since runTest uses random values.