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

You can't export variables with the same name across multiple packages #70

Closed
corang opened this issue Sep 19, 2023 · 2 comments
Closed
Assignees

Comments

@corang
Copy link
Contributor

corang commented Sep 19, 2023

Because of how uds-cli stores exported variables having 2 exports with the same variable name doesn't work since the next occurrence of an export overwrites the first one. Simplified version of erroring bundle below

kind: UDSBundle
metadata:
  name: software-factory-demo
  description: A UDS bundle for deploying a software factory to k3d for demonstration purposes NOT FOR PRODUCTION
  version: 0.0.2
  architecture: amd64

zarf-packages:
  - name: software-factory-idam-gitlab
    path: build
    ref: 1.0.0
    exports:
      - name: IDAM_ENABLED

  - name: software-factory-idam-sonarqube
    path: build
    ref: 1.0.0
    exports:
      - name: IDAM_ENABLED

  - name: gitlab
    repository: ghcr.io/defenseunicorns/uds-capability/gitlab
    ref: 0.0.9
    imports:
      - name: IDAM_ENABLED
        package: software-factory-idam-gitlab

  - name: sonarqube
    repository: ghcr.io/defenseunicorns/uds-capability/sonarqube
    ref: 0.0.8
    imports:
      - name: IDAM_ENABLED
        package: software-factory-idam-sonarqube

Error:

Failed to create bundle: error validating bundle vars: import var IDAM_ENABLED does not have a
             matching export
@UncleGedd
Copy link
Collaborator

@decleaver recommend looking into this as a followup to #422

@decleaver
Copy link
Collaborator

So with the latest uds-cli update, we now make all exported variables available to all packages in a bundle without requiring you to specify each import manually. In the case of a name collision, you can import the variable from the package that you want. https://github.com/defenseunicorns/uds-cli/blob/main/README.md#importingexporting-variables

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

No branches or pull requests

3 participants