Skip to content

Conversation

@omertuc
Copy link
Contributor

@omertuc omertuc commented Jan 20, 2021

Tests that deployments have a single replica when openshift/enhancements#555 control plane topology is set to SingleReplica.

This enhancement is yet to be merged as well as the relevant behavior from the various operators, so this PR is in draft mode until then.

@omertuc omertuc marked this pull request as draft January 20, 2021 14:28
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2021
@omertuc omertuc force-pushed the single-node-test branch 2 times, most recently from c69f27d to fba0e91 Compare January 20, 2021 16:43
@omertuc
Copy link
Contributor Author

omertuc commented Jan 21, 2021

Thanks for the review, I've refactored the test -

  • Check only OpenShift namespaces deployments
  • Use proper client rather than oc
  • Mechanism to differentiate between infra deployments and control plane deployments

Caveats

  • Since I'm now using openshift/api lib directly (no oc cli) it directly depends on the Cluster High-availability Mode API enhancements#555 PR and it has to be merged for the ControlPlaneTopology and InfrastructureTopology fields to appear, so this will not compile unless you use go.mod replace github.com/openshift/api to github.com/ravidbro/api at 68bddd86a7957a2c9a13356245ec0a05967b1000

}
}

func isAllowedToFail(deployment appsv1.Deployment) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment explaining these special cases would be useful for future reference

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Will add one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in 395d469

func getNamespaceDeployments(f *e2e.Framework, namespace corev1.Namespace) []appsv1.Deployment {
list, err := f.ClientSet.AppsV1().Deployments(namespace.Name).List(context.Background(), metav1.ListOptions{})
Expect(err).NotTo(HaveOccurred())

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return list.Items

You're not doing any filtering here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, no filtering. The loop looks ridiculous because it's leftover after some modifications I did that made it obsolete. Will fix. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 0debdeb

} else {
if replicas == 1 {
t := GinkgoT()
t.Logf("Deployment %s in namespace %s has one replica, consider taking it off the topology allow-list",
Copy link
Contributor

Choose a reason for hiding this comment

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

Who are we really expecting will react to this message?

Copy link
Contributor Author

@omertuc omertuc Feb 4, 2021

Choose a reason for hiding this comment

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

It's intended mostly for me. We slowly want to remove operators from that list until it's empty, and it'll be helpful for me to see that message in the logs. It'll be removed once we finally get rid of this list

@openshift-ci-robot openshift-ci-robot added the vendor-update Touching vendor dir or related files label Feb 8, 2021
@omertuc omertuc marked this pull request as ready for review February 8, 2021 19:33
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 8, 2021
@omertuc omertuc marked this pull request as draft February 8, 2021 19:36
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 8, 2021
@omertuc omertuc marked this pull request as ready for review February 9, 2021 08:31
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 9, 2021
var _ = Describe("[sig-arch] Cluster topology single node tests", func() {
f := e2e.NewDefaultFramework("single-node")

It("Verify that all OpenShift namespaces deployments take control plane topology into account", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Verify that OpenShift components deploy one replica in single node mode

Copy link
Contributor

Choose a reason for hiding this comment

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

what is "all" ?

Copy link
Contributor Author

@omertuc omertuc Feb 9, 2021

Choose a reason for hiding this comment

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

what is "all" ?

All deployments defined inside openshift-* namesapces

Copy link
Contributor Author

@omertuc omertuc Feb 9, 2021

Choose a reason for hiding this comment

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

Re-phrased to "Verify that OpenShift components deploy one replica in SingleReplica topology mode" since it's not called single-node in the API topology enum

@romfreiman
Copy link

/retest

2 similar comments
@romfreiman
Copy link

/retest

@romfreiman
Copy link

/retest

@romfreiman
Copy link

/test e2e-aws-fips

Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

What about statefulsets? For OpenShift monitoring, we deploy statefulsets for Prometheus, Alertmanager and Thanos ruler (optional).

@omertuc
Copy link
Contributor Author

omertuc commented Feb 10, 2021

What about statefulsets? For OpenShift monitoring, we deploy statefulsets for Prometheus, Alertmanager and Thanos ruler (optional).

Right, considered testing those and forgot about that. Will add them to the test.

EDIT: I think it's best if I add statefulsets in a future PR, I prefer that this gets merged first.

@omertuc
Copy link
Contributor Author

omertuc commented Feb 10, 2021

/retest

@omertuc
Copy link
Contributor Author

omertuc commented Feb 10, 2021

/assign @mfojtik

Please approve

@romfreiman
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2021
@mfojtik
Copy link
Contributor

mfojtik commented Feb 10, 2021

/approve

@smarterclayton isnt there smarter way to "tag" these tests as single node and only run them in single node job?

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mfojtik, omertuc, romfreiman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 10, 2021
@omertuc
Copy link
Contributor Author

omertuc commented Feb 10, 2021

Why is the merge blocked: Pending — Not mergeable. Job ci/prow/e2e-gcp-builds has not succeeded. ?

e2e-gcp-builds is always_run: false so I'm not sure why is it even running? And why can something be both always_run: false and optional: false?

What can I do about this?

@romfreiman
Copy link

/test e2e-gcp-builds

@romfreiman
Copy link

/test e2e-gcp-csi

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit c8eb62d into openshift:master Feb 11, 2021
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. lgtm Indicates that a PR is ready to be merged. vendor-update Touching vendor dir or related files

Projects

None yet

Development

Successfully merging this pull request may close these issues.