-
Notifications
You must be signed in to change notification settings - Fork 39
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
e2e test: unified the clients #177
e2e test: unified the clients #177
Conversation
fd371e1
to
0b6a254
Compare
pkg/deploymanager/subscription.go
Outdated
|
||
if !isReady { | ||
lastReason = "waiting on lvm catalog source pod to reach ready state" | ||
if existingCatalogSource.Status.GRPCConnectionState.LastObservedState != "READY" { |
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.
Is the cataogSource status equivalent to the pod status?
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.
Yes
pkg/deploymanager/subscription.go
Outdated
@@ -158,14 +139,15 @@ func (t *DeployManager) WaitForLVMOperator() error { | |||
|
|||
err := utilwait.PollImmediate(interval, timeout, func() (done bool, err error) { | |||
for _, name := range deployments { | |||
deployment, err := t.k8sClient.AppsV1().Deployments(InstallNamespace).Get(context.TODO(), name, metav1.GetOptions{}) | |||
existingdeployment := &appsv1.Deployment{} |
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.
This variable name need not be changed. It was checking for existing deployments earlier as well.
pkg/deploymanager/subscription.go
Outdated
if err != nil { | ||
return err | ||
} | ||
if len(operatorGroups.Items) > 1 { |
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.
The error checks are required.
pkg/deploymanager/subscription.go
Outdated
if err != nil && !errors.IsNotFound(err) { | ||
return err | ||
} | ||
|
||
} | ||
|
||
for _, catalogSource := range co.catalogSources { | ||
err := t.olmClient.OperatorsV1alpha1().CatalogSources(catalogSource.Namespace).Delete(context.TODO(), catalogSource.Name, metav1.DeleteOptions{}) | ||
catalogSource := catalogSource |
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 use a diff name for the inner loop var.
return t.lvmClient | ||
} | ||
|
||
func getKubeconfig(kubeconfig string) (*rest.Config, error) { |
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.
You can leave this function for better readibility.
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.
means to use the separate function for geting kubeconfig?
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.
Yes
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.
Updated that.
pkg/deploymanager/config.go
Outdated
lvmClient: lvmClient, | ||
parameterCodec: parameterCodec, | ||
crClient: crClient, | ||
Ctx: context.TODO(), |
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 remove the ctx from the deploymanager. Lets stick to context.TODO for now.
pkg/deploymanager/subscription.go
Outdated
}) | ||
err := utilwait.PollImmediate(interval, timeout, func() (done bool, err error) { | ||
existingCatalogSource := &v1alpha1.CatalogSource{} | ||
err = t.crClient.Get(t.Ctx, client.ObjectKeyFromObject(catalogsource), existingCatalogSource) |
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.
Why not just use the catalogSource name?
c77dc25
to
261d4f5
Compare
Updated the PR with all the changes. |
pkg/deploymanager/subscription.go
Outdated
@@ -97,7 +99,7 @@ func (t *DeployManager) generateClusterObjects(lvmCatalogImage string, subscript | |||
} | |||
|
|||
// Waiting for LVM catalog source. | |||
func (t *DeployManager) waitForLVMCatalogSource() error { | |||
func (t *DeployManager) waitForLVMCatalogSource(catalogsource *v1alpha1.CatalogSource) error { |
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.
It is enough to just pass the name of the catalogsource,
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.
Updated. Name is also not required now as we are following the previous method itself.
261d4f5
to
17fde94
Compare
pkg/deploymanager/subscription.go
Outdated
if err != nil { | ||
return err | ||
} | ||
// Wait for catalog source before posting subscription |
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.
Why has this been moved inside the for loop?
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 was passing catalog source as an argument to the waitForLVMCatalogSource call, so thats why did that. But now its of no use.
Shall I move it outside?
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.
Yes,please move it outside.
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.
Updated, thanks.
17fde94
to
155b142
Compare
fix: added volume snapshot api to e2e client scheme
replaced all clients with a controller runtime client. Signed-off-by: riya-singhal31 <[email protected]>
155b142
to
11dff04
Compare
@riya-singhal31: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nbalacha, riya-singhal31 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
replaced all clients with a controller runtime client.
Signed-off-by: riya-singhal31 [email protected]