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

route status incorrect for two named traffic targets pointing to same revision #2276

Closed
dgerd opened this issue Oct 22, 2018 · 2 comments
Closed
Assignees
Labels
area/networking kind/bug Categorizes issue or PR as related to a bug.

Comments

@dgerd
Copy link

dgerd commented Oct 22, 2018

/area api
/area networking
/kind bug

Expected Behavior

For every traffic target in spec there should be a traffic target in status with a resolved revisionName.

Spec:

  traffic:
  - configurationName: hello-world
    name: alsotwo
    percent: 1
  - name: one
    percent: 50
    revisionName: hello-world-00001
  - name: two
    percent: 49
    revisionName: hello-world-00002

Status:

  traffic:
  - name: alsotwo
    revisionName: hello-world-00002
    percent: 1
  - name: one
    percent: 50
    revisionName: hello-world-00001
  - name: two
    percent: 49
    revisionName: hello-world-00002

Actual Behavior

If you create a route with multiple named traffic targets pointing to a same revision (using either configurationName or revisionName) one of them gets lost in translation to the status output.

I believe the issue is here:

func consolidateAll(targets map[string][]RevisionTarget) map[string][]RevisionTarget {

where routes are consolidated together. While the consolidation is useful for creating the virtualservice, we lose information for displaying status.

Spec:

  traffic:
  - configurationName: hello-world
    name: alsotwo
    percent: 1
  - name: one
    percent: 50
    revisionName: hello-world-00001
  - name: two
    percent: 49
    revisionName: hello-world-00002

Status:

  traffic:
  - name: alsotwo
    percent: 50
    revisionName: hello-world-00002
  - name: one
    percent: 50
    revisionName: hello-world-00001

Steps to Reproduce the Problem

  1. Create a revision
  2. Create a route with two named traffic targets pointing to the revision created in Step 1
    • The first traffic target in the list will be displayed in status while the second one will be missing. In the script below this will mean that "foo" will show up, but "bar" will be missing.

Additional Info

Script to reproduce (you will need to replace "REPLACEME" with the path to an image)

#!/bin/bash

CONFIGURATION_NAME='hello-world'
IMAGE_LOCATION='gcr.io/REPLACEME'

cat << EOF | kubectl apply -f -
apiVersion: serving.knative.dev/v1alpha1
kind: Configuration
metadata:
  name: ${CONFIGURATION_NAME}
  namespace: default
spec:
  revisionTemplate:
    spec:
      container:
        image: ${IMAGE_LOCATION}
        env:
          - name: TARGET
            value: "Go Sample v3"
EOF

cat << EOF | kubectl apply -f -
apiVersion: serving.knative.dev/v1alpha1
kind: Route
metadata:
  name: ${CONFIGURATION_NAME}
  namespace: default
spec:
  traffic:
  - configurationName: ${CONFIGURATION_NAME}
    percent: 50
    name: "foo"
  - configurationName: ${CONFIGURATION_NAME}
    percent: 50
    name: "bar"
EOF
@tcnghia
Copy link
Contributor

tcnghia commented Oct 22, 2018

/assign @tcnghia

@tcnghia tcnghia added area/networking kind/bug Categorizes issue or PR as related to a bug. area/API API objects and controllers labels Oct 22, 2018
@knative-prow-robot knative-prow-robot added area/autoscale area/build Build topics specifically related to Knative area/monitoring area/test-and-release It flags unit/e2e/conformance/perf test issues for product features kind/question Further information is requested kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/doc Something isn't clear kind/feature Well-understood/specified features, ready for coding. kind/good-first-issue kind/process Changes in how we work kind/spec Discussion of how a feature should be exposed to customers. labels Oct 22, 2018
@tcnghia tcnghia removed area/autoscale area/build Build topics specifically related to Knative area/monitoring area/test-and-release It flags unit/e2e/conformance/perf test issues for product features kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/doc Something isn't clear kind/feature Well-understood/specified features, ready for coding. kind/good-first-issue kind/process Changes in how we work kind/question Further information is requested kind/spec Discussion of how a feature should be exposed to customers. labels Oct 22, 2018
@tcnghia
Copy link
Contributor

tcnghia commented Oct 22, 2018

/remove-area api

@knative-prow-robot knative-prow-robot removed the area/API API objects and controllers label Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants