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

Check route is not ready when underlying revision is not healthy in TestContainerErrorMsg #4682

Merged
merged 2 commits into from
Jul 17, 2019

Conversation

nak3
Copy link
Contributor

@nak3 nak3 commented Jul 10, 2019

This PR fixes following TODO comment

// TODO(jessiezcc): add the check to validate that Route is not marked as ready once https://github.com/knative/serving/issues/990 is fixed

Proposed Changes

This patch changes TestContainerErrorMsg to:

  • create new service instead of configuration.
  • make sure route state is not ready when revision is not healthy.

/lint

Release Note

NONE

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 10, 2019
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 10, 2019
@knative-prow-robot knative-prow-robot added the area/test-and-release It flags unit/e2e/conformance/perf test issues for product features label Jul 10, 2019
@knative-prow-robot
Copy link
Contributor

Hi @nak3. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 10, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nak3: 0 warnings.

In response to this:

This PR fixes following TODO comment

// TODO(jessiezcc): add the check to validate that Route is not marked as ready once https://github.com/knative/serving/issues/990 is fixed

Proposed Changes

This patch changes TestContainerErrorMsg to:

  • create new service instead of configuration.
  • make sure route state is not ready when revision is not healthy.

/lint

Release Note

NONE

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dprotaso
Copy link
Member

/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 10, 2019
// IsRouteNotReady will check the status conditions of the route and return true if the route is
// not ready.
func IsRouteNotReady(r *v1alpha1.Route) (bool, error) {
return !r.Status.IsReady(), nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IsRouteReady check has a generation check that we probably want here

r.Generation == r.Status.ObservedGeneration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dprotaso Thank you!

But it seems that routes.status.ObservedGeneration is not assigned until the Route becomes ready. So, the test fails due to Generation=1 vs ObservedGeneration=0 mismatch.
For example, when we deployed invalid image below,

cat <<EOF | kubectl apply -f -
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: helloworld-go
spec:
  runLatest:
    configuration:
      revisionTemplate:
        spec:
          container:
            image: image-registry.openshift-image-registry.svc:5000/knative-serving/invalidhelloworld
            resources:
              limits:
                cpu: 100m
                memory: 200M
              requests:
                cpu: 100u
                memory: 100M
            env:
              - name: TARGET
                value: "Go Sample v1"
EOF

observedGeneration is not assigned and does have 0 for observedGeneration until it becomes Ready.

$ kubectl get rt -o yaml helloworld-go |grep -E "generation|observedGeneration"
  generation: 1

// IsRouteNotReady will check the status conditions of the route and return true if the route is
// not ready.
func IsRouteNotReady(r *v1beta1.Route) (bool, error) {
return !r.Status.IsReady(), nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment applies re: generation check

@dprotaso
Copy link
Member

/assign @dprotaso

@nak3
Copy link
Contributor Author

nak3 commented Jul 10, 2019

/test pull-knative-serving-integration-tests

Hmm.. log says "container-error-msg-rxgqnihf" not found but the Configuration container-error-msg-rxgqnihf does exist in the logs.

    errorcondition_test.go:86: Failed to validate configuration state: configuration "container-error-msg-rxgqnihf" is not in desired state, got: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name: GenerateName: Namespace: SelfLink: UID: ResourceVersion: Generation:0 CreationTimestamp:0001-01-01 00:00:00 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[] OwnerReferences:[] Initializers:nil Finalizers:[] ClusterName:} Spec:{DeprecatedGeneration:0 DeprecatedBuild:nil DeprecatedRevisionTemplate:<nil> Template:<nil>} Status:{Status:{ObservedGeneration:0 Conditions:[]} ConfigurationStatusFields:{LatestReadyRevisionName: LatestCreatedRevisionName:}}}: configurations.serving.knative.dev "container-error-msg-rxgqnihf" not found
- apiVersion: serving.knative.dev/v1beta1
  kind: Configuration
  metadata:
    annotations:
      serving.knative.dev/creator: prow-job@knative-tests.iam.gserviceaccount.com
      serving.knative.dev/lastModifier: prow-job@knative-tests.iam.gserviceaccount.com
    creationTimestamp: "2019-07-10T13:49:24Z"
    deletionGracePeriodSeconds: 0
    deletionTimestamp: "2019-07-10T13:49:30Z"
    finalizers:
    - foregroundDeletion
    generation: 2
    labels:
      serving.knative.dev/service: container-error-msg-rxgqnihf
    name: container-error-msg-rxgqnihf
    ....

And my env always passes the test.

@dprotaso
Copy link
Member

Yeah looks like it's being addressed on here: #4594

/lgtm
/approve

@knative-prow-robot knative-prow-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 10, 2019
@nak3
Copy link
Contributor Author

nak3 commented Jul 10, 2019

/hold

It looks like test does not pass. I will look into it.

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 10, 2019
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 11, 2019
@nak3
Copy link
Contributor Author

nak3 commented Jul 11, 2019

/hold cancel

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 11, 2019
@dprotaso
Copy link
Member

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 12, 2019
@dprotaso
Copy link
Member

@nak3 you'll need to rebase

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 13, 2019
@nak3
Copy link
Contributor Author

nak3 commented Jul 13, 2019

@dprotaso Thank you! Yes, I rebased now.

Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2019
@nak3
Copy link
Contributor Author

nak3 commented Jul 15, 2019

/test pull-knative-serving-integration-tests

nak3 added 2 commits July 17, 2019 13:21
…estContainerErrorMsg

This patch changes TestContainerErrorMsg to:
- create new service instead of configuration.
- make sure route state is not ready when revision is not healthy.
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2019
Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, markusthoemmes, nak3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit bcd9277 into knative:master Jul 17, 2019
@nak3 nak3 deleted the route-check branch July 17, 2019 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release It flags unit/e2e/conformance/perf test issues for product features cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants