Skip to content

Conversation

@awgreene
Copy link
Member

@awgreene awgreene commented Apr 8, 2020

This PR introduces OLM support for validating and mutating admission
webhooks by updating the ClusterServiceVersion CRD to include a
WebhooksDefinitions array. In the current iteration, OLM supports
cycling the CA Certs required for webhooks.

@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 Apr 8, 2020
}
}

func (c *InstallStrategyDeploymentClientForNamespace) GetOpClient() operatorclient.ClientInterface {
Copy link
Member Author

Choose a reason for hiding this comment

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

Should be cleaned up in refactor.

return c.opClient
}

func (c *InstallStrategyDeploymentClientForNamespace) GetOpLister() operatorlister.OperatorLister {
Copy link
Member Author

Choose a reason for hiding this comment

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

Should be cleaned up in refactor.

@awgreene awgreene force-pushed the admission-webhoooks branch 2 times, most recently from 77bc8a4 to 2c60954 Compare April 8, 2020 22:17
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

Two suggestions

@awgreene awgreene force-pushed the admission-webhoooks branch 4 times, most recently from ec8d5e3 to 2c029d5 Compare April 9, 2020 01:00
@ecordell ecordell mentioned this pull request Apr 10, 2020
5 tasks
@jmazzitelli
Copy link
Contributor

How will this be exposed to Ansible operators?

@awgreene
Copy link
Member Author

/retest

1 similar comment
@awgreene
Copy link
Member Author

/retest

@awgreene
Copy link
Member Author

/retest

The following tests failed but ran locally

creation with dependencies [It]
image update [It]

@awgreene
Copy link
Member Author

/retest

@ecordell
Copy link
Member

ecordell commented Apr 13, 2020

How will this be exposed to Ansible operators?

That's probably a question for operator-sdk. This is for packaging / installing an admission webhook with your operator, and doesn't have any opinions about how the webhook is implemented. @jmazzitelli

@awgreene awgreene force-pushed the admission-webhoooks branch from 2c029d5 to 46ce701 Compare April 13, 2020 15:55
@awgreene awgreene changed the title WIP: Admission webhoooks Admission webhoooks Apr 13, 2020
@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 Apr 13, 2020
@awgreene awgreene force-pushed the admission-webhoooks branch from e77a2bf to 8838e17 Compare April 13, 2020 23:21
Maturity string
CustomResourceDefinitions CustomResourceDefinitions
APIServiceDefinitions APIServiceDefinitions
WebhookDefinitions []WebhookDescription
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: the slice should be []WebhookDefinitions ?

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 wanted to keep it similar to APIServiceDefinitions, I'm not opposed to changing the variable (API) name though.

CustomResourceDefinitions CustomResourceDefinitions `json:"customresourcedefinitions,omitempty"`
APIServiceDefinitions APIServiceDefinitions `json:"apiservicedefinitions,omitempty"`
// +listType=set
WebhookDefinitions []WebhookDescription `json:"webhookdefinitions,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: the slice should be []WebhookDefinitions ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@ecordell ecordell 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 really good, and I think you've set it up well for the planned refactoring to these parts.

I left a few comments for small things, the only thing that I'm concerned about addressing is the 0.14.2 release (should be my first comment in this review)

previousStrategy: previousStrategy,
templateAnnotations: templateAnnotations,
initializers: initializers,
apiServiceDescriptions: apiDescs,
Copy link
Member

Choose a reason for hiding this comment

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

refactor suggestion: is there a way we can model the apidescriptions/webhookdescriptions as just more initializer functions?


// Check if Webhooks have valid rules
for _, desc := range out.Spec.WebhookDefinitions {
if syncError = install.ValidWebhookRules(desc.Rules); syncError != nil {
Copy link
Member

Choose a reason for hiding this comment

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

future nit: we should tie these validations to the the validation library used in opm

@awgreene
Copy link
Member Author

/test e2e-gcp

@awgreene
Copy link
Member Author

/retest

3 similar comments
@awgreene
Copy link
Member Author

/retest

@awgreene
Copy link
Member Author

/retest

@awgreene
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

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

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@awgreene
Copy link
Member Author

/retest

@awgreene awgreene closed this Apr 16, 2020
@awgreene awgreene reopened this Apr 16, 2020
@awgreene
Copy link
Member Author

Closed and reopened to kick off tests after another PR was merged.

@awgreene
Copy link
Member Author

/retest

3 similar comments
@awgreene
Copy link
Member Author

/retest

@awgreene
Copy link
Member Author

/retest

@awgreene
Copy link
Member Author

/retest

This commit introduces a change that moves the APIService install logic
to the installer.
This commit introduces OLM support for validating and mutating admission
webhooks by updating the ClusterServiceVersion CRD to include a
WebhooksDefinitions array. In the current iteration, OLM supports
cycling the CA Certs required for webhooks.
@awgreene awgreene force-pushed the admission-webhoooks branch from 2ca6a24 to 468d1f6 Compare April 16, 2020 19:01
@openshift-ci-robot
Copy link
Collaborator

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 16, 2020
@awgreene
Copy link
Member Author

/retest

2 similar comments
@awgreene
Copy link
Member Author

/retest

@awgreene
Copy link
Member Author

/retest

@openshift-ci-robot
Copy link
Collaborator

@awgreene: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-gcp 468d1f6 link /test e2e-gcp
ci/prow/e2e-gcp-upgrade 468d1f6 link /test e2e-gcp-upgrade

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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. I understand the commands that are listed here.

@awgreene awgreene merged commit 3854141 into operator-framework:master Apr 17, 2020
@awgreene
Copy link
Member Author

Passing e2e-aws, e2e-gcp is broken right now - manually merging as a result

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants