feat: expose RemoteURL on KustomizationRefs#1882
Merged
Merged
Conversation
This PR adds `KustomizationRef.RemoteURL` letting a `KustomizationRef` fetch its content directly from an HTTP/HTTPS
endpoint or an OCI registry, without a Flux `GitRepository`/`OCIRepository`/`Bucket` or a `ConfigMap`/`Secret`.
Mirrors `PolicyRef.RemoteURL`
Unlike `PolicyRef.RemoteURL`'s OCI path (which flattens all `.yaml`/`.yml`/`.json` files across layers into one concatenated blob),
the new path preserves the fetched content's directory structure.
- `Namespace`/`Name`/`Kind` are now optional on `KustomizationRef` (required only when `RemoteURL` is unset), matching the `PolicyRef` precedent.
- Hashing and periodic re-fetch interval both extended to cover `RemoteURL`-based refs, same as they already do for `PolicyRef`.
```yaml
apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
name: kustomize-remoteurl-example
spec:
clusterSelector:
matchLabels:
env: fv
kustomizationRefs:
- remoteURL:
url: oci://ghcr.io/gianlucam76/sveltos-oci-kustomize-test:head
path: overlays/production
targetNamespace: production
```
Same content also works over plain HTTPS, pointing at any tarball URL (e.g. a GitHub archive):
```yaml
kustomizationRefs:
- remoteURL:
url: https://github.com/gianlucam76/kustomize/archive/refs/heads/main.tar.gz
path: kustomize-main/helloWorldWithOverlays/overlays/production
targetNamespace: production
```
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.
This PR adds
KustomizationRef.RemoteURLletting aKustomizationReffetch its content directly from an HTTP/HTTPS endpoint or an OCI registry, without a FluxGitRepository/OCIRepository/Bucketor aConfigMap/Secret. MirrorsPolicyRef.RemoteURLUnlike
PolicyRef.RemoteURL's OCI path (which flattens all.yaml/.yml/.jsonfiles across layers into one concatenated blob), the new path preserves the fetched content's directory structure.Namespace/Name/Kindare now optional onKustomizationRef(required only whenRemoteURLis unset), matching thePolicyRefprecedent.RemoteURL-based refs, same as they already do forPolicyRef.Same content also works over plain HTTPS, pointing at any tarball URL (e.g. a GitHub archive):