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

Add ability to pass in manifest inputs into the "aspirate generate" command. #274

Open
1 task
pseudosma opened this issue Dec 23, 2024 · 0 comments · May be fixed by #277
Open
1 task

Add ability to pass in manifest inputs into the "aspirate generate" command. #274

pseudosma opened this issue Dec 23, 2024 · 0 comments · May be fixed by #277

Comments

@pseudosma
Copy link

🚀 Feature Description

Some manifests require user input. If you run aspirate generate --non-interactive, the command will fail with this error:

── Handling Inputs ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
(!) Cannot obtain non-generated values for inputs in non-interactive mode. Inputs are required according to the manifest.
(1): Aspirate will now exit.

There should be a way to handle these manifests in non-interactive mode without needing to force an error.

🧰 Possible Solution

  • Allow extra arguments in the aspirate generate command to be used as inputs for specific fields, for example the set flag could be used:
    --set Username=myUsername
    It would be on the user to figure out what fields they need to add, there just needs to be a mechanism to allow them to be set in non-interactive mode.

✔ Goals

  • There should be a way to pre-define inputs for manifests that require inputs to be able to use non-interactive mode with those types of libraries.

💼 Business Case

Last week I began using the Aspire.Hosting.RabbitMQ library with my .Net Aspire app and I noticed that this cannot run in non-interactive mode because the manifest calls for inputs.

I've been using this command for CI/CD tools. My current workflow doesn't have the manifest.json file committed to the repo; it's just generated on-the-fly during the build + deployment:
aspirate generate --output-format helm --non-interactive --secret-password $SECRET_VALUE --with-dashboard --image-pull-policy IfNotPresent

I'd like to just be able to set the needed inputs upfront, so the values that Aspire.Hosting.RabbitMQ ask for can be handled by CI/CD tools.

For reference, this is the section of the manifest.json file associated to Aspire.Hosting.RabbitMQ. The username and password values are required :

    "Username": {
      "type": "parameter.v0",
      "value": "{Username.inputs.value}",
      "inputs": {
        "value": {
          "type": "string"
        }
      }
    },
    "Password": {
      "type": "parameter.v0",
      "value": "{Password.inputs.value}",
      "inputs": {
        "value": {
          "type": "string",
          "secret": true
        }
      }
    },
    "rabbitmq": {
      "type": "container.v0",
      "connectionString": "amqp://{Username.value}:{Password.value}@{rabbitmq.bindings.tcp.host}:{rabbitmq.bindings.tcp.port}",
      "image": "docker.io/library/rabbitmq:4.0-management",
      "volumes": [
        {
          "name": "MyApp.AppHost-rabbitmq-data",
          "target": "/var/lib/rabbitmq",
          "readOnly": false
        }
      ],
      "env": {
        "RABBITMQ_DEFAULT_USER": "{Username.value}",
        "RABBITMQ_DEFAULT_PASS": "{Password.value}"
      },
dombrovsky pushed a commit to dombrovsky/aspirational-manifests that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant