Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct version pin to support 1.4+ and protect from upcoming provider v5 changes #396

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ rm -rf flux.tar.gz
# argocd
download_and_verify "https://github.com/argoproj/argo-cd/releases/download/v${argocd_version}/argocd-linux-amd64" "$argocd_checksum" "argocd-linux-amd64"
chmod +x ./argocd-linux-amd64
mv ./argocd-linux-amd64 /usr/local/bin/argocd
mv ./argocd-linux-amd64 /usr/local/bin/argocd
6 changes: 3 additions & 3 deletions terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
terraform {
required_version = "~> 1.3"
Copy link
Member Author

@bryantbiggs bryantbiggs Mar 19, 2023

Choose a reason for hiding this comment

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

The implementation version restriction further constrain the versions used when provisioning to avoid any surprises. This is different from the module level version constraint (see below)

The ~> puts an upper bound restriction, where this upper bound restriction shown here is preventing from automatically adopting a major version change, but will readily accept a minor and/or patch version change

Copy link
Contributor

Choose a reason for hiding this comment

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

We had opened this up to work with TF 1.4, would this prevent that?

Copy link

Choose a reason for hiding this comment

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

@niallthomson no, the ~> 1.3 allows the rightmost digit to be anything larger than 3.

Copy link
Member Author

@bryantbiggs bryantbiggs Mar 24, 2023

Choose a reason for hiding this comment

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

whoops - forgot about this. Yes, what @kevcube stated is correct


required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.46.0"
version = "~> 4.46"
}
}

required_version = ">= 1.3.7"
}

provider "aws" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/addons/descheduler/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.0.0"
required_version = ">= 1.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

Module version constraints are generally only restricted by their lower bound of their requirements, which makes them applicable to a broader range of versions for better adoption without version conflicts. The minimum requirement is derived from the features used, where language level features will raise the Terraform required version, and the provider version will be dictated by the most recent argument addition used across the resources created (i.e. - when was the argument added/updated per the CHANGELOG, this dictates the minimum required provider version)


required_providers {
kubernetes = {
Expand Down
3 changes: 2 additions & 1 deletion terraform/modules/cluster/providers.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
terraform {
required_version = ">= 1.3"

required_providers {
null = {
source = "hashicorp/null"
Expand Down Expand Up @@ -40,5 +42,4 @@ terraform {
version = ">= 1.7.0"
}
}
required_version = ">= 1.3.7"
}
5 changes: 3 additions & 2 deletions terraform/modules/ide/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
data "aws_region" "current" {}

terraform {
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.46.0"
version = ">= 4.46"
}
}
required_version = ">= 1.3.7"
}
2 changes: 1 addition & 1 deletion website/docs/automation/gitops/argocd/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Argo CD offers 2 ways to manage your application state:
* User Interface - A web-based UI that lets you do the same things that you can do with the CLI. It also lets you visualize the Kubernetes resources belongs to the Argo CD applications that you create.


<img src={require('./assets/argo-cd-architecture.png').default}/>
<img src={require('./assets/argo-cd-architecture.png').default}/>