kubernetes / kops

Kubernetes Operations (kOps) - Production Grade k8s Installation, Upgrades and Management
https://kops.sigs.k8s.io/
Apache License 2.0
15.97k stars 4.65k forks source link

Conditionally set TF aws_s3_object SSE and ACLs #16818

Closed rifelpet closed 2 months ago

rifelpet commented 2 months ago

We used to set SSE to an empty string, now we leave it unset. This should fix this failing job.

│ Error: expected server_side_encryption to be one of ["AES256" "aws:kms" "aws:kms:dsse"], got 
│ 
│   with aws_s3_object.cluster-completed-spec,
│   on kubernetes.tf line 1104, in resource "aws_s3_object" "cluster-completed-spec":
│ 1104:   server_side_encryption = ""
│ 
╵
│ Error: expected acl to be one of ["private" "public-read" "public-read-write" "authenticated-read" "aws-exec-read" "bucket-owner-read" "bucket-owner-full-control"], got 
│ 
│   with aws_s3_object.e2e-e2e-kops-scenario-ipv6-terraform-test-cncf-aws-k8s-io-addons-bootstrap,
│   on kubernetes.tf line 1135, in resource "aws_s3_object" "e2e-e2e-kops-scenario-ipv6-terraform-test-cncf-aws-k8s-io-addons-bootstrap":
│ 1135:   acl                    = ""
│  

Also attempting to keep the generated terraform files in job artifacts for easier troubleshooting.

rifelpet commented 2 months ago

/test pull-kops-e2e-aws-terraform

rifelpet commented 2 months ago

Confirmed the file is being saved in artifacts and the fields are no longer set to empty strings:

https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kops/16818/pull-kops-e2e-aws-terraform/1832451965536178176/artifacts/terraform/kubernetes.tf

/cc @hakman

k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes/kops/blob/master/OWNERS)~~ [hakman] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment