Skip to content

Commit

Permalink
Don't link to secret if binding isn't ready
Browse files Browse the repository at this point in the history
The secret doesn't exist until the binding is ready.
  • Loading branch information
spadgett committed Sep 21, 2017
1 parent 4be2b16 commit 6c04b3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/views/directives/_service-binding.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h3 ng-if="$ctrl.serviceClass">
project-name="{{$ctrl.binding.metadata.namespace}}"
stay-on-current-page="true">
</delete-link>
<a ng-if="('secrets' | canI : 'get')" ng-href="{{$ctrl.binding.spec.secretName | navigateResourceURL : 'Secret' : $ctrl.namespace}}">
<a ng-if="('secrets' | canI : 'get') && ($ctrl.binding | isBindingReady)" ng-href="{{$ctrl.binding.spec.secretName | navigateResourceURL : 'Secret' : $ctrl.namespace}}">
View Secret
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/overview/_service-instance-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ <h3>
<div class="component-label">
Secret
</div>
<a ng-if="('secrets' | canI : 'get')"
<a ng-if="('secrets' | canI : 'get') && (binding | isBindingReady)"
ng-href="{{binding.spec.secretName | navigateResourceURL : 'Secret' : row.apiObject.metadata.namespace}}">
{{binding.spec.secretName}}
</a>
<span ng-if="!('secrets' | canI : 'get')">
<span ng-if="!('secrets' | canI : 'get') || !(binding | isBindingReady)">
{{binding.spec.secretName}}
</span>
</h3>
Expand Down
6 changes: 3 additions & 3 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -5625,7 +5625,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<div class=\"service-binding-actions\" ng-if=\"!ctrl.binding.metadata.deletionTimestamp\">\n" +
"<delete-link ng-if=\"({resource: 'serviceinstancecredentials', group: 'servicecatalog.k8s.io'} | canI : 'delete')\" label=\"Delete Binding\" kind=\"binding\" group=\"servicecatalog.k8s.io\" resource-name=\"{{$ctrl.binding.metadata.name}}\" project-name=\"{{$ctrl.binding.metadata.namespace}}\" stay-on-current-page=\"true\">\n" +
"</delete-link>\n" +
"<a ng-if=\"('secrets' | canI : 'get')\" ng-href=\"{{$ctrl.binding.spec.secretName | navigateResourceURL : 'Secret' : $ctrl.namespace}}\">\n" +
"<a ng-if=\"('secrets' | canI : 'get') && ($ctrl.binding | isBindingReady)\" ng-href=\"{{$ctrl.binding.spec.secretName | navigateResourceURL : 'Secret' : $ctrl.namespace}}\">\n" +
"View Secret\n" +
"</a>\n" +
"</div>\n" +
Expand Down Expand Up @@ -12409,10 +12409,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<div class=\"component-label\">\n" +
"Secret\n" +
"</div>\n" +
"<a ng-if=\"('secrets' | canI : 'get')\" ng-href=\"{{binding.spec.secretName | navigateResourceURL : 'Secret' : row.apiObject.metadata.namespace}}\">\n" +
"<a ng-if=\"('secrets' | canI : 'get') && (binding | isBindingReady)\" ng-href=\"{{binding.spec.secretName | navigateResourceURL : 'Secret' : row.apiObject.metadata.namespace}}\">\n" +
"{{binding.spec.secretName}}\n" +
"</a>\n" +
"<span ng-if=\"!('secrets' | canI : 'get')\">\n" +
"<span ng-if=\"!('secrets' | canI : 'get') || !(binding | isBindingReady)\">\n" +
"{{binding.spec.secretName}}\n" +
"</span>\n" +
"</h3>\n" +
Expand Down

0 comments on commit 6c04b3c

Please sign in to comment.