Skip to content

Improve error from readiness probe validation#5385

Merged
knative-prow-robot merged 2 commits intoknative:masterfrom
nak3:validation
Sep 4, 2019
Merged

Improve error from readiness probe validation#5385
knative-prow-robot merged 2 commits intoknative:masterfrom
nak3:validation

Conversation

@nak3
Copy link
Copy Markdown
Contributor

@nak3 nak3 commented Sep 4, 2019

Proposed Changes

As described in #5382,
failureThreshold and timeoutSeconds in readinessprobe are
disapplowed only when periodSeconds is zero. This patch improves the
error.

  • Error message after this patch:
error: services.serving.knative.dev "hello-example" could not be patched: Internal error occurred: admission webhook "webhook.serving.knative.dev" denied the request: mutation failed: timeoutSeconds is disallowed when periodSeconds is zero: spec.template.spec.containers[0].readinessProbe.failureThreshold, spec.template.spec.containers[0].readinessProbe.periodSeconds

/lint

Fixes #5382

Release Note

NONE

As described in knative#5382,
`failureThreshold` and `timeoutSeconds` in readinessprobe are
disapplowed only when `periodSeconds` is zero. This patch improves the
error.

- Error message after this patch:
```
error: services.serving.knative.dev "hello-example" could not be patched: Internal error occurred: admission webhook "webhook.serving.knative.dev" denied the request: mutation failed: timeoutSeconds is disallowed when periodSeconds is zero: spec.template.spec.containers[0].readinessProbe.failureThreshold, spec.template.spec.containers[0].readinessProbe.periodSeconds
```
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Sep 4, 2019
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 4, 2019
Copy link
Copy Markdown
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.

Details

In response to this:

Proposed Changes

As described in #5382,
failureThreshold and timeoutSeconds in readinessprobe are
disapplowed only when periodSeconds is zero. This patch improves the
error.

  • Error message after this patch:
error: services.serving.knative.dev "hello-example" could not be patched: Internal error occurred: admission webhook "webhook.serving.knative.dev" denied the request: mutation failed: timeoutSeconds is disallowed when periodSeconds is zero: spec.template.spec.containers[0].readinessProbe.failureThreshold, spec.template.spec.containers[0].readinessProbe.periodSeconds

/lint

Fixes #5382

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.

@knative-prow-robot knative-prow-robot added the area/API API objects and controllers label Sep 4, 2019
Comment thread pkg/apis/serving/k8s_validation.go Outdated
errs = errs.Also(apis.ErrDisallowedFields("failureThreshold"))
errs = errs.Also(&apis.FieldError{
Message: "failureThreshold is disallowed when periodSeconds is zero",
Paths: []string{"periodSeconds", "failureThreshold"},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PeriodSeconds probably can be omitted from the path, since its value is valid.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you @vagababov Yes, updated.

@dgerd
Copy link
Copy Markdown

dgerd commented Sep 4, 2019

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgerd, nak3

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

The pull request process is described here

Details 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 4, 2019
@knative-test-reporter-robot
Copy link
Copy Markdown

The following jobs failed due to test flakiness:

Test name Triggers Retries
pull-knative-serving-integration-tests pull-knative-serving-integration-tests 1/3

Automatically retrying...
/test pull-knative-serving-integration-tests

@nak3
Copy link
Copy Markdown
Contributor Author

nak3 commented Sep 4, 2019

/test pull-knative-serving-integration-tests

@knative-prow-robot knative-prow-robot merged commit c1583f3 into knative:master Sep 4, 2019
@nak3 nak3 deleted the validation branch September 4, 2019 05:58
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/API API objects and controllers cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the error messages from our readiness probe validation

6 participants