Skip to content

Commit

Permalink
remove duplicate helm targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxesn committed Oct 26, 2023
1 parent 17f6c16 commit 998cea3
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 105 deletions.
44 changes: 24 additions & 20 deletions Common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,13 @@ HELM_TAG?=$(GIT_TAG)-$(GIT_HASH)
HELM_USE_UPSTREAM_IMAGE?=false
# HELM_DIRECTORY must be a relative path from project root to the directory that contains a chart
HELM_DIRECTORY?=.
HELM_DESTINATION_REPOSITORY?=$(IMAGE_COMPONENT)
HELM_IMAGE_LIST?=
HELM_DESTINATION_REPOSITORY?=$(HELM_CHART_NAME)
HELM_IMAGE_LIST?=$(IMAGE_COMPONENT)
HELM_GIT_CHECKOUT_TARGET?=$(HELM_SOURCE_REPOSITORY)/eks-anywhere-checkout-$(HELM_GIT_TAG)
HELM_GIT_PATCH_TARGET?=$(HELM_SOURCE_REPOSITORY)/eks-anywhere-helm-patched
PACKAGE_DEPENDENCIES?=
FORCE_JSON_SCHEMA_FILE?=
HELM_CHART_NAMES?=$(IMAGE_COMPONENT)
####################################################

#### HELPERS ########
Expand Down Expand Up @@ -520,10 +521,10 @@ ifneq ($(REPO_NO_CLONE),true)
$(REPO): | ensure-bash-version
@echo -e $(call TARGET_START_LOG)
ifneq ($(REPO_SPARSE_CHECKOUT),)
source $(BUILD_LIB)/common.sh && retry git clone --depth 1 --filter=blob:none --sparse -b $(GIT_TAG) $(CLONE_URL) $(REPO)
source $(BUILD_LIB)/common.sh && retry git clone --quiet --depth 1 --filter=blob:none --sparse -b $(GIT_TAG) $(CLONE_URL) $(REPO)
git -C $(REPO) sparse-checkout set $(REPO_SPARSE_CHECKOUT) --cone --skip-checks
else
source $(BUILD_LIB)/common.sh && retry git clone $(CLONE_URL) $(REPO)
source $(BUILD_LIB)/common.sh && retry git clone --quiet $(CLONE_URL) $(REPO)
endif
@echo -e $(call TARGET_END_LOG)
endif
Expand Down Expand Up @@ -560,7 +561,7 @@ $(REPO)/%ks-anywhere-go-mod-download: $(if $(PATCHES_DIR),$(GIT_PATCH_TARGET),$(
ifneq ($(REPO),$(HELM_SOURCE_REPOSITORY))
$(HELM_SOURCE_REPOSITORY):
@echo -e $(call TARGET_START_LOG)
source $(BUILD_LIB)/common.sh && retry git clone $(HELM_CLONE_URL) $(HELM_SOURCE_REPOSITORY)
source $(BUILD_LIB)/common.sh && retry git clone --quiet $(HELM_CLONE_URL) $(HELM_SOURCE_REPOSITORY)
@echo -e $(call TARGET_END_LOG)
endif

Expand All @@ -569,7 +570,7 @@ $(HELM_GIT_CHECKOUT_TARGET): | $(HELM_SOURCE_REPOSITORY)
@echo -e $(call TARGET_START_LOG)
@echo rm -f $(HELM_SOURCE_REPOSITORY)/eks-anywhere-*
(cd $(HELM_SOURCE_REPOSITORY) && $(BASE_DIRECTORY)/build/lib/wait_for_tag.sh $(HELM_GIT_TAG))
git -C $(HELM_SOURCE_REPOSITORY) checkout -f $(HELM_GIT_TAG)
git -C $(HELM_SOURCE_REPOSITORY) checkout --quiet -f $(HELM_GIT_TAG)
touch $@
@echo -e $(call TARGET_END_LOG)
endif
Expand Down Expand Up @@ -801,30 +802,33 @@ binary-builder/cgo/%: USE_DOCKER_FOR_CGO_BUILD=$(shell command -v docker &> /dev
helm/pull: | $$(ENABLE_LOGGING)
@$(BUILD_LIB)/helm_pull.sh $(HELM_PULL_LOCATION) $(HELM_REPO_URL) $(HELM_PULL_NAME) $(REPO) $(HELM_DIRECTORY) $(CHART_VERSION) $(COPY_CRDS)

.PHONY: %/helm/copy %/helm/require %/helm/replace %/helm/build %/helm/push
%/helm/copy %/helm/require %/helm/replace %/helm/build %/helm/push: HELM_CHART_NAME=$*

.PHONY: helm/copy helm/require helm/replace helm/build helm/push

helm/copy: $(LICENSES_TARGETS_FOR_PREREQ)
helm/copy: $(if $(filter true,$(REPO_NO_CLONE)),,$(HELM_GIT_CHECKOUT_TARGET))
helm/copy: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),) | ensure-helm ensure-skopeo $$(ENABLE_LOGGING)
%/helm/copy: $(LICENSES_TARGETS_FOR_PREREQ)
%/helm/copy: $(if $(filter true,$(REPO_NO_CLONE)),,$(HELM_GIT_CHECKOUT_TARGET))
%/helm/copy: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),) | ensure-helm ensure-skopeo $$(ENABLE_LOGGING)
@$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR)

