From 4f8b5cc00de877ec31144f263ff5f67d3c02a5de Mon Sep 17 00:00:00 2001
From: "James E. Blair" <jeblair@redhat.com>
Date: Thu, 9 Jan 2020 08:20:51 -0800
Subject: [PATCH] Test helm charts against k8s

Depends-On: https://review.opendev.org/701874
Change-Id: Idadf7c32022ef253ae0f855e0133f115deac3081
---
 charts/nodepool/Chart.yaml           |  2 +-
 charts/zuul-system/Chart.yaml        |  7 +++++++
 charts/zuul-system/requirements.yaml |  8 ++++++++
 charts/zuul-system/values.yaml       | 15 +++++++++++++++
 playbooks/functional/run.yaml        |  6 ++++++
 zuul.d/project.yaml                  | 11 +++++++++++
 6 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 charts/zuul-system/Chart.yaml
 create mode 100644 charts/zuul-system/requirements.yaml
 create mode 100644 charts/zuul-system/values.yaml
 create mode 100644 playbooks/functional/run.yaml

diff --git a/charts/nodepool/Chart.yaml b/charts/nodepool/Chart.yaml
index da75d89..2c39f83 100644
--- a/charts/nodepool/Chart.yaml
+++ b/charts/nodepool/Chart.yaml
@@ -4,4 +4,4 @@ name: nodepool
 description: Nodepool is a system for managing test node resources.
 home: https://zuul-ci.org/docs/nodepool/
 appVersion: 3.10.0
-version: 0.0.1
+version: 0.0.0
diff --git a/charts/zuul-system/Chart.yaml b/charts/zuul-system/Chart.yaml
new file mode 100644
index 0000000..678b32b
--- /dev/null
+++ b/charts/zuul-system/Chart.yaml
@@ -0,0 +1,7 @@
+---
+apiVersion: v1
+name: zuul-system
+description: Full distribution of Zuul
+home: https://zuul-ci.org/
+appVersion: 3.14.0
+version: 0.0.0
diff --git a/charts/zuul-system/requirements.yaml b/charts/zuul-system/requirements.yaml
new file mode 100644
index 0000000..a1c0752
--- /dev/null
+++ b/charts/zuul-system/requirements.yaml
@@ -0,0 +1,8 @@
+---
+dependencies:
+- name: zookeeper
+  version: 2.1.3
+  repository: http://storage.googleapis.com/kubernetes-charts-incubator
+- name: nodepool
+  version: 0.0.0
+  repository: file://../nodepool
diff --git a/charts/zuul-system/values.yaml b/charts/zuul-system/values.yaml
new file mode 100644
index 0000000..5fdd67b
--- /dev/null
+++ b/charts/zuul-system/values.yaml
@@ -0,0 +1,15 @@
+---
+zookeeper:
+  fullnameOverride: zookeeper
+
+nodepool:
+  config:
+    labels: []
+    providers: []
+    diskimages: []
+    zookeeper-servers:
+    - host: zookeeper
+      port: 2181
+
+  clouds: {}
+  extraFiles: {}
diff --git a/playbooks/functional/run.yaml b/playbooks/functional/run.yaml
new file mode 100644
index 0000000..5afedf3
--- /dev/null
+++ b/playbooks/functional/run.yaml
@@ -0,0 +1,6 @@
+- hosts: all
+  roles:
+    - role: helm-template
+      vars:
+        helm_release_name: zuul-system
+        helm_chart: ./charts/zuul-system
diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml
index 88f7a9e..30c9256 100644
--- a/zuul.d/project.yaml
+++ b/zuul.d/project.yaml
@@ -1,7 +1,18 @@
+- job:
+    name: zuul-helm-functional
+    parent: apply-helm-charts
+    run: playbooks/functional/run.yaml
+    vars:
+      minikube_dns_resolvers: ['1.1.1.1', '8.8.8.8']
+      helm_charts:
+        nodepool: ./charts/nodepool
+
 - project:
     check:
       jobs:
         - chart-testing-lint
+        - zuul-helm-functional
     gate:
       jobs:
         - chart-testing-lint
+        - zuul-helm-functional
\ No newline at end of file