def test_fetch_helm_chart_version_that_does_not_exist(self):
     """
     Test fetching helm chart version that does not exist
     """
     temp_dir = tempfile.mkdtemp()
     output_dir = tempfile.mkdtemp()
     output_chart_dir = os.path.join(output_dir, "charts", "prometheus")
     chart_name = "prometheus"
     version = "10.7.0"
     repo = "https://github.com/BurdenBear/kube-charts-mirror/raw/master/docs/"
     dep = [{
         "output_path": output_chart_dir,
         "version": version,
         "chart_name": chart_name,
         "source": repo,
     }]
     with self.assertRaises(HelmFetchingError):
         fetch_helm_chart(
             (HelmSource(repo, chart_name, version, None), dep),
             temp_dir,
             force=False)
     self.assertFalse(os.path.isdir(output_chart_dir))
     self.assertFalse(
         os.path.isfile(os.path.join(output_chart_dir, "Chart.yaml")))
     rmtree(temp_dir)
     rmtree(output_dir)
 def test_fetch_helm_chart(self):
     """
     Tests fetching helm chart
     """
     temp_dir = tempfile.mkdtemp()
     output_dir = tempfile.mkdtemp()
     output_chart_dir = os.path.join(output_dir, "charts", "prometheus")
     chart_name = "prometheus"
     version = "11.3.0"
     repo = "https://github.com/BurdenBear/kube-charts-mirror/raw/master/docs/"
     dep = [{
         "output_path": output_chart_dir,
         "version": version,
         "chart_name": chart_name,
         "source": repo,
     }]
     fetch_helm_chart((HelmSource(repo, chart_name, version, None), dep),
                      temp_dir,
                      force=False)
     self.assertTrue(os.path.isdir(output_chart_dir))
     self.assertTrue(
         os.path.isfile(os.path.join(output_chart_dir, "Chart.yaml")))
     self.assertTrue(
         os.path.isdir(
             os.path.join(output_chart_dir, "charts",
                          "kube-state-metrics")))
     rmtree(temp_dir)
     rmtree(output_dir)
예제 #3
0
 def test_fetch_helm_chart(self):
     """
     Tests fetching helm chart
     """
     output_dir = tempfile.mkdtemp()
     output_chart_dir = os.path.join(output_dir, "charts", "prometheus")
     chart_name = "prometheus"
     version = "11.3.0"
     unique_chart_name = chart_name + "-" + version
     dep = [{
         "output_path":
         output_chart_dir,
         "version":
         version,
         "chart_name":
         chart_name,
         "source":
         "https://github.com/BurdenBear/kube-charts-mirror/raw/master/docs/",
     }]
     fetch_helm_chart((unique_chart_name, dep))
     self.assertTrue(os.path.isdir(output_chart_dir))
     self.assertTrue(
         os.path.isfile(os.path.join(output_chart_dir, "Chart.yaml")))
     self.assertTrue(
         os.path.isdir(
             os.path.join(output_chart_dir, "charts",
                          "kube-state-metrics")))
     rmtree(output_dir)
예제 #4
0
 def test_fetch_helm_chart_version_that_does_not_exist(self):
     temp_dir = tempfile.mkdtemp()
     output_dir = tempfile.mkdtemp()
     output_chart_dir = os.path.join(output_dir, "charts", "prometheus")
     chart_name = "prometheus"
     version = "10.7.0"
     unique_chart_name = chart_name + "-" + version
     dep = [{
         "output_path": output_chart_dir,
         "version": version,
         "chart_name": chart_name,
         "source": "https://kubernetes-charts.storage.googleapis.com",
     }]
     fetch_helm_chart((unique_chart_name, dep), temp_dir)
     self.assertFalse(os.path.isdir(output_chart_dir))
     self.assertFalse(
         os.path.isfile(os.path.join(output_chart_dir, "Chart.yaml")))
예제 #5
0
 def test_fetch_helm_chart_version_that_does_not_exist(self):
     """
     Test fetching helm chart version that does not exist
     Runs $ kapitan compile --fetch --output-path temp -t nginx nginx-dev monitoring-dev
     """
     output_dir = tempfile.mkdtemp()
     output_chart_dir = os.path.join(output_dir, "charts", "prometheus")
     chart_name = "prometheus"
     version = "10.7.0"
     unique_chart_name = chart_name + "-" + version
     dep = [{
         "output_path": output_chart_dir,
         "version": version,
         "chart_name": chart_name,
         "source": "https://kubernetes-charts.storage.googleapis.com",
     }]
     fetch_helm_chart((unique_chart_name, dep))
     self.assertFalse(os.path.isdir(output_chart_dir))
     self.assertFalse(
         os.path.isfile(os.path.join(output_chart_dir, "Chart.yaml")))
     rmtree(output_dir)
예제 #6
0
 def test_fetch_helm_chart(self):
     """
     Tests fetching helm chart
     """
     output_dir = tempfile.mkdtemp()
     output_chart_dir = os.path.join(output_dir, "charts", "prometheus")
     chart_name = "prometheus"
     version = "11.3.0"
     unique_chart_name = chart_name + "-" + version
     dep = [{
         "output_path": output_chart_dir,
         "version": version,
         "chart_name": chart_name,
         "source": "https://kubernetes-charts.storage.googleapis.com",
     }]
     fetch_helm_chart((unique_chart_name, dep))
     self.assertTrue(os.path.isdir(output_chart_dir))
     self.assertTrue(
         os.path.isfile(os.path.join(output_chart_dir, "Chart.yaml")))
     self.assertTrue(
         os.path.isdir(
             os.path.join(output_chart_dir, "charts",
                          "kube-state-metrics")))
     rmtree(output_dir)
예제 #7
0
 def test_fetch_helm_chart_version_that_does_not_exist(self):
     """
     Test fetching helm chart version that does not exist
     """
     output_dir = tempfile.mkdtemp()
     output_chart_dir = os.path.join(output_dir, "charts", "prometheus")
     chart_name = "prometheus"
     version = "10.7.0"
     unique_chart_name = chart_name + "-" + version
     dep = [{
         "output_path":
         output_chart_dir,
         "version":
         version,
         "chart_name":
         chart_name,
         "source":
         "https://github.com/BurdenBear/kube-charts-mirror/raw/master/docs/",
     }]
     fetch_helm_chart((unique_chart_name, dep))
     self.assertFalse(os.path.isdir(output_chart_dir))
     self.assertFalse(
         os.path.isfile(os.path.join(output_chart_dir, "Chart.yaml")))
     rmtree(output_dir)