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

Handle displaying parameters when secrets are not available. #2355

Merged
merged 1 commit into from Oct 24, 2017

Conversation

jeff-phillips-18
Copy link
Member

Bump catalog version to 0.0.58

@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 23, 2017

if (!$scope.allowParametersReveal) {
_.each(_.keys(_.get($scope.parameterSchema, 'properties')), function (key) {
$scope.parameterData[key] = '*****';
Copy link
Member

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?

Copy link
Member

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;
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

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

typo: "Only"

@spadgett
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 24, 2017
@spadgett
Copy link
Member

Needs #2367 to fix the dist problem

@spadgett
Copy link
Member

/retest

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants