fix(kustomize): vendor kured manifest via data.http to avoid github.com release-asset URL bug#2186
Open
volade wants to merge 1 commit into
Open
Conversation
…om release-asset URL bug Kustomize >=5 mis-detects URLs of the form `https://github.com/{owner}/{repo}/releases/download/.../X.yaml` as git repository sources, refuses to fetch them as plain files, and fails the post-install hook (`kubectl apply -k /var/post_install`) with: accumulating resources from 'https://github.com/kubereboot/kured/releases/download/X/kured-X-combined.yaml': URL is a git repository Existing locals.tf::kustomization_backup_yaml referenced the kured release asset directly. Switch to fetching the manifest server-side at plan time via a new `data "http" "kured_manifest"` (which transparently follows the github.com release-asset 302), upload it to /var/post_install/kured-base.yaml via a `provisioner "file"` in the `terraform_data.kustomization` resource, and reference it by file name from the kustomization's resources list. The existing kured.yaml patch overlay (`local.kured_options` -> DaemonSet container args) is unchanged. No new variables; no behavioural change for users — `var.kured_version`, `local.kured_yaml_suffix`, and the `data.http.kured_release` lookup all continue to determine which kured version is fetched. The same `https://github.com/.../releases/download/...` pattern is also used for hetzner CCM and rancher system-upgrade-controller in the same kustomization. They could be migrated identically in follow-up PRs if this one lands; left out here to keep the change minimal and reviewable.
Contributor
There was a problem hiding this comment.
Code Review
This pull request modifies the deployment of kured by fetching its manifest via a Terraform http data source and uploading it as a local file to avoid Kustomize >= 5 mis-detecting GitHub URLs as git repositories. Feedback indicates that the terraform_data resource should include a hash of the manifest content in its triggers_replace block to ensure updates are applied to existing clusters. Furthermore, it is recommended to vendor the system-upgrade-controller manifests as well, as they follow the same URL pattern and may cause similar failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
`kustomize` >=5 mis-detects URLs of the form `https://github.com/{owner}/{repo}/releases/download/.../X.yaml\` as git repository sources, refuses to fetch them as plain files, and fails the post-install hook (`kubectl apply -k /var/post_install`) with:
```
accumulating resources from
'https://github.com/kubereboot/kured/releases/download/X/kured-X-combined.yaml':
URL is a git repository
```
This blocks every `terraform apply` that triggers a `terraform_data.kustomization` recreate (e.g. nodepool changes that mutate helm values, source / module bumps), making downstream cluster work intermittently impossible.
The current `locals.tf::kustomization_backup_yaml` references the kured release asset directly, so any cluster running on a recent k3s ships a `kubectl` whose bundled kustomize trips this case. Hit on a real cluster today.
What
The existing `kured.yaml` patch overlay (`local.kured_options` → DaemonSet container args) is unchanged.
Behaviour
Diff size
3 files, +28 / -1 lines. Reviewable in a minute.
Follow-up (intentionally out of scope)
The same `https://github.com/.../releases/download/...\` pattern appears for:
They could be migrated identically. Left out here to keep this PR minimal and reviewable; happy to open follow-up PRs if this approach is accepted.
Test plan