summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2021-07-16 20:38:55 +0000
committerMichal Jagiello <michal.jagiello@t-mobile.pl>2021-07-16 21:17:09 +0000
commit7db71adaf139e54f2186cfd19d468f5a1123835d (patch)
treee56401407d5f71313926f38700075e93919fd0c3
parentcbc2bdb1bca9475c3dcbe7782f838b121979a3ea (diff)
Refactor cds-mockserver helm chartjakartaistanbul
I did some changes to run that helm chart in integration tests using multicloud-k8s. * I renamed helm/ directory into cds-mockserver/ based on "helm lint" * I changed Deployment apiVersion to "apps/v1" due to "extensions/v1beta1" deprecation [1] * I added "selector" into Deployment because it's required for "apps/v1" version [2] Add missing .coafile, .yamllint and tox.ini files [1] https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/ [2] https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#label-selector-updates Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Issue-ID: TEST-291 Change-Id: Ibe1fc564f3db9933071a9374d0c583724fbcf08d
-rw-r--r--.coafile5
-rw-r--r--.yamllint16
-rw-r--r--cds-mockserver/Chart.yaml (renamed from helm/Chart.yaml)0
-rw-r--r--cds-mockserver/templates/_templates.tpl (renamed from helm/templates/_templates.tpl)0
-rw-r--r--cds-mockserver/templates/deployment.yaml (renamed from helm/templates/deployment.yaml)5
-rw-r--r--cds-mockserver/templates/service.yaml (renamed from helm/templates/service.yaml)0
-rw-r--r--cds-mockserver/values.yaml (renamed from helm/values.yaml)0
-rw-r--r--tox.ini22
8 files changed, 47 insertions, 1 deletions
diff --git a/.coafile b/.coafile
new file mode 100644
index 0000000..51f6028
--- /dev/null
+++ b/.coafile
@@ -0,0 +1,5 @@
+[yaml]
+bears = YAMLLintBear
+yamllint_config = .yamllint
+ignore =
+ .tox/**,
diff --git a/.yamllint b/.yamllint
new file mode 100644
index 0000000..ab5bdc3
--- /dev/null
+++ b/.yamllint
@@ -0,0 +1,16 @@
+---
+
+extends: default
+
+rules:
+ line-length: disable
+ truthy: disable
+ braces:
+ max-spaces-inside: 1
+ brackets:
+ max-spaces-inside: 1
+ comments-indentation: disable
+ comments: disable
+ document-start: disable
+ indentation:
+ indent-sequences: whatever
diff --git a/helm/Chart.yaml b/cds-mockserver/Chart.yaml
index 299359e..299359e 100644
--- a/helm/Chart.yaml
+++ b/cds-mockserver/Chart.yaml
diff --git a/helm/templates/_templates.tpl b/cds-mockserver/templates/_templates.tpl
index 3e92baf..3e92baf 100644
--- a/helm/templates/_templates.tpl
+++ b/cds-mockserver/templates/_templates.tpl
diff --git a/helm/templates/deployment.yaml b/cds-mockserver/templates/deployment.yaml
index 95a83dd..11b9947 100644
--- a/helm/templates/deployment.yaml
+++ b/cds-mockserver/templates/deployment.yaml
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "common.fullname" . }}
@@ -23,6 +23,9 @@ metadata:
release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
spec:
+ selector:
+ matchLabels:
+ app: {{ include "common.name" . }}
replicas: {{ .Values.replicaCount }}
strategy:
type: RollingUpdate
diff --git a/helm/templates/service.yaml b/cds-mockserver/templates/service.yaml
index 5701aca..5701aca 100644
--- a/helm/templates/service.yaml
+++ b/cds-mockserver/templates/service.yaml
diff --git a/helm/values.yaml b/cds-mockserver/values.yaml
index 8418963..8418963 100644
--- a/helm/values.yaml
+++ b/cds-mockserver/values.yaml
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..5c1461f
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,22 @@
+[tox]
+minversion = 3.2.0
+envlist = yaml
+skipsdist = true
+requires = pip >= 8
+
+[testenv]
+basepython = python3
+whitelist_externals =
+ git
+ bash
+deps =
+ coala-bears
+ nodeenv
+
+[testenv:yaml]
+commands_pre =
+ /bin/sh -c "git --no-pager diff HEAD HEAD^ --name-only '*.yaml' '*.yml' > /tmp/.coalist_yaml"
+commands =
+# '\ ' at the end of command is needed for a case where above command returns empty list (it adds empty file
+# parameter to '--files' opt
+ /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn yaml --files $(</tmp/.coalist_yaml) \ " \ No newline at end of file