helm/require: helm/copy | $$(ENABLE_LOGGING)
%/helm/require: %/helm/copy | $$(ENABLE_LOGGING)
@$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PACKAGE_DEPENDENCIES)" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST)

helm/replace: helm/require | $$(ENABLE_LOGGING)
%/helm/replace: %/helm/require | $$(ENABLE_LOGGING)
@$(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR)

helm/build: helm/replace | $$(ENABLE_LOGGING)
%/helm/build: %/helm/replace | $$(ENABLE_LOGGING)
@$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY)

helm/push: helm/build | $$(ENABLE_LOGGING)
%/helm/push: %/helm/build | $$(ENABLE_LOGGING)
@$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)

# Build helm chart
.PHONY: helm/build
helm/build: $(foreach chart,$(HELM_CHART_NAMES),$(chart)/helm/build)

# Build helm chart and push to registry defined in IMAGE_REPO.
.PHONY: helm/push
helm/push: helm/build | ensure-helm $$(ENABLE_LOGGING)
@$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)
helm/push: $(foreach chart,$(HELM_CHART_NAMES),$(chart)/helm/push)

## Fetch Binary Targets
.PHONY: handle-dependencies
Expand Down Expand Up @@ -946,16 +950,16 @@ patch-for-dep-update: checkout-repo
cmd=( ecr-public --region us-east-1 ); \
fi; \
repo=$(IMAGE_REPO_COMPONENT); \
if [ "$(IMAGE_NAME)" = "__helm__" ]; then \
repo="$(HELM_DESTINATION_REPOSITORY)"; \
if [[ "$(IMAGE_NAME)" = *"__helm__"* ]]; then \
repo="$(IMAGE_NAME:%/__helm__=%)"; \
fi; \
if ! aws $${cmd[*]} describe-repositories --repository-name "$$repo" > /dev/null 2>&1; then \
aws $${cmd[*]} create-repository --repository-name "$$repo"; \
fi;

.PHONY: create-ecr-repos
create-ecr-repos: # Create repos in ECR for project images for local testing
create-ecr-repos: $(foreach image,$(IMAGE_NAMES),$(image)/create-ecr-repo) $(if $(filter true,$(HAS_HELM_CHART)),__helm__/create-ecr-repo,)
create-ecr-repos: $(foreach image,$(IMAGE_NAMES),$(image)/create-ecr-repo) $(if $(filter true,$(HAS_HELM_CHART)),$(foreach chart,$(HELM_CHART_NAMES),$(chart)/__helm__/create-ecr-repo),)

.PHONY: var-value-%
var-value-%:
Expand Down
2 changes: 0 additions & 2 deletions projects/aws-containers/hello-eks-anywhere/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ HAS_LICENSES=false

HAS_HELM_CHART=true
HELM_DIRECTORY=charts/hello-eks-anywhere
HELM_DESTINATION_REPOSITORY=$(REPO)
HELM_IMAGE_LIST=$(REPO)

EXCLUDE_FROM_STAGING_BUILDSPEC=true
SKIP_ON_RELEASE_BRANCH=true
Expand Down
3 changes: 2 additions & 1 deletion projects/aws-observability/aws-otel-collector/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ SKIP_ON_RELEASE_BRANCH=true

HAS_HELM_CHART=true

HELM_CHART_NAMES=adot/charts/aws-otel-collector

HELM_SOURCE_IMAGE_REPO=public.ecr.aws
HELM_SOURCE_OWNER=open-telemetry
HELM_SOURCE_REPOSITORY=opentelemetry-helm-charts
HELM_DIRECTORY=charts/opentelemetry-collector
HELM_DESTINATION_REPOSITORY=adot/charts/aws-otel-collector
HELM_IMAGE_LIST=aws-observability/aws-otel-collector
HELM_USE_UPSTREAM_IMAGE=true

