File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func TestAccCloudStackCniConfiguration_basic(t *testing.T) {
3232 var cniConfig cloudstack.UserData
3333
3434 resource .Test (t , resource.TestCase {
35- PreCheck : func () { testAccPreCheck (t ) },
35+ PreCheck : func () { testAccPreCheck (t ); testAccPreCheckCniSupport ( t ) },
3636 Providers : testAccProviders ,
3737 CheckDestroy : testAccCheckCloudStackCniConfigurationDestroy ,
3838 Steps : []resource.TestStep {
@@ -140,3 +140,14 @@ resource "cloudstack_cni_configuration" "foo" {
140140 params = ["KUBERNETES_NODE_NAME", "CNI_MTU"]
141141}
142142`
143+
144+ func testAccPreCheckCniSupport (t * testing.T ) {
145+ cs := testAccProvider .Meta ().(* cloudstack.CloudStackClient )
146+
147+ // Try to list CNI configurations to check if the feature is available
148+ p := cs .Configuration .NewListCniConfigurationParams ()
149+ _ , err := cs .Configuration .ListCniConfiguration (p )
150+ if err != nil {
151+ t .Skipf ("CNI configuration not supported in this CloudStack version (requires 4.21.0+): %v" , err )
152+ }
153+ }
You can’t perform that action at this time.
0 commit comments