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 Dec 11, 2024
1 parent b8eedb0 commit daa2d69
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERRAFORM ?= $(shell command -v terraform)

# These images either do something with Alpine,
# or are somehow incompatible with tfgen (still using tagger etc.)
TFGEN_SKIP ?= busybox,git,harbor,k3s,maven,static
TFGEN_SKIP ?= busybox,git,harbor,maven,static

# These are the tfgen generators applied to this repo (in order)
TFGEN_GENERATORS ?= Image01Variables,Image02Outputs,Toplevel01Modules,Toplevel02Outputs
Expand Down
10 changes: 10 additions & 0 deletions generated.tf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions images/k3s/aio.tf

This file was deleted.

3 changes: 2 additions & 1 deletion images/k3s/config/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "accts" {
source = "../../../tflib/accts"
run-as = 0
source = "../../../tflib/accts"
}

variable "extra_packages" {
Expand Down Expand Up @@ -81,3 +81,4 @@ output "config" {
}
})
}

12 changes: 12 additions & 0 deletions images/k3s/generated.tf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions images/k3s/k3s.tf
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
module "config" {
extra_packages = ["k3s", "containerd-shim-runc-v2~1"]
source = "./config"
extra_packages = ["k3s"]
}

module "latest" {
source = "../../tflib/publisher"
name = basename(path.module)
target_repository = var.target_repository
config = module.config.config
build-dev = true
main_package = "k3s"
config = module.config.config
extra_dev_packages = ["bash-completion"]
main_package = "k3s"
name = basename(path.module)
source = "../../tflib/publisher"
target_repository = var.target_repository
}

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

module "tagger" {
source = "../../tflib/tagger"
depends_on = [module.test-latest]
tags = {
"latest" : module.latest.image_ref,
"latest-dev" : module.latest.dev_ref,
}
source = "../../tflib/tagger"
tags = module.latest.latest_tag_map
}

1 change: 1 addition & 0 deletions images/k3s/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
variable "target_repository" {
description = "The docker repo into which the image and attestations should be published."
}

1 change: 1 addition & 0 deletions images/k3s/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ keywords:
tier: APPLICATION
aliases:
- rancher/k3s:latest
public: true
23 changes: 9 additions & 14 deletions images/k3s/static.tf
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
module "config-static" {
source = "./config"
extra_packages = ["k3s-static"]
source = "./config"
}

module "latest-static" {
source = "../../tflib/publisher"
name = basename(path.module)
target_repository = "${var.target_repository}-static"
config = module.config-static.config
build-dev = true
main_package = "k3s-static"
config = module.config-static.config
extra_dev_packages = ["bash-completion"]
main_package = "k3s-static"
name = basename(path.module)
source = "../../tflib/publisher"
target_repository = "${var.target_repository}-static"
}

# Statically linked checks are performed at the package level, so just verify
# the same functionality as the regular image here.
module "test-latest-static" {
source = "./tests"
digest = module.latest-static.image_ref
source = "./tests"
}

module "tagger-static" {
source = "../../tflib/tagger"
depends_on = [module.test-latest-static]
tags = {
"latest" : module.latest-static.image_ref,
"latest-dev" : module.latest-static.dev_ref,
}
source = "../../tflib/tagger"
tags = module.latest-static.latest_tag_map
}

1 change: 1 addition & 0 deletions images/k3s/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ data "oci_exec_test" "test" {
digest = var.digest
script = "${path.module}/smoke.sh"
}

1 change: 0 additions & 1 deletion images/k3s/tests/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ uid="k3s-$FREE_PORT"
TMPDIR=$uid
mkdir -p $TMPDIR

# Simple test to make sure the server comes up and has running pods after ~1m
docker run --name "$uid" -d --rm -it --privileged \
-p $FREE_PORT:$FREE_PORT \
-v $(pwd)/$TMPDIR:/etc/rancher/k3s/ \
Expand Down
5 changes: 0 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ module "git" {
target_repository = "${var.target_repository}/git"
}

module "k3s" {
source = "./images/k3s"
target_repository = "${var.target_repository}/k3s"
}

module "maven" {
source = "./images/maven"
target_repository = "${var.target_repository}/maven"
Expand Down

0 comments on commit daa2d69

Please sign in to comment.