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 helper function to check if OV exists in cluster #1571

Merged
merged 3 commits into from Jun 29, 2020
Merged

Conversation

runyontr
Copy link
Member

What this PR does / why we need it:

comparable functionality to checking Operator.

…ck for operator

Signed-off-by: Thomas Runyon <runyontr@gmail.com>
Signed-off-by: Thomas Runyon <runyontr@gmail.com>
Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please adjust the logging but otherwise 🚢

func (c *Client) OperatorVersionExistsInCluster(name, namespace string) bool {
operator, err := c.kudoClientset.KudoV1beta1().OperatorVersions(namespace).Get(name, v1.GetOptions{})
if err != nil {
clog.V(2).Printf("operatorversion.kudo.dev/%s does not exist\n", name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change the logging to namespace/name here and below (we try to consolidate all logging of objects to this format):

Suggested change
clog.V(2).Printf("operatorversion.kudo.dev/%s does not exist\n", name)
clog.V(2).Printf("operatorversion %s/%s does not exist\n", namespace, name)

Signed-off-by: Thomas Runyon <runyontr@gmail.com>
@runyontr runyontr merged commit 54b6175 into main Jun 29, 2020
@runyontr runyontr deleted the client-ov-exists branch June 29, 2020 11:24
Copy link
Member

@ANeumann82 ANeumann82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally ok with having this func here - although i'm not sure why it's added now. It doesn't seem to be used anywhere.

@runyontr Do you use KUDO as a lib and need that func, or what's the reason for this PR?

@runyontr
Copy link
Member Author

@ANeumann82, Yes I'm using KUDO as a library inside of the Terraform provider. Since there already existed a function for checking the existence of the Operator, adding a comparable function for the OV seemed to be in line. If the Operator check wasn't in the client, I don't think i would have added this function to KUDO proper, but for consistency sake it seemed okay.

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

3 participants