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

🏃[e2e] clusterctl e2e discovery #2820

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR extends the e2e framework by adding the possibility to discover Cluster API objects existing in a management cluster.

This feature allows to:

  • implement pipelines that can work with any provider (discover installed providers)
  • implement pipelines that can work with cluster-templates that changes across providers (discover Cluster API objects created by the templates)

The PR also includes a utility for waiting for a controller deployment to get ready

Which issue(s) this PR fixes:
xref #2753
xref #2637
xref #2636

/assign @vincepri
/assign @sedefsavas
/cc @wfernandes
/cc @gab-satchi

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 30, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
/assign @sedefsavas
/milestone v0.3.4

@k8s-ci-robot k8s-ci-robot added this to the v0.3.4 milestone Mar 30, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, vincepri

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 30, 2020
Copy link

@sedefsavas sedefsavas left a comment

Choose a reason for hiding this comment

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

Minor comments, otherwise LGTM.


// WaitForDeploymentsAvailable waits until the Deployment has status.Available = True, that signals that
// all the desired replicas are in place.
func WaitForDeploymentsAvailable(ctx context.Context, input WaitForDeploymentsAvailableInput, intervals ...interface{}) {

Choose a reason for hiding this comment

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

nit. We can combine this with framework/workload_cluster.go

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved to framework/management_cluster.go which seems more appropriate, but the result is the same (no more controller.go file)

}

// GetKubeadmControlPlaneByCluster returns the KubeadmControlPlane objects for a cluster.
// Important! this method relies on labels that are created by the CAPI controllers during the first reconciliation, so

Choose a reason for hiding this comment

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

Can this rely on the owner ref, instead of labels?

Copy link
Member Author

Choose a reason for hiding this comment

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

AFAIK ownerRef can't be used as a filter option for List.
Additionally, also ownerRef are set by CPAI controller during first reconciliation, so the same note will apply no matter of the change

@fabriziopandini fabriziopandini force-pushed the add-clusterctl-e2e-discovery branch from 9418e1f to bbf11a9 Compare April 3, 2020 10:48
@fabriziopandini
Copy link
Member Author

@sedefsavas thanks for the feedback. comments addressed/answer provided

@sedefsavas
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 3, 2020
@k8s-ci-robot k8s-ci-robot merged commit 22db993 into kubernetes-sigs:master Apr 3, 2020
}
return false

}, intervals...).Should(BeTrue(), "Deployment %s/%s failed to get status.Available = True condition")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this have been a fmt.Sprintf("Deployment %s/%s failed to get status.Available = True condition", input.Deployment.GetNamespace(), input.Deployment.GetName())

Copy link
Member Author

Choose a reason for hiding this comment

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

@wfernandes good catch!
fixed by #2864

@fabriziopandini fabriziopandini deleted the add-clusterctl-e2e-discovery branch April 6, 2020 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants