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

feat(charts): allow using existing secrets for addAccountOperator #950

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/substra-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

<!-- towncrier release notes start -->

## [26.8.0] - 2024-07-10

### Added

- Allow using existing secret for `addAccountOperators`

## [26.7.5] - 2024-06-29

### Added
Expand Down
2 changes: 1 addition & 1 deletion charts/substra-backend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: substra-backend
home: https://github.com/Substra
version: 26.7.5
version: 26.8.0
appVersion: 0.47.0
kubeVersion: ">= 1.19.0-0"
description: Main package for Substra
Expand Down
11 changes: 6 additions & 5 deletions charts/substra-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,12 @@ See [UPGRADE.md](https://github.com/Substra/substra-backend/blob/main/charts/sub

### Account operator settings

| Name | Description | Value |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------- | ----- |
| `addAccountOperator.outgoingOrganizations` | Outgoind organizations credentials for substra backend organization-to-organization communications | `[]` |
| `addAccountOperator.incomingOrganizations` | Incoming organizations credentials for substra backend organization-to-organization communications | `[]` |
| `addAccountOperator.users` | A list of administrators users who can log into the substra backend server with admin privileges | `[]` |
| Name | Description | Value |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| `addAccountOperator.outgoingOrganizations` | Outgoind organizations credentials for substra backend organization-to-organization communications | `[]` |
| `addAccountOperator.incomingOrganizations` | Incoming organizations credentials for substra backend organization-to-organization communications | `[]` |
| `addAccountOperator.users` | A list of administrators users who can log into the substra backend server with admin privileges | `[]` |
| `addAccountOperator.existingSecret` | An alternative to providing credentials for organization-to-organization communications and users ; secret must have the `users`, `incoming_organizations` and `outgoing_organizations` keys | `""` |

### Registry prepopulate

Expand Down
11 changes: 11 additions & 0 deletions charts/substra-backend/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,14 @@ Retrieve AWS environment variable value
{{- end -}}
{{- $value -}}
{{- end -}}

{{/*
Define account operators secret name
*/}}
{{- define "substra-backend.accountOperator.secretName" -}}
{{- if .Values.addAccountOperator.existingSecret -}}
{{- .Values.addAccountOperator.existingSecret }}
{{- else -}}
{{ template "substra.fullname" . }}-add-account
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/substra-backend/templates/job-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ spec:
volumes:
- name: accounts
secret:
secretName: {{ template "substra.fullname" . }}-add-account
secretName: {{ include "substra-backend.accountOperator.secretName" . }}
2 changes: 2 additions & 0 deletions charts/substra-backend/templates/secret-add-account.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.addAccountOperator.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -9,3 +10,4 @@ data:
users: {{ include "common.users" .Values.addAccountOperator.users | b64enc | quote }}
incoming_organizations: {{ include "common.users" .Values.addAccountOperator.incomingOrganizations | b64enc | quote }}
outgoing_organizations: {{ include "common.users" .Values.addAccountOperator.outgoingOrganizations | b64enc | quote }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/substra-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,9 @@ addAccountOperator:
## channel: mychannel
##
users: []
## @param addAccountOperator.existingSecret An alternative to providing credentials for organization-to-organization communications and users ; secret must have the `users`, `incoming_organizations` and `outgoing_organizations` keys
##
existingSecret: ""

## @section Registry prepopulate
##
Expand Down
Loading