akuity / kargo-render

Tool and library for managing rendered, environment-specific branches
Apache License 2.0
42 stars 15 forks source link

Support of kustomize remotebase / git submodule #232

Open dan1el-k opened 6 months ago

dan1el-k commented 6 months ago

Issue

Currently kargo-render uses a flag --load-restrictor LoadRestrictionsRootOnly in case of kustomize, which actually blocks the usage of kustomize remote bases or kustomize remote components.

#kargo-render.yaml
configVersion: v1alpha1
branchConfigs:
- name: stage/dev
  appConfigs:
    demo:
      configManagement:
        kustomize:
          path: stages/dev
      outputPath: demo
#stages/dev/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

## Remote Components
resources:
  - https://gh-enterprise.com/org/kargo-demo-kustomize.git//stages/dev-remote?ref=HEAD
#components:
#  - https://gh-enterprise.com/org/kargo-demo-kustomize.git//stages/dev-remote?ref=HEAD

Error

time="2024-01-03T11:35:09Z" level=error msg="error executing Promotion: error executing Git-based promotion mechanisms: error executing Kargo Render promotion mechanisms: error rendering manifests for git repo \"https://gh-enterprise.com/org/kargo-demo-service\" via Kargo Render: error rendering manifests: error executing cmd [/usr/local/bin/kargo-render render --repo https://gh-enterprise.com/org/kargo-demo-service --ref  --target-branch stage/dev --repo-username cortex-bot --output json --image artifacts.rbi.tech/docker/org/cortex-template-kustomize-application/nginx:2023.52.13]: Error: error pre-rendering manifests: error generating manifests using Argo CD repo server: `kustomize build /tmp/1395234519/repo/stages/dev --load-restrictor LoadRestrictionsRootOnly` failed exit status 1: Error: accumulating resources: accumulating resources from 'https://gh-enterprise.com/org/kargo-demo-kustomize.git//stages/dev-remote?ref=HEAD': MalformedYAMLError: yaml: line 175: mapping values are not allowed in this context in File: https://gh-enterprise.com/org/kargo-demo-kustomize.git//stages/dev-remote?ref=HEAD\n" freight=4fadca4b6a0c9f671f143df43e50272e9201083c namespace=kargo-demo-service promotion=dev.01hk7hp6sf8hpq1q7ektcrfjsf.4fadca4 stage=dev

Proposal

krancour commented 6 months ago

Hi @dan1el-k. I think #201 may have addressed this by, among other things, allowing users to pass whatever flags they want to the Argo CD repo server (which is actually invoked more as a library here).

Although merged, this just has not been released yet because it's a large breaking change that is not yet documented.

dan1el-k commented 6 months ago

Hi @dan1el-k. I think #201 may have addressed this by, among other things, allowing users to pass whatever flags they want to the Argo CD repo server (which is actually invoked more as a library here).

Although merged, this just has not been released yet because it's a large breaking change that is not yet documented.

Ahh, now it makes sense. In our tests we were wondering that the CRDs are not really matching the docs as well as the argocd-schema.json + schema.json.

Looking forward to test the new release then :). Thanks !!

krancour commented 6 months ago

@dan1el-k I just cut v0.1.0-rc.34, but it's not integrated into "Kargo proper" yet.

dan1el-k commented 5 months ago

@dan1el-k I just cut v0.1.0-rc.34, but it's not integrated into "Kargo proper" yet.

@krancour, just saw two weeks ago kargo 0.3.2 were release. And also begin of January v0.1.0-rc.34 were merged to main. https://github.com/akuity/kargo/commit/de1afba0f4d199c34da44aedaddb042596ebcb6d When do you plan including it into the release ?