-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding warning message for non-supported version of kind config file. (…
…#232) Signed-off-by: Ken Sipe <[email protected]>
- Loading branch information
Showing
3 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestCheckVersion(t *testing.T) { | ||
|
||
tests := []struct { | ||
name string | ||
ver string | ||
expected bool | ||
}{ | ||
{ | ||
name: `current version`, | ||
ver: "kind.sigs.k8s.io/v1alpha4", | ||
expected: true, | ||
}, | ||
{ | ||
name: `early version`, | ||
ver: "kind.sigs.k8s.io/v1alpha3", | ||
expected: false, | ||
}, | ||
{ | ||
name: `newer version`, | ||
ver: "kind.sigs.k8s.io/v1beta1", | ||
expected: true, | ||
}, | ||
{ | ||
name: `wrong group`, | ||
ver: "foo/v1alpha4", | ||
expected: false, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
tt := tt | ||
t.Run(tt.name, func(t *testing.T) { | ||
result := IsMinVersion(tt.ver) | ||
assert.Equal(t, tt.expected, result) | ||
}) | ||
} | ||
} |