-
Notifications
You must be signed in to change notification settings - Fork 73
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
Don't use the ToolchainCluster.Spec fields #1054
Don't use the ToolchainCluster.Spec fields #1054
Conversation
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.
👍
/test publish-operators-for-e2e-tests |
@metlos: The specified target(s) for
Use In response to this:
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-sigs/prow repository. |
this is a GH action workflow. If you want to restart it, then go to the GH Actions UI and click on "re-run". However, the workflow is configured to automatically run also when you leave any of the following comments:
|
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.
👍
There is probably one small leftover: https://github.com/metlos/toolchain-e2e/blob/374daa079348432f62fd4da7a50e09946b46ad43/testsupport/wait/host.go#L1419
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MatousJobanek, metlos, mfrancisc, ranakan19 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 |
/retest |
Quality Gate passedIssues Measures |
clusters := &toolchainv1alpha1.ToolchainClusterList{} | ||
if err := a.Client.List(context.TODO(), clusters, client.InNamespace(a.Namespace), client.MatchingLabels{ | ||
"namespace": namespace, | ||
}); err != nil { | ||
if err := a.Client.List(context.TODO(), clusters, client.InNamespace(a.Namespace)); err != nil { | ||
return toolchainv1alpha1.ToolchainCluster{}, false, err | ||
} | ||
if len(clusters.Items) == 0 { | ||
t.Logf("no toolchaincluster resource with expected labels: namespace='%s'", namespace) | ||
} | ||
// assume there is zero or 1 match only | ||
for _, cl := range clusters.Items { | ||
if cd.IsTrue(cl.Status.Conditions, cdtype) { | ||
if cl.Status.OperatorNamespace == namespace && cd.IsTrue(cl.Status.Conditions, cdtype) { | ||
return cl, true, nil | ||
} | ||
} |
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.
btw, the message in the middle is not up-to-date anymore. Could be modified to:
func (a *Awaitility) GetToolchainCluster(t *testing.T, namespace string, cdtype toolchainv1alpha1.ConditionType) (toolchainv1alpha1.ToolchainCluster, bool, error) {
clusters := &toolchainv1alpha1.ToolchainClusterList{}
if err := a.Client.List(context.TODO(), clusters, client.InNamespace(a.Namespace)); err != nil {
return toolchainv1alpha1.ToolchainCluster{}, false, err
}
// assume there is zero or 1 match only
for _, tCluster := range clusters.Items {
if tCluster.Status.OperatorNamespace == namespace && cd.IsTrue(tCluster.Status.Conditions, cdtype) {
return tCluster, true, nil
}
}
t.Logf("no ToolchainCluster resource that would be ready and would contain Status.OperatorNamespace: '%s'", namespace)
return toolchainv1alpha1.ToolchainCluster{}, false, nil
Instead, use their replacements in the ToolchainCluster status. This will enable us to remove the fields from the spec and only rely on the kubeconfig (and the status fields that project the values out of the kubeconfig).