-
Notifications
You must be signed in to change notification settings - Fork 150
Honor configs & report public hostname on status #134
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
Honor configs & report public hostname on status #134
Conversation
benjaminapetersen
commented
Feb 12, 2019
- handles values set on console config
- handle values set on operator config
- report public hostname on status
- oauth team dependent on this update
| defaultDocumentationBaseURL = "https://docs.okd.io/4.0/" | ||
| defaultBranding = "okd" | ||
| ) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 functions may belong in util.go or somewhere else...
|
|
||
| //operatorConfig.Spec.Customization.Brand | ||
| func getBrand(operatorConfig *operatorv1.Console) operatorv1.Brand { | ||
| // TODO: handle if not provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zherman0 this is related to your brand work PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#126
Just want to ensure they function together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if brand is not EXPLICITLY set, it should just fallback to the default which is provided in #126 (baked into the image). Either okd or ocp.
|
/test unit |
jhadvig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few quick comments. Also need to check SyncConsoleConfig() cause I have a feeling that that might mess things up.
| func DefaultConfigMap(cr *operatorv1.Console, rt *routev1.Route) *corev1.ConfigMap { | ||
| // overridden by console config | ||
| const ( | ||
| defaultLogoutURL = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont we have a default URL for logout ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, there should not be a default (empty string). See console auth/logout handling:
| //consoleConfig.Spec.Authentication.LogoutRedirect | ||
| func getLogoutRedirect(consoleConfig *configv1.Console) string { | ||
| // TODO: handle if not provided | ||
| // return consoleConfig.Spec.Authentication.LogoutRedirect || defaultLogoutURL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets uncomment this and comment the below ? or am I missing something ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, you aren't missing anything. This is why its still WIP. I didn't have time to test everything before opening last night, but wanted to raise awareness early.
|
@benjaminapeterse we probrably need to update the tests |
| ) | ||
|
|
||
| func getLogoutRedirect(consoleConfig *configv1.Console) string { | ||
| if len(consoleConfig.Spec.Authentication.LogoutRedirect) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is all we need to do. The config structs are not pointers, so when the YAML is instantiated, nested structs should be created with empty string values. Therefore if empty string is provided, we can return the default value instead.
@jhadvig @zherman0 work? Same treatment for all three of these.
|
|
||
| host := rt.Spec.Host | ||
| config := NewYamlConfigString(host) | ||
| config := string(NewYamlConfig(host, logoutRedirect, brand, docURL)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I eliminated the one wrapper func NewYamlConfigString(), was unnecessary additional plumbing for passing these values down, when all it did was call string().
8201e13 to
f347cab
Compare
|
Updated the tests & filled out the defaults. |
|
/test e2e-aws |
|
/retest one success. interesting. |
f347cab to
8e62a40
Compare
|
So at present you should be able to update the and it will update the web console. In addition, when the Also, the The customizations on branding & documentationBaseURL will be set on the console |
|
/hold cancel |
|
/retest flake |
|
Last failure: |
|
/test e2e-aws |
|
That fail is interesting. Will check in a short bit. |
|
flake |
jhadvig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benjaminapetersen, jhadvig The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Console publishes its config under the name 'console' now. Ref: openshift/console-operator#134