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

[Bug]: v2.3.0 breaks support for Windows OS #693

Closed
1 task done
philip-harvey opened this issue May 17, 2024 · 10 comments
Closed
1 task done

[Bug]: v2.3.0 breaks support for Windows OS #693

philip-harvey opened this issue May 17, 2024 · 10 comments

Comments

@philip-harvey
Copy link

Describe the bug

Since the release of v2.3.0 #689 Flux no longer works on Windows OS.

Steps to reproduce

terraform plan or apply

Expected behavior

Flux works on Windows OS, as it did previously.

Screenshots and recordings

Error: Getting expected repository files

│ with module.flux-transitions-gke.flux_bootstrap_git.flux,
│ on ....\modules\flux-gke\main.tf line 24, in resource "flux_bootstrap_git" "flux":
│ 24: resource "flux_bootstrap_git" "flux" {

│ could not generate install manifests: CreateFile \gotk-components.yaml: The specified path is invalid.

Rolling back to v2.2.3 resolved the issue.

Terraform and provider versions

Terraform v1.8.3 on windows_amd64

Terraform provider configurations

provider "flux" {
alias = "transitions"
kubernetes = {
host = "https://${google_dns_record_set.transitions_gke_master.rrdatas.0}"
cluster_ca_certificate = base64decode(module.transitions-cluster.ca_certificate)
token = data.google_client_config.provider.access_token
}
git = {
url = module.flux-transitions-github.url
ssh = {
username = "git"
private_key = module.flux-transitions-github.ssh_private_key
}
}
}

flux_bootstrap_git resource

resource "flux_bootstrap_git" "flux" {
path = var.target_path
kustomization_override = local.kustomize_file
namespace = var.namespace
cluster_domain = var.cluster_domain
}

locals {
kustomize_file = templatefile("${path.module}/templates/kustomization.yaml.tmpl", {
gcp_service_account = resource.google_service_account.flux_sops.email,
nodepool = var.nodepool,
namespace = var.namespace
})
k8s_kustomize_sa_gcp_derived_name = "serviceAccount:${var.project_id}.svc.id.goog[${var.namespace}/kustomize-controller]"
}

Flux version

2.3.0

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Would you like to implement a fix?

None

@swade1987
Copy link
Member

@philip-harvey did you just upgrade from version 2.2.3 to 2.3.0 with no changes and terraform apply failed?

@swade1987 swade1987 added the request for feedback Feedback is requested from users label May 18, 2024
@philip-harvey
Copy link
Author

@philip-harvey did you just upgrade from version 2.2.3 to 2.3.0 with no changes and terraform apply failed?

Yes, the exact same terraform fails the plan/apply as soon as the provider is upgraded to 2.3.0 and works again as soon as the provider is downgraded to 2.2.3 again, so it's definitely a provider issue.

@stefanprodan
Copy link
Member

Verifying if this issue is specific to Windows will help us narrow down the problem.

The error message is quite telling, the path is for Windows \gotk-components.yaml Unix uses /

@philip-harvey
Copy link
Author

Verifying if this issue is specific to Windows will help us narrow down the problem.

The error message is quite telling, the path is for Windows \gotk-components.yaml Unix uses /

Yes, the issue is specific to Windows and is new in 2.3.0. 2.3.0 works on Linux OS but not on Windows OS.

@swade1987
Copy link
Member

I think what @stefanprodan showed above is spot on; it's the \ versus / issue.

@philip-harvey
Copy link
Author

philip-harvey commented May 21, 2024

I think what @stefanprodan showed above is spot on; it's the \ versus / issue.

Understood, but I can't see what in the 2.3.0 release is breaking the path on Windows, it was working correctly in prior versions.

@swade1987
Copy link
Member

swade1987 commented May 21, 2024

We have changed from

installManifests, err := install.Generate(installOpts, "")

To the following ...

manifestsBase := ""
if data.EmbeddedManifests.ValueBool() {
  manifestsBase = EmbeddedManifests
}

installManifests, err := install.Generate(installOpts, manifestsBase)

This was for the work to allow air-gapped installations.

@philip-harvey please try adding embedded_manifests = true to our flux_bootstrap_git resource and see if that helps please. As your setup is similar to this example.

@philip-harvey
Copy link
Author

We have changed from

installManifests, err := install.Generate(installOpts, "")

To the following ...

manifestsBase := ""
if data.EmbeddedManifests.ValueBool() {
  manifestsBase = EmbeddedManifests
}

installManifests, err := install.Generate(installOpts, manifestsBase)

This was for the work to allow air-gapped installations.

@philip-harvey please try adding embedded_manifests = true to our flux_bootstrap_git resource and see if that helps please. As your setup is similar to this example.

Setting embedded_manifests = true seems to work around the issue, thanks for the suggestion

@brokenjacobs
Copy link

are there any future issues with embedded_manifests not being in sync with github?

@stefanprodan
Copy link
Member

stefanprodan commented May 22, 2024

are there any future issues with embedded_manifests not being in sync with github?

There are no issues, this is how the Flux CLI works by default. Every time we release Flux, we also release a new provider version that embeds the latest manifests. It is recommend to enable embedded_manifests and drive the upgrade by bumping the provider version.

@swade1987 swade1987 removed the request for feedback Feedback is requested from users label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants