forked from openshift/origin-web-console
/
add-secret-to-application.html
115 lines (115 loc) · 5.28 KB
/
add-secret-to-application.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<div>
<div class="dialog-title">
<h3>Add to Application</h3>
</div>
<div class="dialog-body">
<form name="addToApplicationForm" novalidate>
<fieldset ng-disabled="disableInputs">
<legend>Add this secret to application:</legend>
<div class="form-group">
<div class="application-select">
<ui-select id="application" ng-model="ctrl.application" required="true" ng-disabled="ctrl.disableInputs">
<ui-select-match placeholder="{{ctrl.applications.length ? 'Select an application' : 'There are no applications in this project'}}">
<span>
{{$select.selected.metadata.name}}
<small class="text-muted">– {{$select.selected.kind | humanizeKind : true}}</small>
</span>
</ui-select-match>
<ui-select-choices
repeat="application in (ctrl.applications) | filter : { metadata: { name: $select.search } } track by (application | uid)"
group-by="ctrl.groupByKind">
<span ng-bind-html="application.metadata.name | highlight : $select.search"></span>
</ui-select-choices>
</ui-select>
</div>
</div>
<legend>Add secret as:</legend>
<div class="form-group">
<div class="radio">
<div class="add-choice">
<label>
<input type="radio" ng-model="ctrl.addType" value="env" ng-disabled="ctrl.disableInputs">
Environment variables
</label>
<div class="alert alert-warning env-warning" ng-show="ctrl.hasInvalidEnvVars">
<span class="pficon pficon-warning-triangle-o" aria-hidden="true"></span>
<span>Some of the keys for secret <strong>{{ctrl.secret.metadata.name}}</strong> are not valid environment variable names and will not be added.</span>
</div>
</div>
<div>
<label class="add-choice" for="volume">
<input id="volume" type="radio" ng-model="ctrl.addType" value="volume" ng-disabled="ctrl.disableInputs">
Volume
</label>
</div>
<div class="volume-options">
<div ng-class="{'has-error': (addToApplicationForm.mountVolume.$error.oscUnique || (addToApplicationForm.mountVolume.$error.pattern && addToApplicationForm.mountVolume.$touched))}">
<input class="form-control"
name="mountVolume"
id="mountVolume"
placeholder="Enter a mount path"
type="text"
required
ng-pattern="/^\/.*$/"
osc-unique="ctrl.existingMountPaths"
aria-describedby="mount-path-help"
ng-disabled="ctrl.addType !== 'volume' || ctrl.disableInputs"
ng-model="ctrl.mountVolume"
autocorrect="off"
autocapitalize="off"
spellcheck="false">
</div>
<div class="help-block bind-description">
Mount Path for the volume. A file will be created in this director for each key from the secret. The file contents will be the value of the key.
</div>
<div class="has-error" ng-show="addToApplicationForm.mountVolume.$error.oscUnique">
<span class="help-block">
The mount path is already used. Please choose another mount path.
</span>
</div>
</div>
</div>
</div>
<legend ng-if-start="ctrl.application.spec.template.spec.containers.length > 1">Containers:</legend>
<div ng-if-end class="form-group container-options">
<div ng-if="ctrl.attachAllContainers">
The secret will be added to all containers. You can
<a href="" ng-click="ctrl.attachAllContainers = false">select specific containers</a>
instead.
</div>
<div ng-if="!ctrl.attachAllContainers" class="form-group">
<label class="sr-only required">Containers</label>
<select-containers
ng-model="ctrl.attachContainers"
pod-template="ctrl.application.spec.template"
ng-required="true"
help-text="Add the secret to the selected containers.">
</select-containers>
</div>
</div>
<div class="button-group pull-right">
<button
class="btn btn-default"
ng-class="{'dialog-btn': isDialog}"
ng-click="ctrl.onCancel()">
Cancel
</button>
<button type="submit"
class="btn btn-primary"
ng-class="{'dialog-btn': isDialog}"
ng-click="ctrl.addToApplication()"
ng-disabled="ctrl.addType === 'volume' && addToApplicationForm.$invalid || !ctrl.application"
value="">
Save
</button>
</div>
</fieldset>
</form>
<div class="updating" ng-if="ctrl.updating">
<div class="spinner spinner-lg" aria-hidden="true"></div>
<h3>
<span class="sr-only">Updating</span>
</h3>
</div>
</div>
</div>