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

Guard PodSpec dry run with a feature flag #8276

Merged
merged 13 commits into from
Jun 11, 2020

Conversation

whaught
Copy link
Contributor

@whaught whaught commented Jun 9, 2020

Fixes #8077

Proposed Changes

Release Note


@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 9, 2020
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 9, 2020
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.

@whaught: 0 warnings.

In response to this:

Fixes #8077

Proposed Changes

  • Guard the PodSpec dry run feature with a feature flag

Release Note


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 Jun 9, 2020
@whaught
Copy link
Contributor Author

whaught commented Jun 9, 2020

/assign @JRBANCEL

@JRBANCEL
Copy link
Contributor

JRBANCEL commented Jun 9, 2020

Apart from the flag naming
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 9, 2020
@whaught
Copy link
Contributor Author

whaught commented Jun 9, 2020

/hold while I sync with @JRBANCEL on how we want to name these

@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 Jun 9, 2020
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 9, 2020
@whaught
Copy link
Contributor Author

whaught commented Jun 9, 2020

/assign @dprotaso

Copy link
Contributor

@shashwathi shashwathi left a comment

Choose a reason for hiding this comment

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

Does it make sense to have a flag for enabled and make the default behaviour for dryrun as disabled in this case? It would eliminate the need for enabled and disabled flags.

@JRBANCEL
Copy link
Contributor

Does it make sense to have a flag for enabled and make the default behaviour for dryrun as disabled in this case? It would eliminate the need for enabled and disabled flags.

We want to provide control to the operator. A cluster operator should be able to disable features entirely, or at least require the developers to manually enable it (that's what Allowed is).
Also, what is enabled by default changes overtime. Flags go through a lifecycle similar to https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#using-a-feature. We need to formalize this.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 11, 2020
@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-unit-tests 0/3

Failed non-flaky tests preventing automatic retry of pull-knative-serving-unit-tests:

cmd/activator.[build failed]
cmd/autoscaler.[build failed]
cmd/queue.[build failed]
pkg/activator/handler.[build failed]
pkg/activator/net.[build failed]
pkg/activator/util.[build failed]
pkg/apis/autoscaling/v1alpha1.[build failed]
pkg/apis/config.[build failed]

and 37 more.

@JRBANCEL
Copy link
Contributor

/approve
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2020
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2020
pkg/webhook/validate_service_test.go Outdated Show resolved Hide resolved
pkg/webhook/validate_service.go Outdated Show resolved Hide resolved
Copy link
Member

@dprotaso dprotaso 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 Jun 11, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, JRBANCEL, whaught

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2020
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/features.go 92.3% 86.7% -5.6
pkg/webhook/validate_service.go 91.7% 93.1% 1.4

case config.Disabled:
return nil
default:
mode = DryRunMode(uns.GetAnnotations()[PodSpecDryRunAnnotation])
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be same as disabled if annotation is not set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The feature is only client controlled by the annotation in "allowed" mode. Vendors may disable the feature completely or always run it with disable/allowed feature flags.

case config.Enabled:
mode = DryRunEnabled
case config.Disabled:
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this right though? This basically skips the whole validation?
I'd expect disable means we don't use dry run to validate the template.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the moment dryrun is the only validation in this codepath, but we'd want to rearrange this if we had other validations here

@whaught
Copy link
Contributor Author

whaught commented Jun 11, 2020

/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 Jun 11, 2020
@knative-prow-robot knative-prow-robot merged commit ab1a0fb into knative:master Jun 11, 2020
@whaught whaught deleted the feature-flag branch June 19, 2020 04:28
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate DryRun Validation with Feature Flags
10 participants