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

Unhelpful error message when provider configuration is missing #5401

Closed
stefreak opened this issue Nov 13, 2023 · 2 comments · Fixed by #6176
Closed

Unhelpful error message when provider configuration is missing #5401

stefreak opened this issue Nov 13, 2023 · 2 comments · Fixed by #6176

Comments

@stefreak
Copy link
Member

stefreak commented Nov 13, 2023

Bug

Current Behavior

When running garden deploy with one of the reproducable example configs below, I get

Error processing config for Deploy action test1:
Unrecognized action type 'helm' (defined at garden.yml). Are you missing a provider configuration?

Currently available action types: Build, Deploy, Run, Test

Expected behavior

I expect error messages similar to this:

Error validating Project 'repro':

...
34  |     environments:
35  |       - locall,
--------------^

providers[0][environments][0] with value "locall" refers to an environment that does not exist. Available environments: "local"

Or, if no such mistake is in the config and the kubernetes provider and the local environment are just not associated, then I expect an error like this:

Error processing config for Deploy action test1:
Unrecognized action type 'helm' (defined at garden.yml).

The 'helm' action type is provided by the 'kubernetes', 'local-kubernetes' and 'ephemeral-kubernetes' providers, but
the current environment 'local' is lacking the configuration for one of those providers. Consider adding a provider
configuration like so in your project-level configuration (project.garden.yml):

   providers:
     - name: kubernetes # Or local-kubernetes, or ephemeral-kubernetes
       environments: [local]

Reproducible example

apiVersion: garden.io/v1
kind: Project
name: repro
defaultEnvironment: local
environments:
  - name: local
    defaultNamespace: garden-local
providers:
  - name: local-kubernetes
    setupIngressController: false
    #environments: []
    environments:
      - locall
---
kind: Deploy
type: helm
name: test1
description: test

and also for this case the error could be improved:

apiVersion: garden.io/v1
kind: Project
name: repro
defaultEnvironment: local
environments:
  - name: local
    defaultNamespace: garden-local
providers:
  - name: local-kubernetes
    setupIngressController: false
    environments: []
---
kind: Deploy
type: helm
name: test1
description: test

Workaround

None

Suggested solution(s)

See expected behaviour

Additional context

Your environment

  • OS: macos
  • How I'm running Kubernetes: orbstack

garden version 0.13.19

@edvald
Copy link
Collaborator

edvald commented Nov 13, 2023

Also, Currently available action types: Build, Deploy, Run, Test is incorrect and that needs to fixed wherever we're displaying it. Actions kinds are mixed up with types here.

@stefreak
Copy link
Member Author

stefreak commented Nov 13, 2023

Yes, this likely happened during the removal of the error details (#5039).

The variable name misled us there:

Currently available action types: ${Object.keys(actionTypes).join(", ")}`,

thsig added a commit that referenced this issue Jun 11, 2024
Before this fix, we'd erroneously list the available action kinds
instead of the available action types (for the invalid action's kind).

Fixes #5401.
github-merge-queue bot pushed a commit that referenced this issue Jun 18, 2024
Before this fix, we'd erroneously list the available action kinds
instead of the available action types (for the invalid action's kind).

Fixes #5401.
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

Successfully merging a pull request may close this issue.

2 participants