-
Notifications
You must be signed in to change notification settings - Fork 326
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
[NET-11256] Add gateway read
command to consul-k8s CLI
#4432
Conversation
gateway read
command to consul-k8s CLIgateway read
command to consul-k8s CLI
6eb79cf
to
ec7235f
Compare
cli/cmd/gateway/read/command.go
Outdated
f.StringVar(&flag.StringVar{ | ||
Name: "namespace", | ||
Target: &c.flagGatewayNamespace, | ||
Usage: "The namespace of the Gateway to read", |
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.
should we notify that the default value for this is the default namespace
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.
and should we clarify that it's the k8s namespace and not the consul namespace (in case they do some mapping of namespaces?)
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.
the default value is whatever namespace is set on the kubecontext, so it could be default
or it could be something else
|
||
toolchain go1.22.5 | ||
toolchain go1.22.6 |
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.
did we mean to bump the toolchain here? it's probably good that we do (and should probably be on the latest minor version tbh)
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 did not mean to -- I must be running a newer version of Go on my machine than what we use in the repo.
I'll bump it back down just to avoid sprawl in this PR
|
||
func (c *Command) fetchCRDs() error { | ||
// Fetch Gateway | ||
var gateway gwv1beta1.Gateway |
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.
is it possible that someone is running the v1alpha1 of the gateway if they're on an old consul-k8s version? should we worry about that/care about that?
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.
v1.2 which introduced Gateway
to consul-k8s itself consumes v1beta1.Gateway
here, so customers would have to be using the old standalone consul-api-gateway project in order to be running the v1alpha1.Gateway
.
Based on that, I don't think we need to support it here.
…e(s) for orphaned routes
15f6d99
to
709d625
Compare
Note
This PR is blocked by the bug fix in #4434 which is preventing tests from passing
Changes proposed in this PR
This PR adds a new command,
consul-k8s gateway read
, which collects the various components of configuration for a given Consul API Gateway –Gateway
, attachedHTTPRoutes
, attachedTCPRoutes
, etc. – into a single yaml file.It can output an archive named after the read gateway into the current directory, or it can output JSON to the terminal.
How I've tested this PR
Create one or more Gateways in your Kube cluster. Example for this config is available here.
Run the commands above to inspect the various forms of output, making sure to use both the implicit namespace on your kubecontext and an explicit
--namespace <my-namespace>
arg.How I expect reviewers to test this PR
See above
Checklist