Skip to content

Commit

Permalink
refactor istio to use imagetest_harness_k3s
Browse files Browse the repository at this point in the history
Signed-off-by: Jamon <[email protected]>
  • Loading branch information
jamonation committed Apr 11, 2024
1 parent 984a0e6 commit a559eb7
Show file tree
Hide file tree
Showing 7 changed files with 328 additions and 158 deletions.
3 changes: 0 additions & 3 deletions images/istio/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ variable "target_repository" {
description = "The docker repo into which the image and attestations should be published."
}

resource "random_pet" "suffix" {}

module "test-latest" {
source = "./tests"
digests = {
Expand All @@ -18,7 +16,6 @@ module "test-latest" {
pilot = module.pilot.image_ref
operator = module.operator.image_ref
}
namespace = "istio-system-${random_pet.suffix.id}"
}

resource "oci_tag" "latest" {
Expand Down
33 changes: 33 additions & 0 deletions images/istio/tests/base/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
imagetest = { source = "chainguard-dev/imagetest" }
}
}

variable "values" {
type = any
default = {
global = {
istioNamespace = "istio-system"
}
defaultRevision = ""
}
}

module "helm" {
source = "../../../../tflib/imagetest/helm"

chart = "base"
repo = "https://istio-release.storage.googleapis.com/charts/"

values = var.values
}

output "install_cmd" {
value = module.helm.install_cmd
}

output "release_name" {
value = module.helm.release_name
}
47 changes: 47 additions & 0 deletions images/istio/tests/gateway/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
imagetest = { source = "chainguard-dev/imagetest" }
}
}

variable "values" {
type = any
default = {
revision = "istio"
service = {
type = "ClusterIP"
}
global = {
istioNamespace = "istio-system"
hub = "cgr.dev/chainguard/istio-proxy"
proxy = {
image = "cgr.dev/chainguard/istio-proxy"
}
proxy-init = {
image = "cgr.dev/chainguard/istio-proxy"
}
tag = "latest"
}
version = "1.19.0"
namespace = "istio-system"
}
}

module "helm" {
source = "../../../../tflib/imagetest/helm"

namespace = var.values.namespace
repo = "https://istio-release.storage.googleapis.com/charts/"
chart = "gateway"

values = var.values
}

output "install_cmd" {
value = module.helm.install_cmd
}

output "release_name" {
value = module.helm.release_name
}
44 changes: 44 additions & 0 deletions images/istio/tests/install-cni/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
imagetest = { source = "chainguard-dev/imagetest" }
}
}

variable "values" {
type = any
default = {
revision = "istio"
cni = {
image = "cgr.dev/chainguard/istio-install-cni"
tag = "latest"
cniBinDir = "/var/lib/rancher/k3s/data/current/bin"
cniConfDir = "/var/lib/rancher/k3s/agent/etc/cni/net.d"
}
global = {
hub = "cgr.dev/chainguard/istio-install-cni"
tag = "latest"
}
version = "1.19.0"
namespace = "istio-system"
}
}

module "helm" {
source = "../../../../tflib/imagetest/helm"

namespace = var.values.namespace
name = "istio-cni"
repo = "https://istio-release.storage.googleapis.com/charts/"
chart = "cni"

values = var.values
}

output "install_cmd" {
value = module.helm.install_cmd
}

output "release_name" {
value = module.helm.release_name
}
47 changes: 47 additions & 0 deletions images/istio/tests/istiod/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
terraform {
required_providers {
oci = { source = "chainguard-dev/oci" }
imagetest = { source = "chainguard-dev/imagetest" }
}
}

variable "values" {
type = any
default = {
revision = "istio-system"
pilot = {
image = "cgr.dev/chainguard/istio-pilot"
}
global = {
istioNamespace = "istio-system"
hub = "cgr.dev/chainguard/istio-proxy"
proxy = {
image = "cgr.dev/chainguard/istio-proxy"
}
proxy-init = {
image = "cgr.dev/chainguard/istio-proxy"
}
tag = "latest"
}
version = "1.19.0"
namespace = "istio-system"
}
}

module "helm" {
source = "../../../../tflib/imagetest/helm"

namespace = var.values.namespace
repo = "https://istio-release.storage.googleapis.com/charts/"
chart = "istiod"

values = var.values
}

output "install_cmd" {
value = module.helm.install_cmd
}

output "release_name" {
value = module.helm.release_name
}
Loading

0 comments on commit a559eb7

Please sign in to comment.