-
Notifications
You must be signed in to change notification settings - Fork 102
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
Conversation
…ck for operator Signed-off-by: Thomas Runyon <runyontr@gmail.com>
Signed-off-by: Thomas Runyon <runyontr@gmail.com>
There was a problem hiding this 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 🚢
pkg/kudoctl/util/kudo/kudo.go
Outdated
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) |
There was a problem hiding this comment.
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):
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>
There was a problem hiding this 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?
@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. |
What this PR does / why we need it:
comparable functionality to checking Operator.