Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions klone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,55 @@ targets:
- folder_name: generate-verify
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/generate-verify
- folder_name: go
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/go
- folder_name: helm
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/helm
- folder_name: help
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/help
- folder_name: kind
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/kind
- folder_name: klone
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/klone
- folder_name: licenses
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/licenses
- folder_name: oci-build
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/oci-build
- folder_name: oci-publish
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/oci-publish
- folder_name: repository-base
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/repository-base
- folder_name: tools
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: 7d4704c80a09d46e1ebf5d6dfd656f758da5cd0f
repo_hash: 37f3841a157ca7a3ab4596a14ea603579a703378
repo_path: modules/tools
2 changes: 1 addition & 1 deletion make/_shared/go/base/.github/workflows/govulncheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
make print-go-version >> "$GITHUB_OUTPUT"

- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ steps.go-version.outputs.result }}

Expand Down
14 changes: 2 additions & 12 deletions make/_shared/helm/crds.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ crds_template_include_pattern := *.yaml
# Space-separated list of basenames to exclude (e.g. foo.yaml *_test.yaml)
crds_template_exclude_pattern ?=

define filter-out-basenames
$(if $(strip $(2)), \
$(foreach f,$(1),$(if $(filter $(2),$(notdir $(f))),,$(f))), \
$(1))
endef

.PHONY: generate-crds
## Generate CRD manifests.
## @category [shared] Generate/ Verify
Expand All @@ -66,12 +60,8 @@ generate-crds: | $(NEEDS_CONTROLLER-GEN) $(NEEDS_YQ)

@echo "Updating CRDs with helm templating, writing to $(helm_chart_source_dir)/templates"

$(eval crds_gen_temp_all_files := $(wildcard $(crds_gen_temp)/$(crds_template_include_pattern)))
$(eval crds_gen_temp_files := $(if $(crds_template_exclude_pattern), \
$(call filter-out-basenames,$(crds_gen_temp_all_files),$(crds_template_exclude_pattern)), \
$(crds_gen_temp_all_files)))

@for f in $(crds_gen_temp_files); do \
@# List files at shell time: make expands the recipe before controller-gen runs.
@for f in $$(find $(crds_gen_temp) -maxdepth 1 -name '$(crds_template_include_pattern)' $(foreach p,$(crds_template_exclude_pattern),! -name '$(p)')); do \
crd_name=$$($(YQ) eval '.metadata.name' $$f); \
crd_template_file="$(helm_chart_source_dir)/templates/crd-$$(basename $$f)"; \
cat $(crd_template_header) > $$crd_template_file; \
Expand Down
59 changes: 31 additions & 28 deletions make/_shared/helm/helm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -129,50 +129,53 @@ $(bin_dir)/scratch/kyverno:
@mkdir -p $@

# The commit of kyverno/policies to build the pod-security policies from.
# Pinned because https://github.com/kyverno/policies/pull/1544 deleted pod-security/
# from main; it was superseded by the CEL policies in pod-security-vpol/, see
# https://github.com/kyverno/policies/issues/1543.
#
# This is the tip of the release-1.19 branch, one of the last commits that still
# has pod-security/. The branch name does not matter: the pod-security/ bundle is
# identical on every release branch from release-1.12 to release-1.19, and each
# policy declares kyverno 1.6.0 as its minimum version. The release branches are
# snapshots for the kyverno.io website, not compatibility boundaries. So this
# does not need to change when the kyverno tool in modules/tools is bumped.
kyverno_policies_version := ef9843f08d25b3555fe69616f8612c9f915af5d4
# These are the CEL ValidatingPolicy resources in pod-security-vpol/. They
# replaced the ClusterPolicy resources in pod-security/, which the kyverno CLI
# refuses to load since v1.20.0. See https://github.com/kyverno/policies/issues/1543.
#
# kyverno/policies has no tags, so this is a commit on its main branch. The
# policies declare kyverno 1.19.1 as their minimum version.
kyverno_policies_version := 85554e1ef32b5b1dc83f22d0e26c11917df748b5

# The version is part of the file name, so a change to it builds a new file
# instead of reusing a stale cached one.
kyverno_policy_file := $(bin_dir)/scratch/kyverno/pod-security-policy-$(kyverno_policies_version).yaml

# The restricted bundle does not include the baseline bundle, so build both.
# The file is written to a temporary name first, so a failed download does not
# leave a partial file that Make would treat as up to date.
$(kyverno_policy_file): | $(NEEDS_KUSTOMIZE) $(bin_dir)/scratch/kyverno
@$(KUSTOMIZE) build "https://github.com/kyverno/policies/pod-security/enforce?ref=$(kyverno_policies_version)" > $@
@{ $(KUSTOMIZE) build "https://github.com/kyverno/policies/pod-security-vpol/baseline?ref=$(kyverno_policies_version)" && \
echo "---" && \
$(KUSTOMIZE) build "https://github.com/kyverno/policies/pod-security-vpol/restricted?ref=$(kyverno_policies_version)"; \
} > $@.tmp
@mv $@.tmp $@

