Skip to content

Commit 9f0c6a9

Browse files
authored
remove extension-specific type checks (#842)
Signed-off-by: Ankita Thomas <[email protected]>
1 parent b3f7127 commit 9f0c6a9

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

api/v1alpha1/clusterextension_types_test.go

+2-12
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestClusterExtensionTypeRegistration(t *testing.T) {
2222
}
2323

2424
for _, tt := range types {
25-
if !slices.Contains(conditionsets.ConditionTypes, tt) && !slices.Contains(conditionsets.ExtensionConditionTypes, tt) {
25+
if !slices.Contains(conditionsets.ConditionTypes, tt) {
2626
t.Errorf("append Type%s to conditionsets.ConditionTypes in this package's init function", tt)
2727
}
2828
}
@@ -32,11 +32,6 @@ func TestClusterExtensionTypeRegistration(t *testing.T) {
3232
t.Errorf("there must be a Type%[1]s string literal constant for type %[1]q (i.e. 'const Type%[1]s = %[1]q')", tt)
3333
}
3434
}
35-
for _, tt := range conditionsets.ExtensionConditionTypes {
36-
if !slices.Contains(types, tt) {
37-
t.Errorf("there must be a Type%[1]s string literal constant for type %[1]q (i.e. 'const Type%[1]s = %[1]q')", tt)
38-
}
39-
}
4035
}
4136

4237
func TestClusterExtensionReasonRegistration(t *testing.T) {
@@ -46,7 +41,7 @@ func TestClusterExtensionReasonRegistration(t *testing.T) {
4641
}
4742

4843
for _, r := range reasons {
49-
if !slices.Contains(conditionsets.ConditionReasons, r) && !slices.Contains(conditionsets.ExtensionConditionReasons, r) {
44+
if !slices.Contains(conditionsets.ConditionReasons, r) {
5045
t.Errorf("append Reason%s to conditionsets.ConditionReasons in this package's init function.", r)
5146
}
5247
}
@@ -55,11 +50,6 @@ func TestClusterExtensionReasonRegistration(t *testing.T) {
5550
t.Errorf("there must be a Reason%[1]s string literal constant for reason %[1]q (i.e. 'const Reason%[1]s = %[1]q')", r)
5651
}
5752
}
58-
for _, r := range conditionsets.ExtensionConditionReasons {
59-
if !slices.Contains(reasons, r) {
60-
t.Errorf("there must be a Reason%[1]s string literal constant for reason %[1]q (i.e. 'const Reason%[1]s = %[1]q')", r)
61-
}
62-
}
6353
}
6454

6555
// parseConstants parses the values of the top-level constants in the current

internal/conditionsets/conditionsets.go

-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ package conditionsets
2222
// NOTE: These are populated by init() in api/v1alpha1/clusterextension_types.go
2323
var ConditionTypes []string
2424
var ConditionReasons []string
25-
26-
// ExtensionConditionTypes is the set of Extension exclusive condition Types.
27-
var ExtensionConditionTypes []string
28-
var ExtensionConditionReasons []string

0 commit comments

Comments
 (0)