kubernetes-sigs / kustomize

Customization of kubernetes YAML configurations
Apache License 2.0
10.7k stars 2.22k forks source link

Add redirect support for resource loading #5675

Open abogdanov37 opened 2 months ago

abogdanov37 commented 2 months ago

Eschewed features

What would you like to have added?

I want to add an ability to use redirect in resource loading process. For example I have a git repo over special proxy which change branch to directory which contains kustomization.yaml In kustomization.yaml I have resources

resources:
  - https://proxy.org.com/project?ref=main

Proxy return http redirect to https://git.org.com/group/project.git?ref=main-client1

and kustomize load resources from that https://git.org.com/group/project.git?ref=main-client1 repo

To implement that I want to fix some code here https://github.com/kubernetes-sigs/kustomize/blob/2e6171a9ea9aa966479df41e230cfb6e3a0ca00f/api/internal/loader/fileloader.go#L320

Why is this needed?

It gives more flexiable resource management and exclude some plugins

Can you accomplish the motivating task without this feature, and if so, how?

I can't. Sorry.

What other solutions have you considered?

I try to return new kustomization.yaml from proxy with new resources link as

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - https://git.org.com/group/project.git?ref=main-client1

but it does not work because kustomize can use kustomization only from folder

This scenario repeat for components

Anything else we should know?

I think no

Feature ownership

koba1t commented 1 week ago

/triage accepted

koba1t commented 1 week ago

/assign abogdanov37