terraform-provider-rancher2
terraform-provider-rancher2 copied to clipboard
[BUG] Terraform does not fail if secret is missing
Rancher Server Setup
- Rancher version: RKE2
Information about the Cluster
Hosted on-prem with RockyLinux as OS.
User Information
- What is the role of the user logged in? (Admin/Cluster Owner/Cluster Member/Project Owner/Project Member/Custom) Admin
Provider Information
- What is the version of the Rancher v2 Terraform Provider in use? 4.1.0
- What is the version of Terraform in use? 1.7.4
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.