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

fix(gloo): Use correct route table name in case service name was overwritten #1300

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
7 changes: 3 additions & 4 deletions pkg/router/gloo.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@ func (gr *GlooRouter) GetRoutes(canary *flaggerv1.Canary) (
mirrored bool,
err error,
) {
apexName := canary.Spec.TargetRef.Name
primaryName := fmt.Sprintf("%s-%s-primaryupstream-%v", canary.Namespace, canary.Spec.TargetRef.Name, canary.Spec.Service.Port)

apexName, _, _ := canary.GetServiceNames()
primaryUpstreamName := fmt.Sprintf("%s-%s-primaryupstream-%v", canary.Namespace, apexName, canary.Spec.Service.Port)
routeTable, err := gr.glooClient.GatewayV1().RouteTables(canary.Namespace).Get(context.TODO(), apexName, metav1.GetOptions{})
if err != nil {
err = fmt.Errorf("RouteTable %s.%s get query error: %w", apexName, canary.Namespace, err)
Expand All @@ -185,7 +184,7 @@ func (gr *GlooRouter) GetRoutes(canary *flaggerv1.Canary) (
}

for _, dst := range routeTable.Spec.Routes[0].Action.Destination.Destinations {
if dst.Destination.Upstream.Name == primaryName {
if dst.Destination.Upstream.Name == primaryUpstreamName {
primaryWeight = int(dst.Weight)
canaryWeight = 100 - primaryWeight
return
Expand Down
3 changes: 1 addition & 2 deletions test/gloo/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -o errexit

GLOO_VER="1.11.13"
GLOO_VER="1.12.31"
REPO_ROOT=$(git rev-parse --show-toplevel)

mkdir -p ${REPO_ROOT}/bin
Expand All @@ -15,7 +15,6 @@ helm upgrade -i gloo gloo/gloo --version ${GLOO_VER} \
--set discovery.enabled=false

kubectl -n gloo-system rollout status deployment/gloo
kubectl -n gloo-system rollout status deployment/gateway
kubectl -n gloo-system get all

echo '>>> Installing Flagger'
Expand Down