@@ -290,7 +290,7 @@ resource "ovh_cloud_project_kube_nodepool" "pool" {
290
290
291
291
`
292
292
293
- func TestAccCloudProjectKubeNodePool (t * testing.T ) {
293
+ func TestAccCloudProjectKubeNodePoolRessource (t * testing.T ) {
294
294
name := acctest .RandomWithPrefix (test_prefix )
295
295
region := os .Getenv ("OVH_CLOUD_PROJECT_KUBE_REGION_TEST" )
296
296
version := os .Getenv ("OVH_CLOUD_PROJECT_KUBE_VERSION_TEST" )
@@ -316,7 +316,13 @@ func TestAccCloudProjectKubeNodePool(t *testing.T) {
316
316
region ,
317
317
version ,
318
318
)
319
-
319
+ configWithoutMaxMinNodes := fmt .Sprintf (
320
+ testAccCloudProjectKubeNodePoolConfigWithoutMaxMin ,
321
+ os .Getenv ("OVH_CLOUD_PROJECT_SERVICE_TEST" ),
322
+ name ,
323
+ region ,
324
+ version ,
325
+ )
320
326
resource .Test (t , resource.TestCase {
321
327
PreCheck : func () {
322
328
testAccPreCheckCloud (t )
@@ -325,6 +331,29 @@ func TestAccCloudProjectKubeNodePool(t *testing.T) {
325
331
},
326
332
Providers : testAccProviders ,
327
333
Steps : []resource.TestStep {
334
+ {
335
+ Config : configWithoutMaxMinNodes ,
336
+ Check : resource .ComposeTestCheckFunc (
337
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube.cluster" , "region" , region ),
338
+ resource .TestCheckResourceAttrSet ("ovh_cloud_project_kube.cluster" , "kubeconfig" ),
339
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube.cluster" , "name" , name ),
340
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube.cluster" , "version" , version ),
341
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "name" , name ),
342
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "flavor_name" , "b2-7" ),
343
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "desired_nodes" , "1" ),
344
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "min_nodes" , "0" ),
345
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "max_nodes" , "100" ),
346
+
347
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "template.0.metadata.0.annotations.a1" , "av1" ),
348
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "template.0.metadata.0.finalizers.0" , "finalizer.extensions/v1beta1" ),
349
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "template.0.metadata.0.labels.l1" , "lv1" ),
350
+
351
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "template.0.spec.0.taints.0.effect" , "PreferNoSchedule" ),
352
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "template.0.spec.0.taints.0.key" , "t1" ),
353
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "template.0.spec.0.taints.0.value" , "tv1" ),
354
+ resource .TestCheckResourceAttr ("ovh_cloud_project_kube_nodepool.pool" , "template.0.spec.0.unschedulable" , "false" ),
355
+ ),
356
+ },
328
357
{
329
358
Config : config ,
330
359
Check : resource .ComposeTestCheckFunc (
0 commit comments