generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from cybozu-go/applyconfiggen-aqua
Setup applyconfiguration-gen with aqua
- Loading branch information
Showing
4 changed files
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,10 +59,10 @@ GO_MODULE = $(shell go list -m) | |
API_DIRS = $(shell find api -mindepth 2 -type d | sed "s|^|$(shell go list -m)/|" | paste -sd ",") | ||
AC_PKG = internal/applyconfigurations | ||
.PHONY: generate-applyconfigurations | ||
generate-applyconfigurations: applyconfiguration-gen ## Generate applyconfigurations to support typesafe SSA. | ||
generate-applyconfigurations: setup ## Generate applyconfigurations to support typesafe SSA. | ||
rm -rf $(AC_PKG) | ||
@echo ">> generating $(AC_PKG)..." | ||
$(APPLYCONFIGURATION_GEN) \ | ||
applyconfiguration-gen \ | ||
--go-header-file hack/boilerplate.go.txt \ | ||
--input-dirs "$(API_DIRS)" \ | ||
--output-package "$(GO_MODULE)/$(AC_PKG)" \ | ||
|
@@ -114,6 +114,7 @@ release-build: setup | |
##@ Tools | ||
|
||
setup: | ||
aqua policy allow ./aqua-policy.yaml | ||
aqua i -l | ||
|
||
SETUP_ENVTEST := $(shell pwd)/bin/setup-envtest | ||
|
@@ -123,13 +124,6 @@ $(SETUP_ENVTEST): | |
# see https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest | ||
GOBIN=$(shell pwd)/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
|
||
APPLYCONFIGURATION_GEN := $(shell pwd)/bin/applyconfiguration-gen | ||
.PHONY: applyconfiguration-gen | ||
applyconfiguration-gen: $(APPLYCONFIGURATION_GEN) ## Download applyconfiguration-gen locally if necessary | ||
$(APPLYCONFIGURATION_GEN): | ||
# see https://github.com/kubernetes/code-generator/tree/master/cmd/applyconfiguration-gen | ||
GOBIN=$(shell pwd)/bin go install k8s.io/code-generator/cmd/[email protected] | ||
|
||
# go-get-tool will 'go get' any package $2 and install it to $1. | ||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
define go-get-tool | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
# aqua Policy | ||
# https://aquaproj.github.io/ | ||
registries: | ||
- name: local | ||
type: local | ||
path: registry.yaml | ||
- type: standard | ||
ref: semver(">= 3.0.0") | ||
packages: | ||
- registry: local # allow all packages in the Registry | ||
- registry: standard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ | |
registries: | ||
- type: standard | ||
ref: v4.23.0 # renovate: depName=aquaproj/aqua-registry | ||
- name: local | ||
type: local | ||
path: registry.yaml | ||
packages: | ||
- name: kubernetes/[email protected] | ||
- name: kubernetes-sigs/[email protected] | ||
|
@@ -15,3 +18,5 @@ packages: | |
- name: helm/[email protected] | ||
- name: bitnami-labs/[email protected] | ||
- name: goreleaser/[email protected] | ||
- name: kubernetes/code-generator/[email protected] | ||
registry: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
packages: | ||
- type: go_install | ||
name: kubernetes/code-generator/applyconfiguration-gen | ||
path: k8s.io/code-generator/cmd/applyconfiguration-gen | ||
repo_owner: kubernetes | ||
repo_name: code-generator | ||
description: applyconfiguration-gen is a tool for auto-generating apply configuration functions. | ||
files: | ||
- name: applyconfiguration-gen |