Skip to content

Commit

Permalink
automated commit
Browse files Browse the repository at this point in the history
Signed-off-by: Public copy <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 30, 2024
1 parent ea17b47 commit 017cd55
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 230 deletions.
5 changes: 5 additions & 0 deletions images/clang/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "digest" {
description = "The image digest to run tests over."
}

variable "warn_on_failure" {
description = "Whether to fail or warn if the test fails. Used only for EOL images."
default = false
}

data "oci_exec_test" "version" {
digest = var.digest
script = "docker run --rm $IMAGE_NAME --version"
Expand Down
29 changes: 28 additions & 1 deletion images/fluentd/config/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
locals {
plugins = [
"fluent-plugin-elasticsearch",
"fluent-plugin-cloudwatch-logs",
"fluent-plugin-newrelic",
"fluent-plugin-tag-normaliser",
"fluent-plugin-detect-exceptions",
"fluent-plugin-label-router",
"fluent-plugin-prometheus",
"fluent-plugin-record-modifier",
"fluent-plugin-rewrite-tag-filter",
"fluent-plugin-s3",
"fluent-plugin-splunk-hec",
"fluent-plugin-opensearch",
"fluent-plugin-multi-format-parser",
"fluent-plugin-concat",
"fluent-plugin-grok-parser",
"fluent-plugin-kubernetes_metadata_filter",
"fluent-plugin-systemd",
]
}

module "accts" {
name = "fluent"
source = "../../../tflib/accts"
Expand All @@ -14,10 +36,15 @@ variable "extra_packages" {
description = "The additional packages to install (e.g. kubectl-default, kubectl-1.28-default)."
}

output "plugins" {
description = "The list of fluentd plugins"
value = local.plugins
}

output "config" {
value = jsonencode({
"contents" : {
"packages" : var.extra_packages
"packages" : concat(var.extra_packages, local.plugins, ["libpq"])
},
"entrypoint" : {
"command" : "/usr/bin/fluentd"
Expand Down
12 changes: 5 additions & 7 deletions images/kube-logging-operator-fluentd/config/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@ module "accts" {
name = "fluent"
}

module "config-fluentd" {
source = "../../fluentd/config"
}

output "config" {
value = jsonencode({
contents = {
packages = concat(var.extra_packages, [
"libpq",
"fluent-plugin-tag-normaliser",
"fluent-plugin-detect-exceptions",
"fluent-plugin-label-router",
"fluent-plugin-prometheus",
])
packages = concat(var.extra_packages, module.config-fluentd.plugins, ["libpq"])
}
accounts = module.accts.block
entrypoint = var.entrypoint
Expand Down
2 changes: 2 additions & 0 deletions images/kube-logging-operator-fluentd/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module "helm_operator" {
name = "operator"
chart = "oci://ghcr.io/kube-logging/helm-charts/logging-operator"
namespace = "operator"
wait = true

values = {
testReceiver = {
Expand All @@ -54,6 +55,7 @@ module "helm_generator" {
name = "generator"
chart = "oci://ghcr.io/kube-logging/helm-charts/log-generator"
namespace = "generator"
wait = true
}

resource "imagetest_feature" "basic" {
Expand Down
10 changes: 0 additions & 10 deletions images/prometheus-cloudwatch-exporter/tests/cloudwatch-runs.sh

This file was deleted.

201 changes: 0 additions & 201 deletions images/prometheus-cloudwatch-exporter/tests/cloudwatch.yaml

This file was deleted.

18 changes: 9 additions & 9 deletions images/prometheus-cloudwatch-exporter/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ variable "digest" {
description = "The image digest to run tests over."
}

variable "warn_on_failure" {
description = "Whether to fail or warn if the test fails. Used only for EOL images."
default = false
}

variable "extra_testassertlogs" {
description = "Extra test assert logs"
type = list(string)
Expand All @@ -17,12 +22,6 @@ variable "extra_testassertlogs" {

locals { parsed = provider::oci::parse(var.digest) }

data "oci_exec_test" "cloudwatch-runs" {
digest = var.digest
script = "./cloudwatch-runs.sh"
working_dir = path.module
}

data "imagetest_inventory" "this" {}

resource "imagetest_harness_k3s" "k3s" {
Expand All @@ -46,9 +45,10 @@ module "helm" {
}

resource "imagetest_feature" "basic" {
name = "basic"
description = "Basic installation test for prometheus-cloudwatch-exporter helm chart"
harness = imagetest_harness_k3s.k3s
name = "basic"
description = "Basic installation test for prometheus-cloudwatch-exporter helm chart"
harness = imagetest_harness_k3s.k3s
warn_on_failure = var.warn_on_failure

steps = [
{
Expand Down
5 changes: 5 additions & 0 deletions images/python/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "digest" {
description = "The image digest to run tests over."
}

variable "warn_on_failure" {
description = "Whether to fail or warn if the test fails. Used only for EOL images."
default = false
}

variable "check-dev" {
default = false
description = "Whether to check for dev extensions"
Expand Down
7 changes: 6 additions & 1 deletion tflib/publisher/chainguard.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ locals {

// Parse keywords out of from metadata.yaml
metadata_filepath = "images/${var.name}/metadata.yaml"
keywords = fileexists(local.metadata_filepath) ? yamldecode(file(local.metadata_filepath)).keywords : []
metadata_public = fileexists(local.metadata_filepath) ? yamldecode(file(local.metadata_filepath)) : null

keywords = local.metadata_public != null ? local.metadata_public.keywords : []
aliases = local.metadata_public != null ? lookup(local.metadata_public, "aliases", []) : []


// If the repo name ends with "-fips", add "fips" as a keyword (if not already present)
keywords_updated = (endswith(local.repo_name, "-fips") && !contains(local.keywords, "fips")) ? concat(local.keywords, ["fips"]) : local.keywords
Expand All @@ -40,4 +44,5 @@ resource "chainguard_image_repo" "repo" {
name = local.repo_name
// keywords in the metadata file maps to bundles in the Chainguard API
bundles = local.keywords_updated
aliases = local.aliases
}
2 changes: 1 addition & 1 deletion tflib/publisher/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ terraform {
}
chainguard = {
source = "chainguard-dev/chainguard"
version = ">= 0.1.15"
version = ">= 0.1.18"
}
imagetest = {
source = "chainguard-dev/imagetest"
Expand Down

0 comments on commit 017cd55

Please sign in to comment.