-
Notifications
You must be signed in to change notification settings - Fork 464
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
Conversation
b793c47
to
017d98c
Compare
registry: quay.io/solo-io | ||
repository: gloo-envoy-wrapper | ||
tag: 1.18.5 |
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.
hack to get a reliable envoy image while we prepare for revamping envoy-init
alternatively we could delay this PR and get envoyinit broken out as well in prep for the mass purge
see also #10491
_ "github.com/solo-io/gloo/projects/gloo/pkg/translator" | ||
// _ "github.com/solo-io/gloo/projects/gloo/pkg/translator" | ||
// | ||
// TODO: these imports are effectively copied over from envoyinit/filter_types.gen.go |
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.
see also #10491
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 comment
The 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 comment
The 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
- name: GOLANG_PROTOBUF_REGISTRATION_CONFLICT | ||
value: ignore |
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
this is a copy/paste of projects/gloo/pkg/plugins/staged_filters.go
needs to be figured out as part of #10491
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.
this is a copy/paste of gloo's filter stage proto-based api
(ref: projects/gloo/pkg/api/v1/filters/stages.pb.go
)
the actual plan for this should be figured out in #10491
// MessageToAny takes any given proto message msg and returns the marshalled bytes of the proto, and a url to the type | ||
// definition for the proto in the form of a *pany.Any, errors if nil or if the proto type doesnt exist or if there is | ||
// a marshalling error | ||
func MessageToAny(msg proto.Message) (*pany.Any, error) { |
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.
once we get rid old protos we can get rid of this and just do anypb.New
}, nil | ||
} | ||
|
||
func AnyToMessage(a *pany.Any) (proto.Message, error) { |
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.
same as above but with any.UnmarshalTo
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.
lgtm; will wait with approval to give a chance to others to comment
@@ -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 comment
The 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.
Therefore I am marginally on the side of keeping it
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.
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 comment
The 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.
but thinking a bit more, we still will interact with envoy protos and in general it doesn't hurt to keep it around!
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.
can we replace this tool in favor of https://golangci-lint.run/usage/linters/#protogetter? or remove it entirely until there's a need?
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.
lgtm.
The only parts where i started digging in and was about to comment ended up just being copied code so n oneed to relitigate them now!
Thanks for doing this!
- 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" |
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
?
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 comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
Removes all dependencies on existing gloo code to allow the kgateway controller (current under
projects/gateway2
) to build on its own.This is a prerequisite to purging the no longer needed Gloo Edge code that primarily serves the classic Gloo Edge API.
The organization and abstractions of the helper code/packages that were copied out from the Gloo Edge code was not given much thought as the primary goal here is to get a buildable unit that passes all tests. We will need to audit and cleanup the way the previously shared code is organized and factored in a fast-follow.
There is some leftover work from when I initially was going to delete many of the existing project dirs, notably including
envoyinit
. Since this PR doesn't remove envoyinit, the related changes are not completely necessary. But they do not hurt anything and will be fixed in the PR in this series, I am tempted to leave them in as-is.