Skip to content

Commit

Permalink
Only run on 1.16+
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Olshevski committed May 13, 2024
1 parent ecb7508 commit 45c69ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 1 addition & 4 deletions internal/controllers/reconciliation/ordering_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ func TestReadinessGroups(t *testing.T) {
}

func TestCRDOrdering(t *testing.T) {
scheme := runtime.NewScheme()
corev1.SchemeBuilder.AddToScheme(scheme)
testv1.SchemeBuilder.AddToScheme(scheme)

testutil.AtLeastVersion(t, 16) // don't bother to support the old v1beta1 crd api
ctx := testutil.NewContext(t)
mgr := testutil.NewManager(t)
upstream := mgr.GetClient()
Expand Down
10 changes: 10 additions & 0 deletions internal/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,13 @@ func (e *ExecConn) Synthesize(ctx context.Context, syn *apiv1.Synthesizer, pod *

return bytes.NewBuffer(js), nil
}

func AtLeastVersion(t *testing.T, minor int) bool {
versionStr := os.Getenv("DOWNSTREAM_VERSION_MINOR")
if versionStr == "" {
return true // fail open for local dev
}

version, _ := strconv.Atoi(versionStr)
return version >= minor
}

0 comments on commit 45c69ef

Please sign in to comment.