Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOLDER_PER_CHART_FILE_PER_RESOURCE does not respect dependency order #1239

Open
ameyp opened this issue Jun 9, 2023 · 1 comment
Open

FOLDER_PER_CHART_FILE_PER_RESOURCE does not respect dependency order #1239

ameyp opened this issue Jun 9, 2023 · 1 comment
Labels
bug Something isn't working effort/medium 1 week tops priority/p1 Should be on near term plans

Comments

@ameyp
Copy link

ameyp commented Jun 9, 2023

Description of the bug:

If I specify the YamlOutputType as FOLDER_PER_CHART_FILE_PER_RESOURCE for synth, I expect the resources in the folder created to be named in such a way as to honor their dependency order. However, the resources are created without an index prefix, and so will be applied in alphabetical order by kubectl/fluxcd/whatever.

I see two options:

  • Prefix the filenames with their index, I think this will work
  • (Better option IMO) Create a kustomize.yaml with a resources block that lists each file in order

Reproduction Steps:

class MyChart extends Chart {
    constructor(scope: Construct, id: string) {
        super(scope, id, {
            namespace: constants.databases.namespace
        });

        const resource1 = // ...create resource here
        const resource2 = // ...create resource here
        resource1.addDependency(resource2)
}

const app = new App({
    yamlOutputType: YamlOutputType.FOLDER_PER_CHART_FILE_PER_RESOURCE
});

const chart = new MyChart(app, 'mychart');
app.synth();

This will generate two files:

  • resource1.yaml
  • resource2.yaml

Which will be applied in that order, despite resource1 needing resource2 to be applied first.


This is 🐛 Bug Report

@ameyp ameyp added bug Something isn't working needs-triage Priority and effort undetermined yet labels Jun 9, 2023
@iliapolo
Copy link
Member

iliapolo commented Jun 1, 2024

@ameyp thanks for reporting this.

We should prefix the file names with an index, just like we do with charts. Generating a kustomize.yaml file is an option, but I prefer to avoid since it limits the way an application can be deployed.

@iliapolo iliapolo added effort/medium 1 week tops priority/p1 Should be on near term plans and removed needs-triage Priority and effort undetermined yet labels Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort/medium 1 week tops priority/p1 Should be on near term plans
Projects
None yet
Development

No branches or pull requests

2 participants