Expand Down
47 changes: 12 additions & 35 deletions projects/aws/eks-anywhere-packages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,25 @@ FIX_LICENSES_ECRTOKENREFRESHER_TARGET=$(REPO)/ecrtokenrefresher/LICENSE
FIX_LICENSES_CREDENTIALPROVIDERPACKAGE_TARGET=$(REPO)/credentialproviderpackage/LICENSE

HAS_HELM_CHART=true
HELM_DIRECTORY=charts/eks-anywhere-packages
HELM_DIRECTORY?=charts/$(HELM_CHART_NAME)
HELM_IMAGE_LIST=eks-anywhere-packages ecr-token-refresher
CRED_HELM_IMAGE_LIST=credential-provider-package

HELM_CHART_NAMES=eks-anywhere-packages-migrations eks-anywhere-packages-crds eks-anywhere-packages credential-provider-package

BUILDSPEC_COMPUTE_TYPE=BUILD_GENERAL1_LARGE

include $(BASE_DIRECTORY)/Common.mk

# building multiple helm charts requires overrides
eks-anywhere-packages-crds/helm/%: PACKAGE_DEPENDENCIES=eks-anywhere-packages-migrations

eks-anywhere-packages/helm/%: PACKAGE_DEPENDENCIES=eks-anywhere-packages-crds

credential-provider-package/helm/%: HELM_IMAGE_LIST=$(CRED_HELM_IMAGE_LIST)
credential-provider-package/helm/%: HELM_DIRECTORY=credentialproviderpackage/charts/credential-provider-package
credential-provider-package/helm/%: FORCE_JSON_SCHEMA_FILE=$(PROJECT_ROOT)/helm/credential-provider-package.schema.json

$(GATHER_LICENSES_TARGETS): $(FIX_LICENSES_ECRTOKENREFRESHER_TARGET) $(FIX_LICENSES_CREDENTIALPROVIDERPACKAGE_TARGET)

# Copy the License to each directory that has a unique go.mod path,
Expand All @@ -51,40 +62,6 @@ $(FIX_LICENSES_ECRTOKENREFRESHER_TARGET): | $(GO_MOD_DOWNLOAD_TARGETS)
$(FIX_LICENSES_CREDENTIALPROVIDERPACKAGE_TARGET): | $(GO_MOD_DOWNLOAD_TARGETS)
cp $(REPO)/LICENSE $(REPO)/credentialproviderpackage/LICENSE

# Build helm chart
.PHONY: helm/build
helm/build: $(LICENSES_TARGETS_FOR_PREREQ)
helm/build: $(if $(filter true,$(REPO_NO_CLONE)),,$(HELM_GIT_CHECKOUT_TARGET))
helm/build: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),)
# Pkg controller requires multiple charts. Consider this a temporary work-around (turned too permanent).
$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) eks-anywhere-packages-migrations charts/eks-anywhere-packages-migrations $(OUTPUT_DIR)
$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) eks-anywhere-packages-migrations $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PACKAGE_DEPENDENCIES)" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST)
$(BUILD_LIB)/helm_replace.sh eks-anywhere-packages-migrations $(OUTPUT_DIR)
$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) eks-anywhere-packages-migrations

$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) eks-anywhere-packages-crds charts/eks-anywhere-packages-crds $(OUTPUT_DIR)
$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) eks-anywhere-packages-crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) eks-anywhere-packages-migrations "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST)
$(BUILD_LIB)/helm_replace.sh eks-anywhere-packages-crds $(OUTPUT_DIR)
$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) eks-anywhere-packages-crds

$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR)
$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "eks-anywhere-packages-crds" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST)
$(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR)
$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY)

# Credential Provider Package lives in pkg controller repo. Workaround for its sepearate chart
$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) credential-provider-package credentialproviderpackage/charts/credential-provider-package $(OUTPUT_DIR)
$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) credential-provider-package $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PACKAGE_DEPENDENCIES)" "$(PROJECT_ROOT)/helm/credential-provider-package.schema.json" $(CRED_HELM_IMAGE_LIST)
$(BUILD_LIB)/helm_replace.sh credential-provider-package $(OUTPUT_DIR)
$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) credential-provider-package

# Build helm chart and push to registry defined in IMAGE_REPO.
.PHONY: helm/push
helm/push: helm/build
$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)
$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) eks-anywhere-packages-crds $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)
$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) eks-anywhere-packages-migrations $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)
$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) credential-provider-package $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)


########### DO NOT EDIT #############################
Expand Down
34 changes: 14 additions & 20 deletions projects/emissary-ingress/emissary/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,32 @@ COMPILER_IMAGE_VERSION=3.9

HAS_HELM_CHART=true
HELM_DIRECTORY=charts/emissary-ingress
HELM_DESTINATION_REPOSITORY=emissary-ingress/emissary
HELM_IMAGE_LIST=emissary-ingress/emissary
HELM_CHART_NAMES=emissary/crds emissary-ingress/emissary

AMBASSADOR_VERSION_TARGET=$(REPO)/python/ambassador.version

include $(BASE_DIRECTORY)/Common.mk


emissary-ingress/emissary/helm/%: PACKAGE_DEPENDENCIES=emissary-crds

emissary/crds/helm/%: HELM_DIRECTORY=charts/crds
# Originially emissary was created with `emissary/crds` as the HELM_DESTINATION_REPOSITORY for everything but the push
# which is `emissary-ingress/crds`
# this really only made a differnece in the helm_require.sh script which uses this value in the EksaPackageRequires file
# otherwise it was always `basename`, which was the same either way
# overriding for push to keep it consistent
emissary/crds/helm/build: HELM_DESTINATION_REPOSITORY=emissary/crds
emissary/crds/helm/push: HELM_DESTINATION_REPOSITORY=emissary-ingress/crds
emissary/crds/__helm__/create-ecr-repo: IMAGE_NAME=emissary-ingress/crds/__helm__

$(GO_MOD_DOWNLOAD_TARGETS): $(AMBASSADOR_VERSION_TARGET)

# do not pass our makeflags down to emissary make since there will be unncessary warnings
$(AMBASSADOR_VERSION_TARGET): MAKEFLAGS=
$(AMBASSADOR_VERSION_TARGET):
@export VERSION="v3.6.0" && export CHART_VERSION=$(CHART_VERSION) && cd emissary && GOPATH=/var && make python/ambassador.version

# Build helm chart
.PHONY: helm/build
helm/build: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),)
# Emissary requires 2 charts. Consider this a temporary work-around.
$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) emissary/crds charts/crds $(OUTPUT_DIR)
$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) emissary/crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PACKAGE_DEPENDENCIES)" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST)
$(BUILD_LIB)/helm_replace.sh emissary/crds $(OUTPUT_DIR)
$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) emissary/crds
$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR)
$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) emissary-crds "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST)
$(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR)
$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY)

.PHONY: helm/push
helm/push: helm/build
$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)
$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) emissary-ingress/crds $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)


########### DO NOT EDIT #############################
# To update call: make add-generated-help-block
Expand Down
3 changes: 2 additions & 1 deletion projects/goharbor/harbor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ HAS_HELM_CHART?=true

HELM_GIT_TAG=$(shell cat HELM_GIT_TAG)
HELM_SOURCE_REPOSITORY=harbor-helm
HELM_DESTINATION_REPOSITORY=harbor/$(HELM_SOURCE_REPOSITORY)
HELM_IMAGE_LIST=harbor/harbor-core harbor/harbor-db harbor/harbor-log harbor/harbor-exporter harbor/harbor-jobservice harbor/harbor-nginx harbor/harbor-portal harbor/harbor-redis harbor/harbor-registry harbor/harbor-registryctl harbor/harbor-trivy

HELM_CHART_NAMES=harbor/$(HELM_SOURCE_REPOSITORY)

EXCLUDE_FROM_STAGING_BUILDSPEC=true
BUILDSPEC_COMPUTE_TYPE=BUILD_GENERAL1_LARGE

Expand Down
3 changes: 2 additions & 1 deletion projects/kubernetes-sigs/metrics-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ HELM_SOURCE_IMAGE_REPO=public.ecr.aws
HELM_SOURCE_OWNER=kubernetes-sigs
HELM_SOURCE_REPOSITORY=metrics-server
HELM_DIRECTORY=charts/metrics-server
HELM_DESTINATION_REPOSITORY=metrics-server/charts/metrics-server
HELM_IMAGE_LIST=eks-distro/kubernetes-sigs/metrics-server
HELM_USE_UPSTREAM_IMAGE=true

HELM_CHART_NAMES=metrics-server/charts/metrics-server

EXCLUDE_FROM_CHECKSUMS_BUILDSPEC=true

include $(BASE_DIRECTORY)/Common.mk
Expand Down
3 changes: 2 additions & 1 deletion projects/kubernetes/autoscaler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ HELM_TAG=$(subst cluster-autoscaler-chart-,,$(HELM_GIT_TAG))-$(subst -,.,$(RELEA
HELM_SOURCE_OWNER=kubernetes
HELM_SOURCE_REPOSITORY=autoscaler
HELM_DIRECTORY=charts/cluster-autoscaler
HELM_DESTINATION_REPOSITORY=cluster-autoscaler/charts/cluster-autoscaler
HELM_IMAGE_LIST=kubernetes/autoscaler

HELM_CHART_NAMES=cluster-autoscaler/charts/cluster-autoscaler

BUILDSPEC_VARS_KEYS=RELEASE_BRANCH
BUILDSPEC_VARS_VALUES=SUPPORTED_K8S_VERSIONS
BUILDSPEC_COMPUTE_TYPE=BUILD_GENERAL1_LARGE
Expand Down
27 changes: 5 additions & 22 deletions projects/metallb/metallb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,21 @@ SPEAKER_IMAGE_COMPONENT=metallb/speaker
IMAGE_NAMES=controller speaker
DOCKERFILE_FOLDER=./docker/linux/$(IMAGE_NAME)


HAS_HELM_CHART=true
HELM_DIRECTORY=charts/metallb
HELM_DESTINATION_REPOSITORY=metallb/metallb
HELM_IMAGE_LIST=metallb/controller metallb/speaker

HELM_CHART_NAMES=metallb/crds metallb/metallb

EXCLUDE_FROM_STAGING_BUILDSPEC=true
SKIP_ON_RELEASE_BRANCH=true

include $(BASE_DIRECTORY)/Common.mk

# Build helm chart
.PHONY: helm/build
helm/build: $(LICENSES_TARGETS_FOR_PREREQ)
helm/build: $(if $(filter true,$(REPO_NO_CLONE)),,$(HELM_GIT_CHECKOUT_TARGET))
helm/build: $(if $(wildcard $(PROJECT_ROOT)/helm/patches),$(HELM_GIT_PATCH_TARGET),)
# Metallb requires 2 charts. Consider this a temporary work-around.
$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) metallb/crds charts/crds $(OUTPUT_DIR)
$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) metallb/crds $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) "$(PROJECT_DEPENDENCIES)" "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST)
$(BUILD_LIB)/helm_replace.sh metallb/crds $(OUTPUT_DIR)
$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) metallb/crds
$(BUILD_LIB)/helm_copy.sh $(HELM_SOURCE_REPOSITORY) $(HELM_DESTINATION_REPOSITORY) $(HELM_DIRECTORY) $(OUTPUT_DIR)
$(BUILD_LIB)/helm_require.sh $(HELM_SOURCE_IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR) $(IMAGE_TAG) $(HELM_TAG) $(PROJECT_ROOT) $(LATEST) $(HELM_USE_UPSTREAM_IMAGE) metallb-crds "$(FORCE_JSON_SCHEMA_FILE)" $(HELM_IMAGE_LIST)
$(BUILD_LIB)/helm_replace.sh $(HELM_DESTINATION_REPOSITORY) $(OUTPUT_DIR)
$(BUILD_LIB)/helm_build.sh $(OUTPUT_DIR) $(HELM_DESTINATION_REPOSITORY)

# Build helm chart and push to registry defined in IMAGE_REPO.
.PHONY: helm/push
helm/push: helm/build
$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) $(HELM_DESTINATION_REPOSITORY) $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)
$(BUILD_LIB)/helm_push.sh $(IMAGE_REPO) metallb/crds $(HELM_TAG) $(GIT_TAG) $(OUTPUT_DIR) $(LATEST)

metallb/metallb/helm/%: PACKAGE_DEPENDENCIES=metallb-crds

metallb/crds/helm/%: HELM_DIRECTORY=charts/crds

########### DO NOT EDIT #############################
# To update call: make add-generated-help-block
Expand Down
3 changes: 2 additions & 1 deletion projects/prometheus/prometheus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ HAS_HELM_CHART=true
HELM_SOURCE_OWNER=prometheus-community
HELM_SOURCE_REPOSITORY=helm-charts
HELM_DIRECTORY=charts/prometheus
HELM_DESTINATION_REPOSITORY=prometheus/charts/prometheus
HELM_IMAGE_LIST=prometheus/prometheus prometheus/node-exporter

HELM_CHART_NAMES=prometheus/charts/prometheus

include $(BASE_DIRECTORY)/Common.mk

# Before running GO_MOD_DOWNLOAD_TARGETS, we need to generate web UI related
Expand Down
1 change: 0 additions & 1 deletion projects/tinkerbell/tinkerbell-chart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ RELEASE_TARGETS=helm/push
HAS_HELM_CHART=true
HELM_DIRECTORY=chart
HELM_SOURCE_REPOSITORY=.
HELM_DESTINATION_REPOSITORY=$(REPO_OWNER)/$(REPO)

include $(BASE_DIRECTORY)/Common.mk

Expand Down

0 comments on commit 998cea3

Please sign in to comment.