mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
fix tests
This commit is contained in:
parent
a182e2abdc
commit
74a4e7e5e1
2 changed files with 3 additions and 3 deletions
|
|
@ -182,8 +182,8 @@ resetCacheFolder() {
|
|||
|
||||
@test "Fail early when passing a non valid -kubernetes-version" {
|
||||
run bin/kubeconform -kubernetes-version 1.25 fixtures/valid.yaml
|
||||
[[ "$output" == "invalid value "1.25" for flag -kubernetes-version: 1.25 is not a valid version. Valid values are 'master' (default) or full version x.y.z (e.g. '1.27.2')"* ]]
|
||||
[[ `echo "$output" | wc -l` -eq 1 ]]
|
||||
[ "${lines[0]}" == 'invalid value "1.25" for flag -kubernetes-version: 1.25 is not a valid version. Valid values are "master" (default) or full version x.y.z (e.g. "1.27.2")' ]
|
||||
[[ "${lines[1]}" == "Usage:"* ]]
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ func (kv k8sVersionValue) MarshalText() ([]byte, error) {
|
|||
|
||||
func (kv *k8sVersionValue) UnmarshalText(v []byte) error {
|
||||
if ok, _ := regexp.MatchString(`^(master|\d+\.\d+\.\d+)$`, string(v)); ok != true {
|
||||
return fmt.Errorf("%v is not a valid version. Valid values are 'master' (default) or full version x.y.z (e.g. '1.27.2')", kv.String())
|
||||
return fmt.Errorf("%v is not a valid version. Valid values are \"master\" (default) or full version x.y.z (e.g. \"1.27.2\")", string(v))
|
||||
}
|
||||
*kv = k8sVersionValue(v)
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue