-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
breakout kgateway from gloo/solo deps #10492
Changes from all commits
a17ce01
017d98c
2d65a7f
486189f
c949958
3b4a093
3d82895
7c20bbe
a8d2c6a
c2cd229
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,14 +23,16 @@ jobs: | |
with: | ||
go-version-file: go.mod | ||
- name: Build | ||
run: go build -v ./projects/gateway2/... ./projects/gloo/cli/cmd | ||
run: go build -v ./projects/gateway2/... | ||
- name: Install Test Utils | ||
shell: bash | ||
run: make -C ./projects/gateway2/ install-go-tools | ||
- name: Run Tests | ||
shell: bash | ||
env: | ||
TEST_PKG: "./projects/gateway2/... ./test/kubernetes/testutils/helper" | ||
TEST_PKG: "./projects/gateway2/..." | ||
# TODO: remove this once we delete gloo | ||
GOLANG_PROTOBUF_REGISTRATION_CONFLICT: "ignore" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needed until we remove gloo, dupe protos from gloo and envoy-gloo/go There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i hate that variable haha :) happy to see a path to remove it |
||
run: make go-test-with-coverage | ||
- name: Validate Test Coverage | ||
shell: bash | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,9 +320,9 @@ generate-all-debug: generate-all | |
# Generates all required code, cleaning and formatting as well; this target is executed in CI | ||
.PHONY: generated-code | ||
generated-code: check-go-version | ||
generated-code: go-generate-all generate-cli-docs getter-check mod-tidy | ||
generated-code: go-generate-all getter-check mod-tidy | ||
generated-code: update-licenses | ||
generated-code: generate-crd-reference-docs | ||
# generated-code: generate-crd-reference-docs | ||
generated-code: fmt | ||
|
||
.PHONY: go-generate-all | ||
|
@@ -338,9 +338,10 @@ generate-cli-docs: clean-cli-docs ## Removes existing CLI docs and re-generates | |
GO111MODULE=on go run projects/gloo/cli/cmd/docs/main.go | ||
|
||
# Ensures that accesses for fields which have "getter" functions are exclusively done via said "getter" functions | ||
# TODO: do we still want this? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the answer is likely yes? I kinda hate the Format of .GetSomething but having panics due to bad accessors is super painful and people seem to be good at writing that kind of bug. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm in favor of getter checks, but iirc this only works with protobuf-generated go types? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my reasoning here is that we are going away from proto generated APIs so this is much less likely of a concern. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we replace this tool in favor of https://golangci-lint.run/usage/linters/#protogetter? or remove it entirely until there's a need? |
||
.PHONY: getter-check | ||
getter-check: | ||
go run github.com/saiskee/gettercheck -ignoretests -ignoregenerated -write ./... | ||
go run github.com/saiskee/gettercheck -ignoretests -ignoregenerated -write ./projects/gateway2/... | ||
|
||
.PHONY: mod-tidy | ||
mod-tidy: | ||
|
@@ -407,62 +408,26 @@ distroless-with-utils-docker: distroless-docker $(DISTROLESS_OUTPUT_DIR)/Dockerf | |
--build-arg BASE_IMAGE=$(GLOO_DISTROLESS_BASE_IMAGE) \ | ||
-t $(GLOO_DISTROLESS_BASE_WITH_UTILS_IMAGE) | ||
|
||
#---------------------------------------------------------------------------------- | ||
# Discovery | ||
#---------------------------------------------------------------------------------- | ||
|
||
DISCOVERY_DIR=projects/discovery | ||
DISCOVERY_SOURCES=$(call get_sources,$(DISCOVERY_DIR)) | ||
DISCOVERY_OUTPUT_DIR=$(OUTPUT_DIR)/$(DISCOVERY_DIR) | ||
|
||
$(DISCOVERY_OUTPUT_DIR)/discovery-linux-$(GOARCH): $(DISCOVERY_SOURCES) | ||
$(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ $(DISCOVERY_DIR)/cmd/main.go | ||
|
||
.PHONY: discovery | ||
discovery: $(DISCOVERY_OUTPUT_DIR)/discovery-linux-$(GOARCH) | ||
|
||
$(DISCOVERY_OUTPUT_DIR)/Dockerfile.discovery: $(DISCOVERY_DIR)/cmd/Dockerfile | ||
cp $< $@ | ||
|
||
.PHONY: discovery-docker | ||
discovery-docker: $(DISCOVERY_OUTPUT_DIR)/discovery-linux-$(GOARCH) $(DISCOVERY_OUTPUT_DIR)/Dockerfile.discovery | ||
docker buildx build --load $(PLATFORM) $(DISCOVERY_OUTPUT_DIR) -f $(DISCOVERY_OUTPUT_DIR)/Dockerfile.discovery \ | ||
--build-arg GOARCH=$(GOARCH) \ | ||
--build-arg BASE_IMAGE=$(ALPINE_BASE_IMAGE) \ | ||
-t $(IMAGE_REGISTRY)/discovery:$(VERSION) | ||
|
||
$(DISCOVERY_OUTPUT_DIR)/Dockerfile.discovery.distroless: $(DISCOVERY_DIR)/cmd/Dockerfile.distroless | ||
cp $< $@ | ||
|
||
.PHONY: discovery-distroless-docker | ||
discovery-distroless-docker: $(DISCOVERY_OUTPUT_DIR)/discovery-linux-$(GOARCH) $(DISCOVERY_OUTPUT_DIR)/Dockerfile.discovery.distroless distroless-docker | ||
docker buildx build --load $(PLATFORM) $(DISCOVERY_OUTPUT_DIR) -f $(DISCOVERY_OUTPUT_DIR)/Dockerfile.discovery.distroless \ | ||
--build-arg GOARCH=$(GOARCH) \ | ||
--build-arg BASE_IMAGE=$(GLOO_DISTROLESS_BASE_IMAGE) \ | ||
-t $(IMAGE_REGISTRY)/discovery:$(VERSION)-distroless | ||
|
||
#---------------------------------------------------------------------------------- | ||
# Gloo | ||
#---------------------------------------------------------------------------------- | ||
|
||
GLOO_DIR=projects/gloo | ||
EDGE_GATEWAY_DIR=projects/gateway | ||
K8S_GATEWAY_DIR=projects/gateway2 | ||
GLOO_SOURCES=$(call get_sources,$(GLOO_DIR)) | ||
# GLOO_SOURCES=$(call get_sources,$(GLOO_DIR)) | ||
EDGE_GATEWAY_SOURCES=$(call get_sources,$(EDGE_GATEWAY_DIR)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove? |
||
K8S_GATEWAY_SOURCES=$(call get_sources,$(K8S_GATEWAY_DIR)) | ||
GLOO_OUTPUT_DIR=$(OUTPUT_DIR)/$(GLOO_DIR) | ||
GLOO_OUTPUT_DIR=$(OUTPUT_DIR)/$(K8S_GATEWAY_DIR) | ||
export GLOO_IMAGE_REPO ?= gloo | ||
|
||
# We include the files in EDGE_GATEWAY_DIR and K8S_GATEWAY_DIR as dependencies to the gloo build | ||
# so changes in those directories cause the make target to rebuild | ||
$(GLOO_OUTPUT_DIR)/gloo-linux-$(GOARCH): $(GLOO_SOURCES) $(EDGE_GATEWAY_SOURCES) $(K8S_GATEWAY_SOURCES) | ||
$(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ $(GLOO_DIR)/cmd/main.go | ||
$(GLOO_OUTPUT_DIR)/gloo-linux-$(GOARCH): $(K8S_GATEWAY_SOURCES) | ||
$(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ $(K8S_GATEWAY_DIR)/cmd/main.go | ||
|
||
.PHONY: gloo | ||
gloo: $(GLOO_OUTPUT_DIR)/gloo-linux-$(GOARCH) | ||
|
||
$(GLOO_OUTPUT_DIR)/Dockerfile.gloo: $(GLOO_DIR)/cmd/Dockerfile | ||
$(GLOO_OUTPUT_DIR)/Dockerfile.gloo: $(K8S_GATEWAY_DIR)/cmd/Dockerfile | ||
cp $< $@ | ||
|
||
.PHONY: gloo-docker | ||
|
@@ -571,21 +536,21 @@ sds-distroless-docker: $(SDS_OUTPUT_DIR)/sds-linux-$(GOARCH) $(SDS_OUTPUT_DIR)/D | |
# Envoy init (BASE/SIDECAR) | ||
#---------------------------------------------------------------------------------- | ||
|
||
ENVOYINIT_DIR=projects/envoyinit/cmd | ||
ENVOYINIT_SOURCES=$(call get_sources,$(ENVOYINIT_DIR)) | ||
ENVOYINIT_OUTPUT_DIR=$(OUTPUT_DIR)/$(ENVOYINIT_DIR) | ||
# ENVOYINIT_DIR=projects/envoyinit/cmd | ||
# ENVOYINIT_SOURCES=$(call get_sources,$(ENVOYINIT_DIR)) | ||
# ENVOYINIT_OUTPUT_DIR=$(OUTPUT_DIR)/$(ENVOYINIT_DIR) | ||
|
||
$(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH): $(ENVOYINIT_SOURCES) | ||
$(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ $(ENVOYINIT_DIR)/main.go | ||
# $(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH): $(ENVOYINIT_SOURCES) | ||
# $(GO_BUILD_FLAGS) GOOS=linux go build -ldflags='$(LDFLAGS)' -gcflags='$(GCFLAGS)' -o $@ $(ENVOYINIT_DIR)/main.go | ||
|
||
.PHONY: envoyinit | ||
envoyinit: $(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH) | ||
# .PHONY: envoyinit | ||
# envoyinit: $(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH) | ||
|
||
$(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit: $(ENVOYINIT_DIR)/Dockerfile.envoyinit | ||
cp $< $@ | ||
# $(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit: $(ENVOYINIT_DIR)/Dockerfile.envoyinit | ||
# cp $< $@ | ||
|
||
$(ENVOYINIT_OUTPUT_DIR)/docker-entrypoint.sh: $(ENVOYINIT_DIR)/docker-entrypoint.sh | ||
cp $< $@ | ||
# $(ENVOYINIT_OUTPUT_DIR)/docker-entrypoint.sh: $(ENVOYINIT_DIR)/docker-entrypoint.sh | ||
# cp $< $@ | ||
|
||
.PHONY: gloo-envoy-wrapper-docker | ||
gloo-envoy-wrapper-docker: $(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH) $(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit $(ENVOYINIT_OUTPUT_DIR)/docker-entrypoint.sh | ||
|
@@ -594,8 +559,8 @@ gloo-envoy-wrapper-docker: $(ENVOYINIT_OUTPUT_DIR)/envoyinit-linux-$(GOARCH) $(E | |
--build-arg ENVOY_IMAGE=$(ENVOY_GLOO_IMAGE) \ | ||
-t $(IMAGE_REGISTRY)/gloo-envoy-wrapper:$(VERSION) | ||
|
||
$(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit.distroless: $(ENVOYINIT_DIR)/Dockerfile.envoyinit.distroless | ||
cp $< $@ | ||
# $(ENVOYINIT_OUTPUT_DIR)/Dockerfile.envoyinit.distroless: $(ENVOYINIT_DIR)/Dockerfile.envoyinit.distroless | ||
# cp $< $@ | ||
|
||
# Explicitly specify the base image is amd64 as we only build the amd64 flavour of gloo envoy | ||
.PHONY: gloo-envoy-wrapper-distroless-docker | ||
|
@@ -798,20 +763,14 @@ docker-push-%: | |
.PHONY: docker-standard | ||
docker-standard: check-go-version ## Build docker images (standard only) | ||
docker-standard: gloo-docker | ||
docker-standard: discovery-docker | ||
docker-standard: gloo-envoy-wrapper-docker | ||
# docker-standard: gloo-envoy-wrapper-docker | ||
docker-standard: sds-docker | ||
docker-standard: certgen-docker | ||
docker-standard: kubectl-docker | ||
|
||
.PHONY: docker-distroless | ||
docker-distroless: check-go-version ## Build docker images (distroless only) | ||
docker-distroless: gloo-distroless-docker | ||
docker-distroless: discovery-distroless-docker | ||
docker-distroless: gloo-envoy-wrapper-distroless-docker | ||
docker-distroless: sds-distroless-docker | ||
docker-distroless: certgen-distroless-docker | ||
docker-distroless: kubectl-distroless-docker | ||
|
||
IMAGE_VARIANT ?= all | ||
# Build docker images using the defined IMAGE_REGISTRY, VERSION | ||
|
@@ -946,19 +905,15 @@ kind-reload-gloo-envoy-wrapper: | |
|
||
.PHONY: kind-build-and-load-standard | ||
kind-build-and-load-standard: kind-build-and-load-gloo | ||
kind-build-and-load-standard: kind-build-and-load-discovery | ||
kind-build-and-load-standard: kind-build-and-load-gloo-envoy-wrapper | ||
kind-build-and-load-standard: kind-build-and-load-sds | ||
kind-build-and-load-standard: kind-build-and-load-certgen | ||
kind-build-and-load-standard: kind-build-and-load-kubectl | ||
# kind-build-and-load-standard: kind-build-and-load-gloo-envoy-wrapper | ||
# kind-build-and-load-standard: kind-build-and-load-sds | ||
# kind-build-and-load-standard: kind-build-and-load-certgen | ||
|
||
.PHONY: kind-build-and-load-distroless | ||
kind-build-and-load-distroless: kind-build-and-load-gloo-distroless | ||
kind-build-and-load-distroless: kind-build-and-load-discovery-distroless | ||
kind-build-and-load-distroless: kind-build-and-load-gloo-envoy-wrapper-distroless | ||
kind-build-and-load-distroless: kind-build-and-load-sds-distroless | ||
kind-build-and-load-distroless: kind-build-and-load-certgen-distroless | ||
kind-build-and-load-distroless: kind-build-and-load-kubectl-distroless | ||
|
||
.PHONY: kind-build-and-load ## Use to build all images and load them into kind | ||
kind-build-and-load: # Standard images | ||
|
@@ -975,19 +930,15 @@ kind-build-and-load: kind-build-and-load-sds | |
# Load existing images. This can speed up development if the images have already been built / are unchanged | ||
.PHONY: kind-load-standard | ||
kind-load-standard: kind-load-gloo | ||
kind-load-standard: kind-load-discovery | ||
kind-load-standard: kind-load-gloo-envoy-wrapper | ||
kind-load-standard: kind-load-sds | ||
kind-load-standard: kind-load-certgen | ||
kind-load-standard: kind-load-kubectl | ||
|
||
.PHONY: kind-build-and-load-distroless | ||
kind-load-distroless: kind-load-gloo-distroless | ||
kind-load-distroless: kind-load-discovery-distroless | ||
kind-load-distroless: kind-load-gloo-envoy-wrapper-distroless | ||
kind-load-distroless: kind-load-sds-distroless | ||
kind-load-distroless: kind-load-certgen-distroless | ||
kind-load-distroless: kind-load-kubectl-distroless | ||
|
||
.PHONY: kind-load ## Use to build all images and load them into kind | ||
kind-load: # Standard images | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,12 +68,6 @@ spec: | |
- path: "labels" | ||
fieldRef: | ||
fieldPath: metadata.labels | ||
{{- if and .Values.gateway.enabled .Values.gateway.validation.enabled }} | ||
- name: validation-certs | ||
secret: | ||
defaultMode: 420 | ||
secretName: {{ .Values.gateway.validation.secretName }} | ||
{{- end }} | ||
containers: | ||
{{- if .Values.global.glooMtls.enabled }} | ||
{{- $sdsImage := merge .Values.global.glooMtls.sds.image .Values.global.image }} | ||
|
@@ -201,10 +195,6 @@ spec: | |
protocol: TCP | ||
{{- end }} | ||
volumeMounts: | ||
{{- if and .Values.gateway.validation.enabled .Values.gateway.enabled }} | ||
- mountPath: /etc/gateway/validation-certs | ||
name: validation-certs | ||
{{- end }} | ||
- name: labels-volume | ||
mountPath: /etc/gloo | ||
readOnly: true | ||
|
@@ -269,6 +259,8 @@ spec: | |
- name: HEADER_SECRET_REF_NS_MATCHES_US | ||
value: "true" | ||
{{- end}} | ||
- name: GOLANG_PROTOBUF_REGISTRATION_CONFLICT | ||
value: ignore | ||
Comment on lines
+262
to
+263
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needed until we remove gloo, dupe protos from gloo and envoy-gloo/go |
||
{{- if not .Values.global.glooMtls.enabled }} | ||
readinessProbe: | ||
tcpSocket: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we no longer need to use/test whatever's under
./test/kubernetes/testutils/helper
?