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

Improve error handling for List resources #2493

Merged
merged 6 commits into from
Jul 14, 2023
Merged

Conversation

lblackstone
Copy link
Member

@lblackstone lblackstone commented Jul 13, 2023

Proposed changes

List resources are included in the SDK for compatibility with various YAML manifests and Helm charts. These resources are not currently able to be created directly, but the failure condition was not handled explicitly. Instead, users would get an error when the provider failed to determine if the resource was namespaced. This is fixed with the following changes:

  1. Create a lookup table for known List resources
  2. Return an error during Check for List resources with a descriptive error message

This change also adds a few missing kinds to the Namespaced lookup table that have been added since the table was created initially.

Related issues (optional)

Fix #1045
Related to #2494

@lblackstone lblackstone requested a review from a team July 13, 2023 20:27
@lblackstone lblackstone marked this pull request as draft July 13, 2023 20:30
@github-actions
Copy link

Does the PR have any schema changes?

Found 2 breaking changes:
Resource "kubernetes:helm.sh/v2:Chart" missing
Type "kubernetes:helm.sh/v2:FetchOpts" missing
No new resources/functions.

@lblackstone lblackstone changed the title Fix Namespaced method Improve error handling for List resources Jul 13, 2023
@lblackstone lblackstone marked this pull request as ready for review July 13, 2023 21:25
f1e790b caused TestKustomizeHelmChart to start failing, which is likely related to #2495. Updated the test to use a random prefix rather than a Namespace + transformation, which seems to work.
The Namespaced method is used to determine whether a resource is namespace or cluster scoped. The underlying lookup table was out of date and did not include "List" kinds. Fixed both of these issues.
provider/pkg/provider/provider.go Outdated Show resolved Hide resolved
@lblackstone lblackstone merged commit f2d1f50 into v4 Jul 14, 2023
18 checks passed
@lblackstone lblackstone deleted the lblackstone/is-namespaced branch July 14, 2023 14:03
lblackstone added a commit that referenced this pull request Jul 14, 2023
List resources are included in the SDK for compatibility with various YAML manifests and Helm charts. These resources are not currently able to be created directly, but the failure condition was not handled explicitly. Instead, users would get an error when the provider failed to determine if the resource was namespaced. This is fixed with the following changes:

1. Create a lookup table for known List resources
2. Return an error during Check for List resources with a descriptive error message

This change also adds a few missing kinds to the Namespaced lookup table that have been added since the table was created initially.
lblackstone added a commit that referenced this pull request Jul 14, 2023
List resources are included in the SDK for compatibility with various YAML manifests and Helm charts. These resources are not currently able to be created directly, but the failure condition was not handled explicitly. Instead, users would get an error when the provider failed to determine if the resource was namespaced. This is fixed with the following changes:

1. Create a lookup table for known List resources
2. Return an error during Check for List resources with a descriptive error message

This change also adds a few missing kinds to the Namespaced lookup table that have been added since the table was created initially.
lblackstone added a commit that referenced this pull request Jul 17, 2023
List resources are included in the SDK for compatibility with various YAML manifests and Helm charts. These resources are not currently able to be created directly, but the failure condition was not handled explicitly. Instead, users would get an error when the provider failed to determine if the resource was namespaced. This is fixed with the following changes:

1. Create a lookup table for known List resources
2. Return an error during Check for List resources with a descriptive error message

This change also adds a few missing kinds to the Namespaced lookup table that have been added since the table was created initially.
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 this pull request may close these issues.

None yet

2 participants