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

Do not allow modification for creator/lastModifer annotations #4763

Merged
merged 3 commits into from
Aug 5, 2019

Conversation

savitaashture
Copy link
Contributor

Fixes #4648

Proposed Changes

#4648 (comment)

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 16, 2019
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 16, 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.

@savitaashture: 0 warnings.

In response to this:

Fixes #4648

Proposed Changes

#4648 (comment)

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 16, 2019
@knative-prow-robot
Copy link
Contributor

Hi @savitaashture. 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 area/API API objects and controllers label Jul 16, 2019
@markusthoemmes
Copy link
Contributor

/ok-to-test

/assign @dgerd

@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 16, 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.

Reading through the referenced comment, I think @dgerd suggested to validate the incoming update in the webhook, which would be adjusting the Validation method rather than the SetDefaults method.

pkg/apis/serving/v1alpha1/service_defaults_test.go Outdated Show resolved Hide resolved
pkg/apis/serving/v1alpha1/service_defaults.go Outdated Show resolved Hide resolved
@savitaashture
Copy link
Contributor Author

Reading through the referenced comment, I think @dgerd suggested to validate the incoming update in the webhook, which would be adjusting the Validation method rather than the SetDefaults method.

@markusthoemmes Thank you
Yes you are right i need to modify in validation not in SetDefaults
I will change now.

@savitaashture savitaashture changed the title Do not allow modification for creator/lastModifer annotations [WIP] Do not allow modification for creator/lastModifer annotations Jul 16, 2019
@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 16, 2019
Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

This should als

pkg/apis/serving/v1alpha1/service_defaults.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 16, 2019
@savitaashture savitaashture force-pushed the issue-4648 branch 3 times, most recently from 95ca7fc to 8a1e6f1 Compare July 16, 2019 19:32
@savitaashture savitaashture changed the title [WIP] Do not allow modification for creator/lastModifer annotations Do not allow modification for creator/lastModifer annotations Jul 16, 2019
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 16, 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.

Looks good overall, thanks for the changes?

One general question: Do these changes need to apply to all of our CRDs? Could the logic be generalized in knative.dev/pkg and then be called in the individual Validate functions?

pkg/apis/serving/v1alpha1/service_validation.go Outdated Show resolved Hide resolved
pkg/apis/serving/v1alpha1/service_validation_test.go Outdated Show resolved Hide resolved
pkg/apis/serving/v1beta1/service_validation.go Outdated Show resolved Hide resolved
pkg/apis/serving/v1beta1/service_validation.go Outdated Show resolved Hide resolved
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.

/approve

Seems to me we can move this in as a stepping stone. Next step would be to make it more general in knative.dev/pkg and then apply it to the other CRDs in a third step?

/assign @dgerd

@savitaashture
Copy link
Contributor Author

@markusthoemmes @dgerd
I have moved annotation validation logic to knative.dev/pkg

knative/pkg#539

@mattmoor
Copy link
Member

Needs a rebase.

@savitaashture
Copy link
Contributor Author

Needs a rebase.

@mattmoor waiting for knative/pkg#539 PR to be merge
Once that is done i need to refactor and rebase on top of those changes.

@mattmoor
Copy link
Member

Well I can help with that :)

The Serving dep on PKG should automatically get updated around 7am Pacific tomorrow.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 30, 2019
@savitaashture
Copy link
Contributor Author

/retest

@shashwathi
Copy link
Contributor

/test pull-knative-serving-integration-tests

@savitaashture
Copy link
Contributor Author

/assign @mattmoor

@mattmoor
Copy link
Member

mattmoor commented Aug 5, 2019

/unassign

I was going to leave this for @dgerd

@dgerd
Copy link

dgerd commented Aug 5, 2019

This PR highlights the need to take a further look at de-duping and sharing logic between v1alpha1 and v1beta1, but we can do that in 0.9.

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgerd, markusthoemmes, savitaashture

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 Aug 5, 2019
@knative-test-reporter-robot

The following tests are currently flaky. Running them again to verify...

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

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

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

It should be impossible to modify creator/lastModifer annotations
10 participants