UNCLASSIFIED - NO CUI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bigbang
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Big Bang
bigbang
Commits
b6c877ff
Commit
b6c877ff
authored
4 years ago
by
Josh Wolf
Browse files
Options
Downloads
Patches
Plain Diff
bug: fix validation of username/password before creating imagepullsecret
parent
9ce50639
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!231
Resolve "IPS created by BB can possibly create invalid secrets"
Pipeline
#167930
passed with warnings
4 years ago
Stage: .pre
Stage: smoke tests
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
chart/templates/_helpers.tpl
+13
-8
13 additions, 8 deletions
chart/templates/_helpers.tpl
chart/values.yaml
+14
-19
14 additions, 19 deletions
chart/values.yaml
with
27 additions
and
27 deletions
chart/templates/_helpers.tpl
+
13
−
8
View file @
b6c877ff
...
...
@@ -6,9 +6,11 @@
{{- include "multipleCreds" . | b64enc }}
{{- else if eq $credType "map[string]interface {}" }}
{{- /* If we have a map, treat those as key-value pairs. */ -}}
{{- if and .Values.registryCredentials.username .Values.registryCredentials.password }}
{{- with .Values.registryCredentials }}
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end }}
{{- end }}
{{- end -}}
{{- end }}
{{- end }}
...
...
@@ -16,14 +18,17 @@
{{- define "multipleCreds" -}}
{
"auths": {
{{- $length := len .Values.registryCredentials }}
{{- range $index, $entry := .Values.registryCredentials }}
"{{- $entry.registry }}": {
"username{{ $index }}":"{{- $entry.username }}",
"password":"{{- $entry.password }}",
"email":"{{- $entry.email }}",
"auth":"{{- (printf "%s:%s" $entry.username $entry.password | b64enc) }}"
}{{- if ne $length (add $index 1) }},{{- end }}
{{- range $i, $m := .Values.registryCredentials }}
{{- /* Only create entry if resulting entry is valid */}}
{{- if and $m.registry $m.username $m.password }}
{{- if $i }},{{ end }}
"{{ $m.registry }}": {
"username": "{{ $m.username }}",
"password": "{{ $m.password }}",
"email": "{{ $m.email | default "" }}",
"auth": "{{ printf "%s:%s" $m.username $m.password | b64enc }}"
}
{{- end }}
{{- end }}
}
}
...
...
This diff is collapsed.
Click to expand it.
chart/values.yaml
+
14
−
19
View file @
b6c877ff
...
...
@@ -4,28 +4,23 @@ hostname: bigbang.dev
# TODO: All this does right now is toggle GitRepositories, it is _not_ fully functional
offline
:
false
registryCredentials
:
~
# Regisitires can be an explicit map of registries as provided here
#
registryCredentials:
#
registry: registry1.dso.mil
#
username: ""
#
password: ""
#
email: ""
registryCredentials
:
registry
:
registry1.dso.mil
username
:
"
"
password
:
"
"
email
:
"
"
# Or a list of registires:
# registryCredentials:
# - registry: registry.dso.mil
# username: user.name
# password: user-secret
# email: xxx@xxx.xxx
# - registry: registry1.dso.mil
# username: user.name
# password: user-secret
# email: xxx@xxx.xxx
# - registry: registry.example.com
# username: user.name
# password: user-secret
# email: xxx@xxx.xxx
#registryCredentials:
# - registry: registry1.dso.mil
# username: ""
# password: ""
# email: ""
# - registry: registry.dso.mil
# username: ""
# password: ""
# email: ""
# Global git values
# Order of precedence is:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment