-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document and add validation on enable_cri_dockerd option (#415)
* doccument cri * Add validation on cri
- Loading branch information
1 parent
56393e4
commit 5f20366
Showing
4 changed files
with
109 additions
and
1 deletion.
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,78 @@ | ||
package rke | ||
|
||
import "testing" | ||
|
||
func Test_k8sVersionRequiresCri(t *testing.T) { | ||
type args struct { | ||
kubernetesVersion string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want bool | ||
}{ | ||
{ | ||
name: "v1.26.4-rancher2-1", | ||
args: args{ | ||
kubernetesVersion: "v1.26.4-rancher2-1", | ||
}, | ||
want: true, | ||
}, | ||
{ | ||
name: "v1.25.9-rancher2-2", | ||
args: args{ | ||
kubernetesVersion: "v1.25.9-rancher2-2", | ||
}, | ||
want: true, | ||
}, | ||
{ | ||
name: "v1.24.13-rancher2-2", | ||
args: args{ | ||
kubernetesVersion: "v1.24.13-rancher2-2", | ||
}, | ||
want: true, | ||
}, | ||
{ | ||
name: "v1.23.16-rancher2-3", | ||
args: args{ | ||
kubernetesVersion: "v1.23.16-rancher2-3", | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "v1.22.17-rancher1-2", | ||
args: args{ | ||
kubernetesVersion: "v1.22.17-rancher1-2", | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "v1.21.14-rancher1-1", | ||
args: args{ | ||
kubernetesVersion: "v1.21.14-rancher1-1", | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "v1.20.15-rancher2-2", | ||
args: args{ | ||
kubernetesVersion: "v1.20.15-rancher2-2", | ||
}, | ||
want: false, | ||
}, | ||
{ | ||
name: "invalid", | ||
args: args{ | ||
kubernetesVersion: "invalid", | ||
}, | ||
want: false, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := k8sVersionRequiresCri(tt.args.kubernetesVersion); got != tt.want { | ||
t.Errorf("k8sVersionRequiresCri() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
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