-
Notifications
You must be signed in to change notification settings - Fork 231
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
Handle displaying parameters when secrets are not available. #2355
Handle displaying parameters when secrets are not available. #2355
Conversation
|
||
if (!$scope.allowParametersReveal) { | ||
_.each(_.keys(_.get($scope.parameterSchema, 'properties')), function (key) { | ||
$scope.parameterData[key] = '*****'; |
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 think we should be able to just fill in the parameter data from the status parameters below and just remove this if
block. Are you seeing parameters in the schema, but not in status?
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.
Disregard my comment here. Thinking about this more, I think this behavior is better.
if ($scope.allowParametersReveal) { | ||
// Set default values for those items that are not specifically set, secrets will override | ||
_.each(_.keys(_.get($scope.parameterSchema, 'properties')), function (key) { | ||
$scope.parameterData[key] = $scope.parameterSchema.properties[key].default; |
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 think the defaults are only for prefiling the create form. A missing value isn't necessarily treated as a default.
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.
Fixed.
_.each(_.get($scope.serviceInstance, 'spec.parametersFrom'), function (parametersSource) { | ||
secretWatchers.push(DataService.watchObject("secrets", _.get(parametersSource, 'secretKeyRef.name'), $scope.projectContext, function (secret) { | ||
try { | ||
_.extend($scope.parameterData, JSON.parse(SecretsService.decodeSecretData(secret.data)[parametersSource.secretKeyRef.key])); | ||
var secretData = JSON.parse(SecretsService.decodeSecretData(secret.data)[parametersSource.secretKeyRef.key]); | ||
// TODO: ONly include fields from the secret that are part of the schema |
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.
typo: "Only"
Bump catalog version to 0.0.58
2ae3b45
to
9f0c28b
Compare
/lgtm |
Needs #2367 to fix the dist problem |
/retest |
Automatic merge from submit-queue. |
Bump catalog version to 0.0.58