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

Bug 1906808: configobservation: override service-account-jwks-uri to use LB address #1020

Merged
merged 1 commit into from Jan 5, 2021

Conversation

stlaz
Copy link
Member

@stlaz stlaz commented Dec 10, 2020

Without the override, the KAS would point to its own IP which is not
covered by the default serving certificate.

/assign @marun
/cc @tnozicka

"service-account-jwks-uri": []interface{}{
// We need to set the URL so that it points to our LB and doesn't
// default to KAS IP which isn't included in the serving certificate.
internalLBURL + "/openid/v1/jwks",
Copy link
Contributor

@marun marun Dec 10, 2020

Choose a reason for hiding this comment

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

If sts or cco were to override the default issuer, would they need to be affect the value of service-account-jwks-uri?

Also, maybe an update to the enhancement is suggested?

Copy link
Member Author

@stlaz stlaz Dec 11, 2020

Choose a reason for hiding this comment

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

You're right. If I understand the logic of this observer, this would have to be moved to the condition above when no issuer is set, correct?

Then there would be no need for changes when the default issuer is overriden, although we might consider allowing this modification in the future.

@stlaz
Copy link
Member Author

stlaz commented Dec 11, 2020

Updated to only set the jwks uri when the issuer is unset, lets' see whether it can pass CI

@stlaz stlaz changed the title Rebase: configobservation: override service-account-jwks-uri to use LB address Bug 1906808: configobservation: override service-account-jwks-uri to use LB address Dec 11, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. label Dec 11, 2020
@openshift-ci-robot
Copy link

@stlaz: This pull request references Bugzilla bug 1906808, which is invalid:

  • expected the bug to target the "4.7.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1906808: configobservation: override service-account-jwks-uri to use LB address

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-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Dec 11, 2020
@stlaz
Copy link
Member Author

stlaz commented Dec 11, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot 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. and removed bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. labels Dec 11, 2020
@openshift-ci-robot
Copy link

@stlaz: This pull request references Bugzilla bug 1906808, which is valid. The bug has been moved to the POST state. 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.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

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-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Dec 11, 2020
) (map[string]interface{}, []error) {

issuer, errs := observedIssuer(existingConfig, authConfigAccessor)
config := unstructuredConfigForIssuer(issuer)

infrastructureConfig, err := infrastructureConfigAccessor("cluster")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe only perform this step when the issuer length is zero? Otherwise an error could occur trying to retrieve something that isn't needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

What you've done looks fine, but maybe could have been accomplished with less effort?

internalURL := ""
if len(issuer) == 0 {
  ...
  internalURL = ...
}

Without the override, the KAS would point to its own IP which is not
covered by the default serving certificate.
@stlaz
Copy link
Member Author

stlaz commented Dec 14, 2020

@marun I fixed the logic to only grab the infra config when an issuer is not set. PTAL

@stlaz
Copy link
Member Author

stlaz commented Dec 14, 2020

/retest

@marun
Copy link
Contributor

marun commented Dec 14, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2020
@stlaz
Copy link
Member Author

stlaz commented Dec 15, 2020

/retest

@openshift-merge-robot
Copy link
Contributor

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

Test name Commit Details Rerun command
ci/prow/k8s-e2e-gcp 14c367c link /test k8s-e2e-gcp
ci/prow/e2e-aws 14c367c link /test e2e-aws
ci/prow/e2e-aws-operator 14c367c link /test e2e-aws-operator

Full PR test history. Your PR dashboard.

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.

@stlaz
Copy link
Member Author

stlaz commented Jan 5, 2021

/retest

}

// observedConfig returns an unstructured fragment of KubeAPIServerConfig that may
// include an override of the default service account issuer if one was set in the
// Authentication resource.
func observedConfig(
existingConfig map[string]interface{},
authConfigAccessor func(string) (*v1.Authentication, error),
authConfigAccessor func(string) (*configv1.Authentication, error),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: accessor is a fixed term in apimachinery. Better: getAuthConfig, getInfrastructureConfig

}

// observedConfig returns an unstructured fragment of KubeAPIServerConfig that may
// include an override of the default service account issuer if one was set in the
// Authentication resource.
func observedConfig(
existingConfig map[string]interface{},
authConfigAccessor func(string) (*v1.Authentication, error),
authConfigAccessor func(string) (*configv1.Authentication, error),
infrastructureConfigAccessor func(string) (*configv1.Infrastructure, error),
) (map[string]interface{}, []error) {

issuer, errs := observedIssuer(existingConfig, authConfigAccessor)
Copy link
Contributor

Choose a reason for hiding this comment

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

what can errs be? Keep going with all the logic is a little confusing. At least doc some rational why.

},
},
}, errs

Copy link
Contributor

Choose a reason for hiding this comment

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

drop empty line

@sttts
Copy link
Contributor

sttts commented Jan 5, 2021

nits

@sttts
Copy link
Contributor

sttts commented Jan 5, 2021

/approve

Follow-up for nits.

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marun, stlaz, 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

@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 5, 2021
@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-ci-robot
Copy link

@stlaz: All pull requests linked via external trackers have merged:

Bugzilla bug 1906808 has been moved to the MODIFIED state.

In response to this:

Bug 1906808: configobservation: override service-account-jwks-uri to use LB address

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.

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. 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. 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

6 participants