From b78bbf8e835cf9bd3f1b73bea1d7d67680f451fc Mon Sep 17 00:00:00 2001 From: Michal Ptacek Date: Wed, 29 May 2019 14:56:50 +0000 Subject: Changing patchfile naming convention Its not needed to preserve onap release version in patch naming. Change-Id: I8dfaa56d3a74cd5227523c3acd5e31fa540a75a2 Issue-ID: OOM-1869 Signed-off-by: Michal Ptacek --- patches/dublin.patch | 41 --------------------------- patches/onap-dublin-patch-role/tasks/main.yml | 36 ----------------------- patches/onap-patch-role/tasks/main.yml | 36 +++++++++++++++++++++++ patches/onap.patch | 41 +++++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 77 deletions(-) delete mode 100644 patches/dublin.patch delete mode 100644 patches/onap-dublin-patch-role/tasks/main.yml create mode 100644 patches/onap-patch-role/tasks/main.yml create mode 100644 patches/onap.patch (limited to 'patches') diff --git a/patches/dublin.patch b/patches/dublin.patch deleted file mode 100644 index 05e217e7..00000000 --- a/patches/dublin.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/kubernetes/oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh b/kubernetes/oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh -index c87a26b..79ad921 100644 ---- a/kubernetes/oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh -+++ b/kubernetes/oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh -@@ -1,4 +1,10 @@ - #!/bin/sh --pip install flask --pip install requests -+ -+# for some reason DNS is not working properly on this pod -+# therefore we need to explicitly add record just for -+# the purpose of this script -+HOSTS_FILE_RECORD >> /etc/hosts -+ -+pip install -i https://nexus3.onap.org/repository/pypi-private/simple/ --trusted-host nexus3.onap.org flask -+pip install -i https://nexus3.onap.org/repository/pypi-private/simple/ --trusted-host nexus3.onap.org requests - python /share/etc/config/mock.py --- - -diff --git a/kubernetes/common/dgbuilder/templates/deployment.yaml b/kubernetes/common/dgbuilder/templates/deployment.yaml -index 353c231..cf38409 100644 ---- a/kubernetes/common/dgbuilder/templates/deployment.yaml -+++ b/kubernetes/common/dgbuilder/templates/deployment.yaml -@@ -49,8 +49,12 @@ spec: - - name: {{ include "common.name" . }} - image: "{{ include "common.repository" . }}/{{ .Values.image }}" - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} -- command: ["/bin/bash"] -- args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"] -+ command: -+ - /bin/bash -+ - -c -+ - > -+ NPM_REGISTRY_RECORD; -+ cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait - ports: - - containerPort: {{ .Values.service.internalPort }} - readinessProbe: --- -1.8.3.1 - diff --git a/patches/onap-dublin-patch-role/tasks/main.yml b/patches/onap-dublin-patch-role/tasks/main.yml deleted file mode 100644 index fb81f200..00000000 --- a/patches/onap-dublin-patch-role/tasks/main.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -# This role contains patching logic for OOM charts -# and is valid until OOM-1610 is implemented -- name: Check presence of files for NPM patching - stat: - path: "{{ app_helm_charts_infra_directory }}/{{ item }}" - with_items: - - common/dgbuilder/templates/deployment.yaml - register: npm_files_check - -- name: Check presence of files for nexus domain resolving - stat: - path: "{{ app_helm_charts_infra_directory }}/{{ item }}" - with_items: - - oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh - register: hosts_files_check - -- name: Patch OOM - set npm registry - lineinfile: - path: "{{ item.stat.path }}" - regexp: '^(.*)NPM_REGISTRY_RECORD' - line: '\g<1>npm set registry "http://nexus.{{ ansible_nodename }}/repository/npm-private/";' - backrefs: yes - state: present - with_items: "{{ npm_files_check.results }}" - when: item.stat.exists - -- name: Patch OOM - nexus domain resolving - lineinfile: - path: "{{ item.stat.path }}" - regexp: '^(.*)HOSTS_FILE_RECORD' - line: '\g<1>{{ cluster_ip }} {{ simulated_hosts.nexus | join(" ") }} >> /etc/hosts;' - backrefs: yes - state: present - with_items: "{{ hosts_files_check.results }}" - when: item.stat.exists diff --git a/patches/onap-patch-role/tasks/main.yml b/patches/onap-patch-role/tasks/main.yml new file mode 100644 index 00000000..fb81f200 --- /dev/null +++ b/patches/onap-patch-role/tasks/main.yml @@ -0,0 +1,36 @@ +--- +# This role contains patching logic for OOM charts +# and is valid until OOM-1610 is implemented +- name: Check presence of files for NPM patching + stat: + path: "{{ app_helm_charts_infra_directory }}/{{ item }}" + with_items: + - common/dgbuilder/templates/deployment.yaml + register: npm_files_check + +- name: Check presence of files for nexus domain resolving + stat: + path: "{{ app_helm_charts_infra_directory }}/{{ item }}" + with_items: + - oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh + register: hosts_files_check + +- name: Patch OOM - set npm registry + lineinfile: + path: "{{ item.stat.path }}" + regexp: '^(.*)NPM_REGISTRY_RECORD' + line: '\g<1>npm set registry "http://nexus.{{ ansible_nodename }}/repository/npm-private/";' + backrefs: yes + state: present + with_items: "{{ npm_files_check.results }}" + when: item.stat.exists + +- name: Patch OOM - nexus domain resolving + lineinfile: + path: "{{ item.stat.path }}" + regexp: '^(.*)HOSTS_FILE_RECORD' + line: '\g<1>{{ cluster_ip }} {{ simulated_hosts.nexus | join(" ") }} >> /etc/hosts;' + backrefs: yes + state: present + with_items: "{{ hosts_files_check.results }}" + when: item.stat.exists diff --git a/patches/onap.patch b/patches/onap.patch new file mode 100644 index 00000000..05e217e7 --- /dev/null +++ b/patches/onap.patch @@ -0,0 +1,41 @@ +diff --git a/kubernetes/oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh b/kubernetes/oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh +index c87a26b..79ad921 100644 +--- a/kubernetes/oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh ++++ b/kubernetes/oof/charts/oof-cmso/charts/oof-cmso-service/resources/config/msosimulator.sh +@@ -1,4 +1,10 @@ + #!/bin/sh +-pip install flask +-pip install requests ++ ++# for some reason DNS is not working properly on this pod ++# therefore we need to explicitly add record just for ++# the purpose of this script ++HOSTS_FILE_RECORD >> /etc/hosts ++ ++pip install -i https://nexus3.onap.org/repository/pypi-private/simple/ --trusted-host nexus3.onap.org flask ++pip install -i https://nexus3.onap.org/repository/pypi-private/simple/ --trusted-host nexus3.onap.org requests + python /share/etc/config/mock.py +-- + +diff --git a/kubernetes/common/dgbuilder/templates/deployment.yaml b/kubernetes/common/dgbuilder/templates/deployment.yaml +index 353c231..cf38409 100644 +--- a/kubernetes/common/dgbuilder/templates/deployment.yaml ++++ b/kubernetes/common/dgbuilder/templates/deployment.yaml +@@ -49,8 +49,12 @@ spec: + - name: {{ include "common.name" . }} + image: "{{ include "common.repository" . }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} +- command: ["/bin/bash"] +- args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"] ++ command: ++ - /bin/bash ++ - -c ++ - > ++ NPM_REGISTRY_RECORD; ++ cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait + ports: + - containerPort: {{ .Values.service.internalPort }} + readinessProbe: +-- +1.8.3.1 + -- cgit 1.2.3-korg