# Extra arguments for kyverno apply.
kyverno_apply_extra_args :=
# Allows known policy violations to be skipped by supplying Kyverno policy
# exceptions as a Kyverno YAML resource, e.g.:
# apiVersion: kyverno.io/v2
# apiVersion: policies.kyverno.io/v1
# kind: PolicyException
# metadata:
# name: pod-security-exceptions
# spec:
# exceptions:
# - policyName: disallow-privilege-escalation
# ruleNames:
# - autogen-privilege-escalation
# - policyName: restrict-seccomp-strict
# ruleNames:
# - autogen-check-seccomp-strict
# match:
# any:
# - resources:
# kinds:
# - Deployment
# namespaces:
# - mynamespace
# names:
# - my-deployment
# policyRefs:
# - name: disallow-privilege-escalation
# kind: ValidatingPolicy
# - name: restrict-seccomp-strict
# kind: ValidatingPolicy
# matchConditions:
# - name: my-deployment
# expression: >-
# object.kind == 'Deployment' &&
# object.metadata.namespace == 'mynamespace' &&
# object.metadata.name == 'my-deployment'
#
# An exception applies to a whole policy. To allow only certain values or
# images, see
# https://github.com/kyverno/policies/blob/85554e1ef32b5b1dc83f22d0e26c11917df748b5/pod-security-vpol/EXCEPTIONS.md
ifneq ("$(wildcard make/verify-pod-security-standards-exceptions.yaml)","")
kyverno_apply_extra_args += --exceptions make/verify-pod-security-standards-exceptions.yaml
endif
Expand Down
4 changes: 2 additions & 2 deletions make/_shared/oci-build/00_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

# Use distroless as minimal base image to package the manager binary
# To get latest SHA run "crane digest quay.io/jetstack/base-static:latest"
base_image_static := quay.io/jetstack/base-static@sha256:925dd97b8d8cc5a2cda58ca3c82b6ab8f69a9fc2fe7521c2ce4f5c12d4197ac0
base_image_static := quay.io/jetstack/base-static@sha256:5611ab03666fcc960af7d01a06880905315fc24ee9dd52185fcfc0785f11ce0f

# Use custom apko-built image as minimal base image to package the manager binary
# To get latest SHA run "crane digest quay.io/jetstack/base-static-csi:latest"
base_image_csi-static := quay.io/jetstack/base-static-csi@sha256:20af22b55b05ef87aad6355836eac6afbafa22e6831a2269265418dd7549fbfb
base_image_csi-static := quay.io/jetstack/base-static-csi@sha256:05c4e904895f0f96a9363ee67fcbe308c6dc4d333af848d899acad733835d547

# Utility functions
fatal_if_undefined = $(if $(findstring undefined,$(origin $1)),$(error $1 is not set))
Expand Down
6 changes: 6 additions & 0 deletions make/_shared/oci-build/01_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ $(oci_build_targets): oci-build-%: | $(NEEDS_KO) $(NEEDS_GO) $(NEEDS_YQ) $(NEEDS

rm -rf $(CURDIR)/$(layout_path)

# Keep Go's work directories off /tmp, which on ubuntu-26.04 GitHub runners
# is a tmpfs with a ~7.8G quota that a multi-arch build exceeds.
# Why?: https://github.com/actions/runner-images/issues/14777
mkdir -p $(CURDIR)/$(bin_dir)/scratch/image/go_tmp

echo '{}' | \
$(YQ) '.defaultBaseImage = "$(oci_$a_base_image)"' | \
$(YQ) '.builds[0].id = "$a"' | \
Expand All @@ -45,6 +50,7 @@ $(oci_build_targets): oci-build-%: | $(NEEDS_KO) $(NEEDS_GO) $(NEEDS_YQ) $(NEEDS
GOWORK=off \
KO_DOCKER_REPO=$(oci_$a_image_name_development) \
KOCACHE=$(CURDIR)/$(bin_dir)/scratch/image/ko_cache \
GOTMPDIR=$(CURDIR)/$(bin_dir)/scratch/image/go_tmp \
KO_CONFIG_PATH=$(CURDIR)/$(layout_path).ko_config.yaml \
SOURCE_DATE_EPOCH=$(GITEPOCH) \
KO_GO_PATH=$(GO) \
Expand Down
Loading
Loading