Skip to content

feat: update catalog source spec with config #173

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

Merged

Conversation

perdasilva
Copy link
Contributor

@perdasilva perdasilva commented Nov 16, 2021

Signed-off-by: Per G. da Silva [email protected]

Description

This PR adds a new optional grpcPodConfig field to the CatalogSource spec. The config includes: node selector and toleration configuration, which will eventually make its way to the CatalogSource pod. With this change, and subsequent catalog operator update, users will be able to specify node selectors and tolerations for the underlying catalog source pod.

Testing

I need some guidance here if we have a test suite to exercise the creation of the objects. So far, I've manually tested the creation against the spec.

@openshift-ci openshift-ci bot requested review from exdx and jmrodri November 16, 2021 01:46
@perdasilva perdasilva changed the title feat: update catalog source spec with config [WIP] feat: update catalog source spec with config Nov 16, 2021
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 16, 2021
@perdasilva
Copy link
Contributor Author

perdasilva commented Nov 16, 2021

Please refrain from merging this until we've all aligned on operator-framework/operator-lifecycle-manager#2452

@perdasilva
Copy link
Contributor Author

It seems after the discussion this may not be the right approach. Closing the PR for now.

@perdasilva perdasilva closed this Nov 20, 2021
@perdasilva perdasilva reopened this Dec 3, 2021
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 3, 2021
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 3, 2021
@perdasilva perdasilva force-pushed the bug_1927478 branch 2 times, most recently from e790a7f to dcbc254 Compare December 3, 2021 21:58
@perdasilva
Copy link
Contributor Author

@kevinrizza @anik120 wdyt? I've tried to keep the number of exposed knobs to a minimum. Is there anything else you guys think we need in there?

Copy link
Contributor

@anik120 anik120 left a comment

Choose a reason for hiding this comment

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

@perdasilva I think this list looks good. This should be more than enough for now, and we can always add more if we need later, although I haven't seen any request for anything more than what you've included so far.

type: object
properties:
nodeSelector:
description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/'
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see in the comment above the struct field that you used the single quote, not sure why it rendered it here as double quotes.

Suggested change
description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/'
description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed the reference to external documentation. That fixed the underlying issue.

Copy link
Member

@kevinrizza kevinrizza left a comment

Choose a reason for hiding this comment

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

This looks good to me, just a nit about code comments

// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// If specified, indicates the pod's priority. "system-node-critical" and
Copy link
Member

Choose a reason for hiding this comment

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

nit: This comment feels ripe for rot to me. Do we need to call out the PriorityClass implementation details as they exist today?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great call out! I've updated!

@perdasilva
Copy link
Contributor Author

/assign @joelanford

@perdasilva perdasilva changed the title [WIP] feat: update catalog source spec with config feat: update catalog source spec with config Dec 7, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 7, 2021
@perdasilva
Copy link
Contributor Author

Thank you @kevinrizza and @anik120! I've addressed your comments ^^

@@ -69,6 +70,11 @@ type CatalogSourceSpec struct {
// +Optional
Image string `json:"image,omitempty"`

// GrpcPodConfig exposes different overrides for the pod spec of the CatalogSource Pod.
// Only used when SourceType = SourceTypeGrpc and Image is set.
// +Optional
Copy link
Member

@joelanford joelanford Dec 7, 2021

Choose a reason for hiding this comment

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

Is the +Optional comment marker case insensitive? I've only ever seen it written as +optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a great question. I just kept what was around. I've updated everything to be lowercase to keep it with the general lower-case convention.

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2021
@joelanford
Copy link
Member

/approve

@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelanford, perdasilva

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 Dec 7, 2021
@openshift-merge-robot openshift-merge-robot merged commit 822c9fe into operator-framework:master Dec 7, 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.

5 participants