Closed stefanprodan closed 4 weeks ago
@swade1987 it would be great if you could test this PR on your clusters, especially the kubeconfig validation during planning.
@stefanprodan I'll take this for a spin next week and keep you posted.
@swade1987 it would be great if you could test this PR on your clusters, especially the kubeconfig validation during planning.
Looking good @stefanprodan
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Get "https://xxxx/api/v1/namespaces/flux-system": dial tcp: lookup XXXX: no such host
│
│ with kubernetes_namespace.flux_system,
│ on main.tf line 67, in resource "kubernetes_namespace" "flux_system":
│ 67: resource "kubernetes_namespace" "flux_system" {
│
╵
Changing the git branch works as well (as long as the branch exists in GitHub) (see below)
provider "flux" {
kubernetes = {
host = kind_cluster.this.endpoint
client_certificate = kind_cluster.this.client_certificate
client_key = kind_cluster.this.client_key
cluster_ca_certificate = kind_cluster.this.cluster_ca_certificate
}
git = {
url = "ssh://git@github.com/${var.github_org}/${var.github_repository}.git"
branch = "test-branch"
ssh = {
username = "git"
private_key = tls_private_key.flux.private_key_pem
}
}
}
Ran terraform apply
then ...
flux export source git flux-system | grep branch
branch: test-branch
LGTM @stefanprodan, I ran a number of tests locally and things look good.
This PR implements Flux readiness checks and drift detection for the cluster state. The provider applies changes to the Flux components and GitRepository/Kustomization manifests on the cluster, thus enabling changes to Git URL and branch to be actuated. It also adds a check for verifying the kubeconfig during planning phase.
Description
Changes:
path
field in the same way the CLI does it (breaking change).Motivation and Context
Being able to update Flux in the cluster by detecting drift in the cluster state during planning and apply.
Fix: #500 Fix: #656 Fix: #653 Fix: #564 Fix: #176 Fix: #499
How has this been tested?
Manual testing for:
Types of changes
Documentation
make docs
Checklist:
git commit -s