Merge "Add helm.sh/hook related annotation for neutron"

This commit is contained in:
Zuul 2021-03-25 17:26:10 +00:00 committed by Gerrit Code Review
commit bd476a6677
10 changed files with 50 additions and 9 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Neutron
name: neutron
version: 0.1.10
version: 0.1.11
home: https://docs.openstack.org/neutron/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png
sources:

View File

@ -12,8 +12,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.bootstrap" }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "5"
{{- end }}
{{- if and .Values.manifests.job_bootstrap .Values.bootstrap.enabled }}
{{- $bootstrapJob := dict "envAll" . "serviceName" "neutron" "keystoneUser" .Values.bootstrap.ks_user "logConfigFile" .Values.conf.neutron.DEFAULT.log_config_append -}}
{{- $bootstrapJob := dict "envAll" . "serviceName" "neutron" "keystoneUser" .Values.bootstrap.ks_user "logConfigFile" .Values.conf.neutron.DEFAULT.log_config_append "jobAnnotations" (include "metadata.annotations.job.bootstrap" . | fromYaml) -}}
{{- if .Values.manifests.certificates -}}
{{- $_ := set $bootstrapJob "tlsSecret" .Values.secrets.tls.network.server.internal -}}
{{- end -}}

View File

@ -12,8 +12,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.db_init" }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-5"
{{- end }}
{{- if .Values.manifests.job_db_init }}
{{- $dbInitJob := dict "envAll" . "serviceName" "neutron" -}}
{{- $dbInitJob := dict "envAll" . "serviceName" "neutron" "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}}
{{- if .Values.manifests.certificates -}}
{{- $_ := set $dbInitJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
{{- end -}}

View File

@ -12,8 +12,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.db_sync" }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-4"
{{- end }}
{{- if .Values.manifests.job_db_sync }}
{{- $dbSyncJob := dict "envAll" . "serviceName" "neutron" "podVolMounts" .Values.pod.mounts.neutron_db_sync.neutron_db_sync.volumeMounts "podVols" .Values.pod.mounts.neutron_db_sync.neutron_db_sync.volumes -}}
{{- $dbSyncJob := dict "envAll" . "serviceName" "neutron" "podVolMounts" .Values.pod.mounts.neutron_db_sync.neutron_db_sync.volumeMounts "podVols" .Values.pod.mounts.neutron_db_sync.neutron_db_sync.volumes "jobAnnotations" (include "metadata.annotations.job.db_sync" . | fromYaml) -}}
{{- if .Values.manifests.certificates -}}
{{- $_ := set $dbSyncJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
{{- end -}}

View File

@ -12,7 +12,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.repo_sync" }}
helm.sh/hook: post-install,post-upgrade
{{- end }}
{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }}
{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "neutron" -}}
{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "neutron" "jobAnnotations" (include "metadata.annotations.job.repo_sync" . | fromYaml) -}}
{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }}
{{- end }}

View File

@ -12,8 +12,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.ks_endpoints" }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-2"
{{- end }}
{{- if .Values.manifests.job_ks_endpoints }}
{{- $ksServiceJob := dict "envAll" . "serviceName" "neutron" "serviceTypes" ( tuple "network" ) -}}
{{- $ksServiceJob := dict "envAll" . "serviceName" "neutron" "serviceTypes" ( tuple "network" ) "jobAnnotations" (include "metadata.annotations.job.ks_endpoints" . | fromYaml) -}}
{{- if .Values.manifests.certificates -}}
{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.network.server.internal -}}
{{- end -}}

View File

@ -12,8 +12,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.ks_service" }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-3"
{{- end }}
{{- if .Values.manifests.job_ks_service }}
{{- $ksServiceJob := dict "envAll" . "serviceName" "neutron" "serviceTypes" ( tuple "network" ) -}}
{{- $ksServiceJob := dict "envAll" . "serviceName" "neutron" "serviceTypes" ( tuple "network" ) "jobAnnotations" (include "metadata.annotations.job.ks_service" . | fromYaml) -}}
{{- if .Values.manifests.certificates -}}
{{- $_ := set $ksServiceJob "tlsSecret" .Values.secrets.tls.network.server.internal -}}
{{- end -}}

View File

@ -12,8 +12,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.ks_user" }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-1"
{{- end }}
{{- if .Values.manifests.job_ks_user }}
{{- $ksUserJob := dict "envAll" . "serviceName" "neutron" -}}
{{- $ksUserJob := dict "envAll" . "serviceName" "neutron" "jobAnnotations" (include "metadata.annotations.job.ks_user" . | fromYaml) -}}
{{- if .Values.manifests.certificates -}}
{{- $_ := set $ksUserJob "tlsSecret" .Values.secrets.tls.network.server.internal -}}
{{- end -}}

View File

@ -11,7 +11,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "metadata.annotations.job.rabbit_init" }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-4"
{{- end }}
{{- if .Values.manifests.job_rabbit_init }}
{{- $rmqUserJob := dict "envAll" . "serviceName" "neutron" -}}
{{- $rmqUserJob := dict "envAll" . "serviceName" "neutron" "jobAnnotations" (include "metadata.annotations.job.rabbit_init" . | fromYaml) -}}
{{ $rmqUserJob | include "helm-toolkit.manifests.job_rabbit_init" }}
{{- end }}

View File

@ -11,3 +11,4 @@ neutron:
- 0.1.8 Revert Change Issuer to ClusterIssuer
- 0.1.9 Update ovs agent to support host/label overrides
- 0.1.10 Change Issuer to ClusterIssuer
- 0.1.11 Added the helm.sh/hook, helm.sh/hook-weight annotations