Skip to content

Commit 373197a

Browse files
committed
Remove ClusterVariable.DefinitionFrom field
1 parent 990f281 commit 373197a

File tree

12 files changed

+239
-370
lines changed

12 files changed

+239
-370
lines changed

api/v1beta1/conversion.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,3 +573,9 @@ func Convert_v1beta1_Condition_To_v1_Condition(_ *Condition, _ *metav1.Condition
573573
// NOTE: legacy (v1beta1) conditions should not be automatically converted into v1beta2 conditions.
574574
return nil
575575
}
576+
577+
func Convert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(_ *ClusterVariable, _ *clusterv1.ClusterVariable, _ apimachineryconversion.Scope) error {
578+
// NOTE: v1beta2 ClusterVariable does not have DefinitionFrom anymore. But it's fine to just lose this field,
579+
// because it was already not possible to set it anymore with v1beta1.
580+
return nil
581+
}

api/v1beta1/conversion_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func ClusterFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} {
7272
return []interface{}{
7373
hubClusterStatus,
7474
spokeClusterStatus,
75+
spokeClusterVariable,
7576
}
7677
}
7778

@@ -102,6 +103,13 @@ func spokeClusterStatus(in *ClusterStatus, c fuzz.Continue) {
102103
}
103104
}
104105

106+
func spokeClusterVariable(in *ClusterVariable, c fuzz.Continue) {
107+
c.FuzzNoCustom(in)
108+
109+
// Drop DefinitionFrom as we intentionally don't preserve it.
110+
in.DefinitionFrom = ""
111+
}
112+
105113
func ClusterClassFuncs(_ runtimeserializer.CodecFactory) []interface{} {
106114
return []interface{}{
107115
hubClusterClassStatus,

0 commit comments

Comments
 (0)