summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/mock_files/mock_profiles
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2019-01-23 12:54:50 -0800
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-03-11 22:41:33 -0700
commit2416ab0120bfe15cd3c5ef6cd0bbade288b32e7a (patch)
treed9dafe3b31774d4306b277f583ba578243e34733 /src/k8splugin/mock_files/mock_profiles
parent49a48a37a76201839c9507a970d639a318ba9d3f (diff)
Add support for parsing profile yaml files
Add code to parse profile configuration yaml The parsing function is global and returns a client which can then be used to get or apply specific parts of the configuration on top of an extracted helm chart. P14: Add unit test that covers both ProcessProfileYaml and CopyConfigurationOverrides P15: Adding mock_charts and mock_profiles We expect to reuse these files for other unit tests Issue-ID: ONAPARC-348 Change-Id: I4504d0b158fdfef476b8c2a461d33306926545d7 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/mock_files/mock_profiles')
-rw-r--r--src/k8splugin/mock_files/mock_profiles/profile1/faulty-dest-manifest.yaml7
-rw-r--r--src/k8splugin/mock_files/mock_profiles/profile1/faulty-manifest.yaml8
-rw-r--r--src/k8splugin/mock_files/mock_profiles/profile1/faulty-src-manifest.yaml7
-rw-r--r--src/k8splugin/mock_files/mock_profiles/profile1/manifest.yaml7
-rw-r--r--src/k8splugin/mock_files/mock_profiles/profile1/override_values.yaml9
-rw-r--r--src/k8splugin/mock_files/mock_profiles/profile1/subdir/p1.yaml22
6 files changed, 60 insertions, 0 deletions
diff --git a/src/k8splugin/mock_files/mock_profiles/profile1/faulty-dest-manifest.yaml b/src/k8splugin/mock_files/mock_profiles/profile1/faulty-dest-manifest.yaml
new file mode 100644
index 00000000..8c61a4e4
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_profiles/profile1/faulty-dest-manifest.yaml
@@ -0,0 +1,7 @@
+---
+version: v1
+type:
+ values: "override_values.yaml"
+ configresource:
+ - filepath: subdir/p1.yaml
+ chartpath: testchart1/folderdoesNOTexist/p1.yaml
diff --git a/src/k8splugin/mock_files/mock_profiles/profile1/faulty-manifest.yaml b/src/k8splugin/mock_files/mock_profiles/profile1/faulty-manifest.yaml
new file mode 100644
index 00000000..a123111a
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_profiles/profile1/faulty-manifest.yaml
@@ -0,0 +1,8 @@
+---
+version: v1
+type:
+ values:
+ - override_values.yaml
+ configresource:
+ - filepath: subdir/p1.yaml
+ chartpath: testchart1/templates/p1.yaml
diff --git a/src/k8splugin/mock_files/mock_profiles/profile1/faulty-src-manifest.yaml b/src/k8splugin/mock_files/mock_profiles/profile1/faulty-src-manifest.yaml
new file mode 100644
index 00000000..eff534bb
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_profiles/profile1/faulty-src-manifest.yaml
@@ -0,0 +1,7 @@
+---
+version: v1
+type:
+ values: "override_values.yaml"
+ configresource:
+ - filepath: subdir/filedoesNOTexist.yaml
+ chartpath: testchart1/templates/p1.yaml
diff --git a/src/k8splugin/mock_files/mock_profiles/profile1/manifest.yaml b/src/k8splugin/mock_files/mock_profiles/profile1/manifest.yaml
new file mode 100644
index 00000000..e4beada0
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_profiles/profile1/manifest.yaml
@@ -0,0 +1,7 @@
+---
+version: v1
+type:
+ values: "override_values.yaml"
+ configresource:
+ - filepath: subdir/p1.yaml
+ chartpath: testchart1/templates/p1.yaml
diff --git a/src/k8splugin/mock_files/mock_profiles/profile1/override_values.yaml b/src/k8splugin/mock_files/mock_profiles/profile1/override_values.yaml
new file mode 100644
index 00000000..0186c662
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_profiles/profile1/override_values.yaml
@@ -0,0 +1,9 @@
+# Default values for subchart.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+# subchart1
+service:
+ name: nginx
+ type: ClusterIP
+ externalPort: 8080
+ internalPort: 8080 \ No newline at end of file
diff --git a/src/k8splugin/mock_files/mock_profiles/profile1/subdir/p1.yaml b/src/k8splugin/mock_files/mock_profiles/profile1/subdir/p1.yaml
new file mode 100644
index 00000000..2dad677a
--- /dev/null
+++ b/src/k8splugin/mock_files/mock_profiles/profile1/subdir/p1.yaml
@@ -0,0 +1,22 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ .Chart.Name }}-override
+ labels:
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ namespace: "{{ .Release.Namespace }}"
+ release-name: "{{ .Release.Name }}"
+ release-is-upgrade: "{{ .Release.IsUpgrade }}"
+ release-is-install: "{{ .Release.IsInstall }}"
+ kube-version/major: "{{ .Capabilities.KubeVersion.Major }}"
+ kube-version/minor: "{{ .Capabilities.KubeVersion.Minor }}"
+ kube-version/gitversion: "v{{ .Capabilities.KubeVersion.Major }}.{{ .Capabilities.KubeVersion.Minor }}.0"
+spec:
+ type: {{ .Values.service.type }}
+ ports:
+ - port: {{ .Values.service.externalPort }}
+ targetPort: {{ .Values.service.internalPort }}
+ protocol: TCP
+ name: {{ .Values.service.name }}
+ selector:
+ app: {{ .Chart.Name }}