rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
253 stars 216 forks source link

[BUG] Terraform does not fail if secret is missing #1337

Open lukeelten opened 2 months ago

lukeelten commented 2 months ago

Rancher Server Setup

Information about the Cluster

Hosted on-prem with RockyLinux as OS.

User Information

Provider Information

Describe the bug

My terraform pipeline uses the data source "rancher2_secret_v2" to retrieve information about a secret. When the secret is not available in the cluster, the pipeline still continues to run and the referenced values are empty. This causes our deployments to fail.

To Reproduce

data "rancher2_secret_v2" "test" {
  cluster_id = <CLUSTER_ID>
  name = "DOES_NOT_EXIST"
  namespace = "default"
}

This terraform script works always whether the secret exists or not.

Actual Result

Terraform script succeeds.

Expected Result

Terraform fails because the referenced secret is missing.

lukeelten commented 2 months ago

Reference #1002