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

Add PriorityClass setting to registry pods for CatalogSource via annotations #2304

Merged

Conversation

dinhxuanvu
Copy link
Member

@dinhxuanvu dinhxuanvu commented Jul 30, 2021

The registry pods may need to have necessary priorityclass settings.
OLM will set the priorityclass setting for registry pods by using
the priorityclass annotations in the catalogsources.

Signed-off-by: Vu Dinh vudinh@outlook.com

Description of the change:

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive

@openshift-ci
Copy link

openshift-ci bot commented Jul 30, 2021

@dinhxuanvu: This pull request references Bugzilla bug 1954869, which is valid. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @jianzhangbjz

In response to this:

Bug 1954869: Add PriorityClass setting to registry pods for default CatalogSource

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.

@openshift-ci openshift-ci bot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jul 30, 2021
@openshift-ci
Copy link

openshift-ci bot commented Jul 30, 2021

@openshift-ci[bot]: GitHub didn't allow me to request PR reviews from the following users: jianzhangbjz.

Note that only operator-framework members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

@dinhxuanvu: This pull request references Bugzilla bug 1954869, which is valid. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @jianzhangbjz

In response to this:

Bug 1954869: Add PriorityClass setting to registry pods for default CatalogSource

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.

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.

pkg/controller/registry/reconciler/grpc.go Outdated Show resolved Hide resolved
pkg/controller/registry/reconciler/reconciler.go Outdated Show resolved Hide resolved
pkg/controller/registry/reconciler/grpc.go Show resolved Hide resolved
pkg/controller/registry/reconciler/reconciler.go Outdated Show resolved Hide resolved
pkg/controller/registry/reconciler/reconciler.go Outdated Show resolved Hide resolved
@timflannagan timflannagan changed the title Bug 1954869: Add PriorityClass setting to registry pods for default CatalogSource Add PriorityClass setting to registry pods for default CatalogSource Jul 30, 2021
@openshift-ci openshift-ci bot removed bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jul 30, 2021
@openshift-ci
Copy link

openshift-ci bot commented Jul 30, 2021

@dinhxuanvu: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

In response to this:

Add PriorityClass setting to registry pods for default CatalogSource

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.

@timflannagan
Copy link
Contributor

(I removed the bug from the PR title so automation doesn't pick this up once it merges)

@timflannagan
Copy link
Contributor

I think this implementation looks reasonable to me - I'd like to remove any downstream-specific handling here and just treat propagating priorityclass specifications into the catalogsource pods like Joe had eluded to in another comment.

@dinhxuanvu
Copy link
Member Author

Resolved and updated.

The registry pods may need to have necessary priorityclass settings.
OLM will set the priorityclass setting for registry pods by using
the priorityclass annotations in the default catalogsources.

Signed-off-by: Vu Dinh <vudinh@outlook.com>
@dinhxuanvu dinhxuanvu changed the title Add PriorityClass setting to registry pods for default CatalogSource Add PriorityClass setting to registry pods for CatalogSource via annotations Jul 30, 2021
priorityclass: "system-cluster-critical",
},
{
testName: "Grpc/WithInvalidPriorityClassAnnotation",
Copy link
Contributor

Choose a reason for hiding this comment

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

(not blocking) Technically not invalid but we won't propagate any empty key value to the priorityclass default.

require.Len(t, outPods.Items, 1)
outPod := outPods.Items[0]
require.Equal(t, tt.priorityclass, outPod.Spec.PriorityClassName)
require.Equal(t, pod.GetLabels()[PodHashLabelKey], outPod.GetLabels()[PodHashLabelKey])
Copy link
Contributor

Choose a reason for hiding this comment

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

Not super concerned with blindingly indexing like this, but it might produce test flakes down the line.

@timflannagan
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2021
@@ -171,15 +171,16 @@ func (c *GrpcRegistryReconciler) currentUpdatePods(source grpcCatalogSourceDecor
return pods
}

func (c *GrpcRegistryReconciler) currentPodsWithCorrectImage(source grpcCatalogSourceDecorator) []*corev1.Pod {
func (c *GrpcRegistryReconciler) currentPodsWithCorrectImageAndSpec(source grpcCatalogSourceDecorator, saName string) []*corev1.Pod {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not technically what I had in mind but works for now 😆

@kevinrizza
Copy link
Member

/approve

@openshift-ci
Copy link

openshift-ci bot commented Aug 3, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, kevinrizza

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2021
@openshift-ci openshift-ci bot merged commit 4fc476f into operator-framework:master Aug 3, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants