-
Notifications
You must be signed in to change notification settings - Fork 266
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
Enable marking config-app fields as read only. #310
Conversation
Would you be able to lend me a hand? I am not quite sure how to bridge the gap between these values existing in The end result that I'm shooting for is to be able to show, but not allow modifying, the configuration for Redis, the Hostname, or the Storage, if the environment variable is set. Feel free to let me know if I'm going about this the wrong way or if it's non-trivial. It's related to the "Day 2" Operator work. Thanks! |
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.
Deployed it and fields were still modifiable. Saw this error in the browser console: https://code.angularjs.org/1.5.3/docs/error/$compile/nonassign?p0=undefined&p1=isReadonly&p2=configStringField
Thanks for the tips on the one-time binding, @alecmerdler! When I run the configuration locally, passing in my environment variables, using the command:
I successfully see that my warnings are displayed and that the configuration items are read-only. I still need to test this on a cluster where I am modifying an existing configuration. When I do not set a feature to be read-only, I still see the big warning. I think the |
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
@@ -11,6 +11,7 @@ | |||
from config_app.config_util.config import get_config_provider | |||
from util.security.instancekeys import InstanceKeys | |||
|
|||
|
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.
Nice
@@ -1,6 +1,7 @@ | |||
<div class="config-numeric-field-element"> | |||
<form name="fieldform" novalidate> | |||
<input type="number" class="form-control" placeholder="{{ placeholder || '' }}" | |||
ng-model="bindinginternal" ng-trim="false" ng-minlength="1" required> | |||
ng-model="bindinginternal" ng-trim="false" ng-minlength="1" required | |||
ng-readonly="::isReadonly"> |
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.
👍
Description of Changes
This change-set allows Users to mark certain fields in the Configuration application as read-only. This is helpful for cases where certain fields may be managed by an external resource, such as the Quay Operator.
The data should still be available when read from an existing configuration, but the User should not be allowed to manually edit it through the UI.
The following options are currently supported:
StorageNot used at the moment. Can be implemented in the future.Changes:
READ_ONLY_FIELDS=redis,hostname
Issue:
TESTING
BREAKING CHANGE
n/a
Reviewer Checklist