Skip to content

failureThreshold and timeoutSeconds parameter should be optional as per k8s doc #5732

@savitaashture

Description

@savitaashture

In what area(s)?

/area API
/kind good-first-issue

/area autoscale
/area build
/area monitoring
/area networking
/area test-and-release

Describe the feature

Currently when create a service with below provided info

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: hello
spec:
  template:
    metadata:
      name: hello-test
      annotations:
    spec:
      containers:
      - image: savita3020/helloworld
        readinessProbe:
          exec:
            command:
            - cat
            - /tmp/healthy
          initialDelaySeconds: 5
          periodSeconds: 5

Actual Output:

Error from server (BadRequest): error when creating "vol.yaml": admission webhook "resource.webhook.serving.knative.dev" denied the request: mutation failed: expected 1 <= 0 <= 2147483647: spec.template.spec.containers[0].readinessProbe.failureThreshold, spec.template.spec.containers[0].readinessProbe.timeoutSeconds

Expected Output:
Should create service successfully because failureThreshold and timeoutSeconds are optional fields if don't specify should take the default values as per doc

But in k8s_validation.go because check its failing.

Implementation:
Should provide a default values for failureThreshold and timeoutSeconds same like SuccessThreshold

So even if we don't specify failureThreshold and timeoutSeconds in service yaml it should create successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/APIAPI objects and controllersgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/featureWell-understood/specified features, ready for coding.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions