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] Create a lookup operation #1034

Open
eddycharly opened this issue Mar 4, 2024 · 9 comments · May be fixed by #1089
Open

[Feature] Create a lookup operation #1034

eddycharly opened this issue Mar 4, 2024 · 9 comments · May be fixed by #1089
Assignees
Labels
enhancement New feature or request

Comments

@eddycharly
Copy link
Member

Create a lookup operation to read one or more resources from the cluster.

@eddycharly eddycharly added this to the v0.1.9 milestone Mar 4, 2024
@eddycharly eddycharly added the enhancement New feature or request label Mar 4, 2024
@siddhikhapare
Copy link
Contributor

/assign

@eddycharly
Copy link
Member Author

The purpose of this operation would be to read one (or more) resources from the cluster.

Then create outputs based on the retrieved resources.

I wonder if it would make sense to do that directly in assert and/or apply operations 🤔

@siddhikhapare
Copy link
Contributor

The purpose of this operation would be to read one (or more) resources from the cluster.

Then create outputs based on the retrieved resources.

I wonder if it would make sense to do that directly in assert and/or apply operations 🤔

I'll give it a try and see how it works out.

@eddycharly eddycharly linked a pull request Mar 9, 2024 that will close this issue
@eddycharly
Copy link
Member Author

@siddhikhapare i started working on this in #1089

@eddycharly eddycharly self-assigned this Mar 9, 2024
@siddhikhapare
Copy link
Contributor

@eddycharly I used this to read resources from cluster as helm have lookup function

type Lookup struct {
    // Timeout for the operation. Overrides the global timeout set in the Configuration.
    // +optional
    Timeout *metav1.Duration `json:"timeout,omitempty"`
    // Namespace defines the namespace in which to search for the resources.
    // +optional
    Namespace string `json:"namespace,omitempty"`
    // Labels defines the labels to filter the resources.
    // +optional
    Labels map[string]string `json:"labels,omitempty"`
    // Kind defines the kind of resources to retrieve.
    // +optional
    Kind string `json:"kind,omitempty"`
    // Name defines the name of the resource to retrieve.
    // +optional
    Name string `json:"name,omitempty"`
    // APIVersion defines the API version of the resource to retrieve.
    // +optional
    APIVersion string `json:"apiVersion,omitempty"`
    // Template determines whether resources should be considered for templating.
    // +optional
    Cluster string `json:"cluster,omitempty"`
    // Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
    // +optional
    Template *bool `json:"template,omitempty"`
    // DryRun determines whether the operation should be performed in dry run mode.
    // +optional
    DryRun *bool `json:"dryRun,omitempty"`
    // Expect defines a list of matched checks to validate the operation outcome.
    // +optional
    Expect []Expectation `json:"expect,omitempty"`
}

@eddycharly
Copy link
Member Author

@siddhikhapare the only thing i'm not sure about is how to deal with multiple resources (when working with labels for example)

@siddhikhapare
Copy link
Contributor

@siddhikhapare the only thing i'm not sure about is how to deal with multiple resources (when working with labels for example)

@eddycharly can we create function to search resources of cluster by labels which specified in a Lookup struct using labelSelector?
It may be not needed here. You have completed lookup operation only test are remaining.

@eddycharly
Copy link
Member Author

I'm still not sure how it will be useful, and we already have a get operation so 🤷
I think i will post pone to a later version until we find a use case for it.

@siddhikhapare
Copy link
Contributor

I'm still not sure how it will be useful, and we already have a get operation so 🤷 I think i will post pone to a later version until we find a use case for it.

Yeah, Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants