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

[feature] Improve the "get resource" experience #1656

Open
lblackstone opened this issue Jul 21, 2021 · 2 comments
Open

[feature] Improve the "get resource" experience #1656

lblackstone opened this issue Jul 21, 2021 · 2 comments
Labels
kind/enhancement Improvements or new features

Comments

@lblackstone
Copy link
Member

lblackstone commented Jul 21, 2021

Today, we provide .get methods for all Kubernetes resource types, as well as specialized getResource methods for Helm, YAML, and Kustomize components. These getters share the following limitations:

  1. No retry -- If the lookup fails, then an error is returned. This doesn't play nicely with resources created by an operator, for example.
  2. Unable to customize readiness check -- In some cases, the user may want to look up the current resource state without checking readiness. In other cases, it will be helpful to wait for the resource to be ready to make sure that all properties are populated. It's not currently possible to configure this behavior.
  3. Inconsistent UX between resource getters and getResource methods -- It would be helpful to have a unified way to get resources, regardless of how they were created.
  4. ID format is confusing to users -- We regularly get questions about how to get existing resources with our provider, so there's room to improve on the UX here.
  5. No fuzzy matching -- We don't support either globbing or label-based matching, which might be useful in some cases.

Proposal

While we already provide getters for every resource type in Kubernetes, it may be helpful to create a higher level "porcelain" getter to address the mentioned limitations. This might look something like this:

function GetResource(groupVersion: string, kind: string, name: string, namespace?: string, getOpts): pulumi.CustomResource {
// getOpts include parameters to configure retry and await behavior
}

Related issues:

#1177
#1238
#264
#305
#1673

@lblackstone lblackstone added the kind/enhancement Improvements or new features label Jul 21, 2021
@mikhailshilkov
Copy link
Member

We should consider if/how this applies to other providers too.

@akath19
Copy link

akath19 commented Aug 2, 2021

End user here, I've been using this for a while and I'd love to see the following features:

  • Globbing for names: Resource names sometimes are not fully known e.g: service-account-token-? or deployment-name-?, however, the root of the name e.g.: service-account-token, deployment-name is always known
  • ObjectState for metadata: Instead of having to craft a specialized ID or name, using ObjectState for the named object e.g.: SecretState, PodState and including required metadata there might make it easier and more aligned with creation patterns
  • Piping: Being able to accept get results as references for resource creation, a common pattern is searching for an object and using the object name or contents to create new objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

3 participants