Skip to content
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

code cleanup: remove glooctl v2 references #9435

Merged
merged 18 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/v1.17.0-beta35/glooctl-v2-naming.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog:
- type: NON_USER_FACING
issueLink: https://github.com/solo-io/solo-projects/issues/6080
resolvesIssue: false
description: >-
Code cleanup: remove v2 references from glooctl code
15 changes: 4 additions & 11 deletions projects/gloo/cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,11 @@ echo "Add the gloo CLI to your path with:"
echo " export PATH=\$HOME/.gloo/bin:\$PATH"
echo ""

# if version 2, only one install command exists

echo "Now run:"
if [[ $gloo_version == v2* ]]; then
echo " glooctl install # install gloo gateway v2 into the 'gloo-system' namespace"
echo "Please see visit the Gloo Installation guides for more: https://docs.solo.io/gloo-gateway/v2/"
else
echo " glooctl install gateway # install gloo's function gateway functionality into the 'gloo-system' namespace"
echo " glooctl install ingress # install very basic Kubernetes Ingress support with Gloo into namespace gloo-system"
echo " glooctl install knative # install Knative serving with Gloo configured as the default cluster ingress"
echo "Please see visit the Gloo Installation guides for more: https://docs.solo.io/gloo-edge/latest/installation/"
fi
echo " glooctl install gateway # install gloo's function gateway functionality into the 'gloo-system' namespace"
echo " glooctl install ingress # install very basic Kubernetes Ingress support with Gloo into namespace gloo-system"
echo " glooctl install knative # install Knative serving with Gloo configured as the default cluster ingress"
echo "Please see visit the Gloo Installation guides for more: https://docs.solo.io/gloo-edge/latest/installation/"
exit 0
done

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v2
package kubegateway

import (
"context"
Expand Down
18 changes: 9 additions & 9 deletions projects/gloo/cli/pkg/cmd/check/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ func RootCmd(opts *options.Options, optionsFunc ...cliutils.OptionsFunc) *cobra.
printer := printers.P{OutputType: opts.Top.Output}
printer.CheckResult = printer.NewCheckResult()

// TODO add back the v2 check (probably better to pass in as a flag rather than try to infer it)
// TODO add back the kubegateway check (probably better to pass in as a flag rather than try to infer it)
// var err error
// call v2 check if k8s gateway crds are detected, otherwise call v1 check
// isV2 := detectCrdsV2(opts.Top.KubeContext)
// if isV2 {
// err = v2.Check(ctx, printer, opts)
// call kubegateway check if k8s gateway crds are detected, otherwise call classic check
// isKubeGateway := detectKubeGatewayCrds(opts.Top.KubeContext)
// if isKubeGateway {
// err = kubegateway.Check(ctx, printer, opts)
// } else {
err := CheckResources(ctx, printer, opts)
// }
Expand All @@ -92,8 +92,8 @@ func RootCmd(opts *options.Options, optionsFunc ...cliutils.OptionsFunc) *cobra.
printer.AppendMessage("No problems detected.")
}

// TODO add back the v2 check
// if !isV2 {
// TODO add back the kubegateway check
// if !isKubeGateway {
CheckMulticlusterResources(ctx, printer, opts)
// }

Expand Down Expand Up @@ -1007,8 +1007,8 @@ func isCrdNotFoundErr(crd crd.Crd, err error) bool {
}
}

// copied from projects/gloo/cli/pkg/cmd/install/v2/install.go (TODO: dedupe/clean up)
func detectCrdsV2(kubeContext string) bool {
// copied from projects/gloo/cli/pkg/cmd/install/kubegateway/install.go (TODO: dedupe/clean up)
func detectKubeGatewayCrds(kubeContext string) bool {
cfg, err := kubeutils.GetRestConfigWithKubeContext(kubeContext)
if err != nil {
return false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v2
package kubegateway

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v2
package kubegateway

import (
"github.com/solo-io/gloo/projects/gloo/cli/pkg/cmd/options"
Expand Down Expand Up @@ -34,7 +34,6 @@ func InstallCmd(opts *options.Options, optionsFunc ...cliutils.OptionsFunc) *cob
Short: constants.INSTALL_COMMAND.Short,
Long: constants.INSTALL_COMMAND.Long,
RunE: func(cmd *cobra.Command, args []string) error {
// Default to Gloo Gateway V2
return install(opts, installOpts)
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package v2
package kubegateway

import (
"context"
Expand Down
4 changes: 2 additions & 2 deletions projects/gloo/cli/pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ func CommandWithContext(ctx context.Context) *cobra.Command {
istio.RootCmd(opts),
initpluginmanager.Command(context.Background()),
// TODO: re-enable this when it's working again
// v2.InstallCmd(opts),
// v2.UninstallCmd(opts),
// kubegateway.InstallCmd(opts),
// kubegateway.UninstallCmd(opts),
completionCmd(),
)
}
Expand Down
Loading