Skip to content

Add script validation for Terraform#1732

Merged
k8s-ci-robot merged 1 commit intokubernetes:mainfrom
ameukam:tf-validate
Mar 12, 2021
Merged

Add script validation for Terraform#1732
k8s-ci-robot merged 1 commit intokubernetes:mainfrom
ameukam:tf-validate

Conversation

@ameukam
Copy link
Member

@ameukam ameukam commented Feb 27, 2021

Download terraform and validate Terraform configuration for
a given path assuming terraform files are presen in this path.

Signed-off-by: Arnaud Meukam ameukam@gmail.com

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 27, 2021
@k8s-ci-robot k8s-ci-robot added wg/k8s-infra size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 27, 2021
@ameukam
Copy link
Member Author

ameukam commented Feb 27, 2021

The presubmit job will have a command like:

hack/verify-terraform.sh infra/gcp/clusters/projects/k8s-infra-prow-build/prow-build

@ameukam
Copy link
Member Author

ameukam commented Feb 27, 2021

/hold
/assign @spiffxp
cc @BenTheElder @thockin

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 27, 2021
exit 1
fi

TERRAFORM_ZIP="terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather this work on my laptop too.

I think a version check and erroring out if it doesn't exist/match would be a good start. Let the developer work out how to get the correct version, and assume when this runs in a container it will have the correct version already installed

Handy for managing locally, maybe useful to allow CI to auto-install / switch:

  • tfenv + .terraform-version files fit a pattern I know , but it's lots of bash
  • tfswitch uses version.tf files which could be another option

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go for tfswitch since it supports version.tf.

Download terraform and validate Terraform configuration for
a given path assuming terraform files are present in this path.

Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
@nikhita
Copy link
Member

nikhita commented Mar 9, 2021

/test pull-k8sio-verify

@nikhita
Copy link
Member

nikhita commented Mar 9, 2021

For the record - verify-terraform.sh was excluded in #1770 so pull-k8sio-verify does not run this script.

Copy link
Contributor

@spiffxp spiffxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 9, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ameukam, spiffxp

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
@ameukam
Copy link
Member Author

ameukam commented Mar 12, 2021

/remove hold

1 similar comment
@ameukam
Copy link
Member Author

ameukam commented Mar 12, 2021

/remove hold

@ameukam
Copy link
Member Author

ameukam commented Mar 12, 2021

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit 7bbc1cb into kubernetes:main Mar 12, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants