Skip to content

feat: expose RemoteURL on KustomizationRefs#1882

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:kustomize-oci
Jul 18, 2026
Merged

feat: expose RemoteURL on KustomizationRefs#1882
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:kustomize-oci

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

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.
  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):

    kustomizationRefs:
    - remoteURL:
        url: https://github.com/gianlucam76/kustomize/archive/refs/heads/main.tar.gz
      path: kustomize-main/helloWorldWithOverlays/overlays/production
      targetNamespace: production

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
```
@gianlucam76
gianlucam76 merged commit 4aa4d7f into projectsveltos:main Jul 18, 2026
18 of 20 checks passed
@gianlucam76
gianlucam76 deleted the kustomize-oci branch July 18, 2026 17:14
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

Successfully merging this pull request may close these issues.

1 participant