Skip to content

Conversation

@marun
Copy link
Contributor

@marun marun commented Jan 18, 2020

Implements support for overriding the service account issuer as per openshift/enhancements#150:


// serviceAccountIssuer is the identifier of the bound service account token issuer.
// +optional
ServiceAccountIssuer string `json:"serviceAccountIssuer"`
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any special format? Is it a URL ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a default value?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe serviceAccountIssuer configures the issuer for bound service account tokens would make more sense as an explanation for a common user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just a string. It can be configured with a URL to source the public key to verify issued tokens (as is the case for the EKS webhook), but it can also just be a textual value used by the verifier in kube-apiserver to identify that a token was issued by it.

As to the question of a default value, the operator will set auth.openshift.io in defaultconfig.yaml. Does that need to be documented here given that the API isn't the one defaulting it?

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 just a string. It can be configured with a URL to source the public key to verify issued tokens (as is the case for the EKS webhook), but it can also just be a textual value used by the verifier in kube-apiserver to identify that a token was issued by it.

Provide the recommended options in the godoc.

As to the question of a default value, the operator will set auth.openshift.io in defaultconfig.yaml. Does that need to be documented here given that the API isn't the one defaulting it?

Yes, the behavior of the system and the repercussions of choices needs to be described here.

Copy link
Contributor

Choose a reason for hiding this comment

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

something like [^:]*|someURLRegEx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wait, why don't I want to allow an empty string given that will be the default?

Copy link
Contributor

Choose a reason for hiding this comment

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

We could. But then we have two ways to express that: empty and undefined. Kind of ugly.

Copy link
Contributor Author

@marun marun Jan 22, 2020

Choose a reason for hiding this comment

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

A 'url regex' is a non-trivial thing (as per https://mathiasbynens.be/demo/url-regex). I get that it's desirable to validate up-front, but having to validate complex data declaratively like this seems error prone. Do you still want regex valiation, or would it make sense to instead do a url check in code when the field is observed and report an error in the operator logs or an event?

Copy link
Contributor

Choose a reason for hiding this comment

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

am fine with later validation and reporting via e.g. a condition

// issuer.
ServiceAccountIssuer string `json:"serviceAccountIssuer"`

// apiAudiences is a list of identifies of the API. The service account token
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: identifiers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!


// serviceAccountIssuer is the identifier of the bound service account token
// issuer. If not provided, a default value of "auth.openshift.io" will be used.
ServiceAccountIssuer string `json:"serviceAccountIssuer"`
Copy link
Contributor

Choose a reason for hiding this comment

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

these can be passed as flags, right? If we can use flags, then we don't add the types here. We want to eliminate this type over time and only use the upstream provided values.

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 sound preferable, but it is not clear from reading the code how exactly these flags would be specified by the operator (or overridden by an administrator). Are there docs/examples/code/etc you can point me to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@marun marun changed the title Enable bound service account tokens Enable overriding service account issuer for bound tokens Jan 21, 2020
@sttts
Copy link
Contributor

sttts commented Jan 22, 2020

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jan 22, 2020
@openshift-merge-robot openshift-merge-robot merged commit 1108c9a into openshift:master Jan 22, 2020
danwinship added a commit to danwinship/cluster-kube-controller-manager-operator that referenced this pull request Mar 2, 2020
In particular, to get

openshift/api#585: config: disable IPv6DualStack feature flag

so we don't launch kube-controller-manager with that (still-broken) feature

Also includes:

openshift/api#557: create the IBMCLoudPlatform type for the ingress operator try2
openshift/api#570: Clarify image config doc
openshift/api#569: Enable overriding service account issuer for bound tokens
openshift/api#527: Add kubebuilder annotations to the network types
openshift/api#574: add deprecaction notice for build pipeline strategy
openshift/api#582: config/v1/types_proxy: Clarify trustedCA semantics
openshift/api#583: Clarify FROM behavior in builds
openshift/api#573: Add CRD generator documentation to Readme
openshift/api#576: Remove Description from CLI output to improve its display
openshift/api#589: Add missing enum validations
openshift/api#583: operator/ingress: add dnsrecord type
soltysh added a commit to soltysh/cluster-kube-controller-manager-operator that referenced this pull request Mar 4, 2020
In particular, to get

openshift/api#585: config: disable IPv6DualStack feature flag

so we don't launch kube-controller-manager with that (still-broken) feature

Also includes:

openshift/api#557: create the IBMCLoudPlatform type for the ingress operator try2
openshift/api#570: Clarify image config doc
openshift/api#569: Enable overriding service account issuer for bound tokens
openshift/api#527: Add kubebuilder annotations to the network types
openshift/api#574: add deprecaction notice for build pipeline strategy
openshift/api#582: config/v1/types_proxy: Clarify trustedCA semantics
openshift/api#583: Clarify FROM behavior in builds
openshift/api#573: Add CRD generator documentation to Readme
openshift/api#576: Remove Description from CLI output to improve its display
openshift/api#589: Add missing enum validations
openshift/api#583: operator/ingress: add dnsrecord type
soltysh added a commit to soltysh/cluster-kube-controller-manager-operator that referenced this pull request Mar 6, 2020
In particular, to get

openshift/api#585: config: disable IPv6DualStack feature flag

so we don't launch kube-controller-manager with that (still-broken) feature

Also includes:

openshift/api#557: create the IBMCLoudPlatform type for the ingress operator try2
openshift/api#570: Clarify image config doc
openshift/api#569: Enable overriding service account issuer for bound tokens
openshift/api#527: Add kubebuilder annotations to the network types
openshift/api#574: add deprecaction notice for build pipeline strategy
openshift/api#582: config/v1/types_proxy: Clarify trustedCA semantics
openshift/api#583: Clarify FROM behavior in builds
openshift/api#573: Add CRD generator documentation to Readme
openshift/api#576: Remove Description from CLI output to improve its display
openshift/api#589: Add missing enum validations
openshift/api#583: operator/ingress: add dnsrecord type
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants