Skip to content

Commit

Permalink
fix jenkins imagetest_harness_k3s compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Jamon <[email protected]>
  • Loading branch information
jamonation committed Apr 13, 2024
1 parent b5efd0f commit 1c194e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
4 changes: 1 addition & 3 deletions images/jenkins/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ module "latest" {

module "test-latest" {
source = "./tests"
digests = {
controller = module.latest.image_ref
}
digest = module.latest.image_ref
}

resource "oci_tag" "latest" {
Expand Down
8 changes: 4 additions & 4 deletions images/jenkins/tests/controller/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@


// default values - these get overridden when the resource is called
variable "values" {
type = any
default = {
namespace = "jenkins"
fullnameOverride = "jenkins"
nameOverride = "jenkins"
create_namespace = true

nameOverride = "jenkins"
controller = {
javaOpts = "-Djenkins.security.FIPS140.COMPLIANCE=true"
javaOpts = ""
jenkinsOpts = ""
admin = {
createSecret = false
Expand Down
23 changes: 7 additions & 16 deletions images/jenkins/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ locals {
namespace = "jenkins"
}

variable "digests" {
variable "digest" {
description = "The image digest to run tests over."
type = object({
controller = string
})
}

data "oci_string" "ref" {
for_each = var.digests
input = each.value
}
data "oci_string" "ref" { input = var.digest }

data "imagetest_inventory" "this" {}

Expand All @@ -28,9 +22,6 @@ resource "imagetest_harness_k3s" "this" {
inventory = data.imagetest_inventory.this

sandbox = {
envs = {
"UNUSED_NAMESPACE" = local.namespace
}
mounts = [
{
source = path.module
Expand All @@ -44,12 +35,12 @@ module "helm_controller" {
source = "./controller"
values = {
namespace = local.namespace
create_namespace = true
fullnameOverride = local.namespace
nameOverride = local.namespace
create_namespace = true

controller = {
javaOpts = "-Djenkins.security.FIPS140.COMPLIANCE=true"
javaOpts = ""
jenkinsOpts = ""
installPlugins = false
admin = {
Expand All @@ -61,9 +52,9 @@ module "helm_controller" {
}
}
image = {
registry = data.oci_string.ref["controller"].registry
repository = data.oci_string.ref["controller"].repo
tag = data.oci_string.ref["controller"].pseudo_tag
registry = data.oci_string.ref.registry
repository = data.oci_string.ref.repo
tag = data.oci_string.ref.pseudo_tag
}
}
}
Expand Down

0 comments on commit 1c194e0

Please sign in to comment.