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

OAuthRevisionLabelPodDeployer #348

Merged

Conversation

p0lyn0mial
Copy link
Contributor

@p0lyn0mial p0lyn0mial commented Apr 1, 2020

builds on #347 and adds oauth revision label deployer (1702200)

This PR adds NewUnionRevisionLabelPodDeployer that combines a standard OpenShiftAPIServer deployer and a temporal OpenSiftAuthAPI deployer into one.

OpenSiftAuthAPI is on/off based on the annotation of the openshift-oauth-apiserver-encryption-cofngi secret. It will be removed in future releases ( >= 4.7).

When OpenSiftAuthAPI deployer is on encryption controllers for this operator will wait until OpenShiftAuthAPI servers converge onto a single revision.

This PR also starts OAuthAPIServerController that will manage encryption-config-openshift-oauth-apiserver in openshift-config-managed namespace as described in https://github.com/openshift/enhancements/blob/master/enhancements/etcd/etcd-encryption-for-separate-oauth-apis.md

@p0lyn0mial
Copy link
Contributor Author

/assign @sttts

@p0lyn0mial
Copy link
Contributor Author

requires openshift/library-go#763

@p0lyn0mial
Copy link
Contributor Author

/hold

for testing

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 1, 2020
@p0lyn0mial
Copy link
Contributor Author

/retest

@p0lyn0mial p0lyn0mial force-pushed the with-custom-deployer branch 3 times, most recently from e574939 to b5d7329 Compare April 1, 2020 18:51
@p0lyn0mial
Copy link
Contributor Author

/retest

@p0lyn0mial
Copy link
Contributor Author

/test e2e-aws-upgrade

@p0lyn0mial
Copy link
Contributor Author

e2e-aws-operator, e2e-aws-operator-encryption-perf, e2e-aws-operator-encryption are failing because this PR requires openshift/cluster-authentication-operator#243

@@ -34,7 +34,7 @@ type oauthAPIServerController struct {
}

// New creates OAuthAPIServerController that will manage encryption-config-openshift-oauth-apiserver in openshift-config-managed namespace as described in https://github.com/openshift/enhancements/blob/master/enhancements/etcd/etcd-encryption-for-separate-oauth-apis.md
// Note that this code will be removed in the future release (4.6)
// Note that this code will be removed in the future release (4.7)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

// case 1 encryption off or the secret was annotated - we are in charge
// case 2 otherwise let CAO manage its own encryption configuration
// TODO:
// - change case 1 in in 4.7 so that this operator doesn't manage CAO's encryption config when encryption is off
Copy link
Contributor Author

Choose a reason for hiding this comment

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

allEncryptedGRs []schema.GroupResource
encryptedGRsManagedByExternalServer sets.String

secretLister corev1listers.SecretNamespaceLister
isOAuthEncryptionConfigManagedByThisOperatorFunc func() bool
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: s/Func//

// Whether this deployer is on/off is determined by isOAuthEncryptionConfigManagedByThisOperatorFunc
// TODO:
// remove this deployer in 4.7
func NewOAuthRevisionLabelPodDeployerAdapter(
Copy link
Contributor

Choose a reason for hiding this comment

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

MaybeDisabledDeployer might be a better name? This is nothing special about oauth.

Copy link
Contributor

Choose a reason for hiding this comment

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

DisabledByPredicateDeployer even. And the interface would be MaybeDisabledDeployer.

"github.com/openshift/library-go/pkg/operator/encryption/statemachine"
)

type DeployerExtended interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

MaybeDisabledDeployer

Disabled() bool
}

// UnionRevisionLabelPodDeployer provides unified state from multiple distinct deployers.
Copy link
Contributor

Choose a reason for hiding this comment

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

... it's converged if all delegates are converged. Each deployer can be disabled.

What if all are disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What if all are disabled?

we will treat it as if encryption was off

return &UnionRevisionLabelPodDeployer{delegates: delegates}, nil
}

// DeployedEncryptionConfigSecret returns the actual encryption configuration across multiple deployers
Copy link
Contributor

Choose a reason for hiding this comment

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

.... if they all agree.

@@ -232,6 +255,14 @@ func RunOperator(ctx context.Context, controllerConfig *controllercmd.Controller
return err
}

oauthEncryptionController := oauthapiencryptioncontroller.New(
Copy link
Contributor

Choose a reason for hiding this comment

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

this is just the secret sync controller, isn't it? Can we make that clearer?

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

// That means:
// - none has reported an error
// - all have converged
// - all have observed exactly the same encryption configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ... Otherwise it returns converged=false.

@sttts
Copy link
Contributor

sttts commented Jul 20, 2020

Lgtm.

@sttts
Copy link
Contributor

sttts commented Jul 20, 2020

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 20, 2020
…iftAPIServer deployer and a temporal OpenSiftAuthAPI deployer into one

OpenSiftAuthAPI is on/off based on the annotation of the openshift-oauth-apiserver-encryption-cofngi secret. It will be removed in future releases ( >= 4.7),
when OpenSiftAuthAPI deployer is on encryption controllers for this operator will wait until OpenShiftAuthAPI servers converge onto a single revision.

it also starts OAuthAPIServerController that will manage encryption-config-openshift-oauth-apiserver in openshift-config-managed namespace as described in https://github.com/openshift/enhancements/blob/master/enhancements/etcd/etcd-encryption-for-separate-oauth-apis.md
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 27, 2020
@p0lyn0mial
Copy link
Contributor Author

/retest

1 similar comment
@p0lyn0mial
Copy link
Contributor Author

/retest

@p0lyn0mial
Copy link
Contributor Author

/test e2e-aws

p0lyn0mial added a commit to p0lyn0mial/cluster-authentication-operator that referenced this pull request Jul 29, 2020
p0lyn0mial added a commit to p0lyn0mial/cluster-authentication-operator that referenced this pull request Jul 29, 2020
@sttts
Copy link
Contributor

sttts commented Jul 30, 2020

/retest
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: p0lyn0mial, sttts

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

@p0lyn0mial
Copy link
Contributor Author

/test all

@p0lyn0mial
Copy link
Contributor Author

/retest

@p0lyn0mial
Copy link
Contributor Author

/test all

@p0lyn0mial
Copy link
Contributor Author

/retest

@p0lyn0mial
Copy link
Contributor Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 30, 2020
@sttts
Copy link
Contributor

sttts commented Jul 30, 2020

e2e-aws "Pod openshift-infra/recycler-for-nfs-lr9st was pending entire time: unknown error",

/retest

@openshift-bot
Copy link
Contributor

/retest

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

1 similar comment
@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 ed0e055 into openshift:master Jul 30, 2020
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.

None yet

5 participants