Skip to content

K8s: invalid validation values for k8s cniΒ #3374

@JosiahWhite

Description

@JosiahWhite

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.13.3

  • provider registry.terraform.io/scaleway/scaleway v2.60.2

Affected Resource(s)

  • scaleway_k8s_cluster

Terraform Configuration Files

resource "scaleway_k8s_cluster" "cluster" {
  name                        = "some_name"
  version                     = "1.31.2"
  cni                         = "cilium"
  private_network_id          = scaleway_vpc_private_network.pn.id
  delete_additional_resources = true
}

Debug Output

Panic Output

Expected Behavior

No warnings during deployment

Actual Behavior

β”‚ Warning: expected cni to be one of [], got cilium
β”‚ 
β”‚   with module.infra.module.k8s.scaleway_k8s_cluster.cluster,
β”‚   on infra/k8s/cluster.tf line 8, in resource "scaleway_k8s_cluster" "cluster":
β”‚    8:   cni                         = "cilium"
β”‚ 
β”‚ (and one more similar warning elsewhere)

Steps to Reproduce

  1. terraform apply

Important Factoids

This is occurring due to a failure of providing any values to the validation function:
https://github.com/scaleway/terraform-provider-scaleway/blob/master/internal/services/k8s/cluster.go#L72

It seems like the PR creator forgot to call CNI.Values() which returns the full list as defined here:
https://github.com/scaleway/scaleway-sdk-go/blob/master/api/k8s/v1/k8s_sdk.go#L151

References

Metadata

Metadata

Labels

k8sKubernetes Kapsule issues, bugs and feature requestspriority:highestBugs filled by customers, security issues

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions