Skip to content

Commit 8d90d11

Browse files
authored
cmd/envoyinit -> internal/envoyinit (#10756)
1 parent 6fbc77e commit 8d90d11

9 files changed

+54
-442
lines changed

.goreleaser.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ builds:
3636
- amd64
3737
- arm64
3838
- id: envoyinit
39-
main: ./cmd/envoyinit
39+
main: ./internal/envoyinit/cmd
4040
binary: envoyinit-linux-{{ .Arch }}
4141
gcflags: "{{ .Env.GCFLAGS }}"
4242
ldflags: "{{ .Env.LDFLAGS }}"
@@ -98,17 +98,17 @@ dockers:
9898
- image_templates:
9999
- &envoyinit_arm_image "{{ .Env.IMAGE_REGISTRY }}/{{ .Env.ENVOYINIT_IMAGE_REPO }}:{{ .Env.VERSION }}-arm64"
100100
use: buildx
101-
dockerfile: &envoyinit_dockerfile cmd/envoyinit/Dockerfile.envoyinit
101+
dockerfile: &envoyinit_dockerfile internal/envoyinit/Dockerfile.envoyinit
102102
goos: linux
103103
goarch: arm64
104104
build_flag_templates:
105105
- "--pull"
106106
- "--platform=linux/arm64"
107107
- "--build-arg=GOARCH=arm64"
108-
- "--build-arg=ENTRYPOINT_SCRIPT=/cmd/envoyinit/docker-entrypoint.sh"
108+
- "--build-arg=ENTRYPOINT_SCRIPT=/internal/envoyinit/cmd/docker-entrypoint.sh"
109109
- "--build-arg=ENVOY_IMAGE={{ .Env.ENVOY_IMAGE }}"
110110
extra_files:
111-
- cmd/envoyinit/docker-entrypoint.sh
111+
- internal/envoyinit/cmd/docker-entrypoint.sh
112112
- image_templates:
113113
- &envoyinit_amd_image "{{ .Env.IMAGE_REGISTRY }}/{{ .Env.ENVOYINIT_IMAGE_REPO }}:{{ .Env.VERSION }}-amd64"
114114
use: buildx
@@ -119,10 +119,10 @@ dockers:
119119
- "--pull"
120120
- "--platform=linux/amd64"
121121
- "--build-arg=GOARCH=amd64"
122-
- "--build-arg=ENTRYPOINT_SCRIPT=/cmd/envoyinit/docker-entrypoint.sh"
122+
- "--build-arg=ENTRYPOINT_SCRIPT=/internal/envoyinit/cmd/docker-entrypoint.sh"
123123
- "--build-arg=ENVOY_IMAGE={{ .Env.ENVOY_IMAGE }}"
124124
extra_files:
125-
- cmd/envoyinit/docker-entrypoint.sh
125+
- internal/envoyinit/cmd/docker-entrypoint.sh
126126
docker_manifests:
127127
- name_template: "{{ .Env.IMAGE_REGISTRY }}/{{ .Env.CONTROLLER_IMAGE_REPO }}:{{ .Env.VERSION }}"
128128
image_templates:

Makefile

+14-4
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ ANALYZE_ARGS ?= --fast --verbose
157157
analyze: ## Run golangci-lint. Override options with ANALYZE_ARGS.
158158
GOTOOLCHAIN=$(GOTOOLCHAIN) $(GOLANGCI_LINT) run $(ANALYZE_ARGS) ./...
159159

160+
161+
#----------------------------------------------------------------------------
162+
# Info
163+
#----------------------------------------------------------------------------
164+
.PHONY: envoyversion
165+
envoyversion: ENVOY_VERSION_TAG ?= $(shell echo $(ENVOY_IMAGE) | cut -d':' -f2)
166+
envoyversion:
167+
echo "Version is $(ENVOY_VERSION_TAG)"
168+
echo "Commit for envoyproxy is $(shell curl -s https://raw.githubusercontent.com/solo-io/envoy-gloo/refs/tags/v$(ENVOY_VERSION_TAG)/bazel/repository_locations.bzl | grep "envoy =" -A 4 | grep commit | cut -d'"' -f2)"
160169
#----------------------------------------------------------------------------------
161170
# Ginkgo Tests
162171
#----------------------------------------------------------------------------------
@@ -443,15 +452,16 @@ ENVOYINIT_OUTPUT_DIR=$(OUTPUT_DIR)/$(ENVOYINIT_DIR)
443452
export ENVOYINIT_IMAGE_REPO ?= envoy-wrapper
444453

445454
$(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH): $(ENVOYINIT_SOURCES)
446-
$(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ ./cmd/envoyinit/...
455+
$(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ ./internal/envoyinit/cmd/...
447456

448457
.PHONY: envoyinit
449458
envoyinit: $(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH)
450459

451-
$(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit: cmd/envoyinit/Dockerfile.envoyinit
460+
# TODO(nfuden) cheat the process for now with -r but try to find a cleaner method
461+
$(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit: internal/envoyinit/Dockerfile.envoyinit
452462
cp $< $@
453463

454-
$(ENVOYINIT_OUTPUT_DIR)/docker-entrypoint.sh: cmd/envoyinit/docker-entrypoint.sh
464+
$(ENVOYINIT_OUTPUT_DIR)/docker-entrypoint.sh: internal/envoyinit/cmd/docker-entrypoint.sh
455465
cp $< $@
456466

457467
.PHONY: envoy-wrapper-docker
@@ -461,7 +471,7 @@ envoy-wrapper-docker: $(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH) $(ENVOYI
461471
--build-arg ENVOY_IMAGE=$(ENVOY_IMAGE) \
462472
-t $(IMAGE_REGISTRY)/$(ENVOYINIT_IMAGE_REPO):$(VERSION)
463473

464-
$(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit.distroless: cmd/envoyinit/Dockerfile.envoyinit.distroless
474+
$(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit.distroless: internal/envoyinit/Dockerfile.envoyinit.distroless
465475
cp $< $@
466476

467477
# Explicitly specify the base image is amd64 as we only build the amd64 flavour of envoy
File renamed without changes.

internal/envoyinit/README.md

-86
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)