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

apf: introduce v1beta2 #104399

Merged
merged 6 commits into from Sep 14, 2021
Merged

apf: introduce v1beta2 #104399

merged 6 commits into from Sep 14, 2021

Conversation

tkashem
Copy link
Contributor

@tkashem tkashem commented Aug 16, 2021

What type of PR is this?

/kind api-change

What this PR does / why we need it:

introduce v1beta2 - no changes in the API.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Introduce v1beta2 for Priority and Fairness with no changes in API spec

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver area/test labels Aug 16, 2021
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 16, 2021
@tkashem tkashem force-pushed the apf-v1beta2 branch 3 times, most recently from 5871b48 to ba117f4 Compare August 17, 2021 19:31
@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 17, 2021
@tkashem tkashem force-pushed the apf-v1beta2 branch 3 times, most recently from ccf527d to 6c15d40 Compare August 17, 2021 21:27
@tkashem tkashem changed the title [WIP] [DO NOT REVIEW] apf: enable v1beta2 [WIP] apf: enable v1beta2 Aug 17, 2021
@tkashem
Copy link
Contributor Author

tkashem commented Aug 17, 2021

--- FAIL: TestStorageVersionHashes (0.87s)
    instance_test.go:380: expect the storageVersionHash of flowcontrol.apiserver.k8s.io/v1beta1/flowschemas to be "9bSnTLYweJ0=", got "G+8IkrqFuJw="
    instance_test.go:380: expect the storageVersionHash of flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations to be "BFVwf8eYnsw=", got "wltM4WMeeXs="

For some reason, storageVersionHash for v1beta1 has been changed. I am trying to figure that out.

Also, I will open a KEP PR for the new type.

@tkashem
Copy link
Contributor Author

tkashem commented Aug 17, 2021

/assign @MikeSpreitzer @lavalamp @liggitt @deads2k

},
// --

// k8s.io/kubernetes/pkg/apis/flowcontrol/v1beta1
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "prioritylevelconfigurations"): {
Stub: `{"metadata": {"name": "conf2"}, "spec": {"type": "Limited", "limited": {"assuredConcurrencyShares":3, "limitResponse": {"type": "Reject"}}}}`,
ExpectedEtcdPath: "/registry/prioritylevelconfigurations/conf2",
ExpectedGVK: gvkP("flowcontrol.apiserver.k8s.io", "v1beta1", "PriorityLevelConfiguration"),
Copy link
Member

Choose a reason for hiding this comment

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

drop this line, the test doesn't expect an override since the storage GVK is still v1beta1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -273,13 +273,29 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "flowschemas"): {
Stub: `{"metadata": {"name": "va2"}, "spec": {"priorityLevelConfiguration": {"name": "name1"}}}`,
ExpectedEtcdPath: "/registry/flowschemas/va2",
ExpectedGVK: gvkP("flowcontrol.apiserver.k8s.io", "v1beta1", "FlowSchema"),
Copy link
Member

Choose a reason for hiding this comment

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

drop this line as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@tkashem tkashem changed the title [WIP] apf: introduce v1beta2 apf: introduce v1beta2 Aug 24, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 24, 2021
@MikeSpreitzer
Copy link
Member

/retest

@tkashem tkashem force-pushed the apf-v1beta2 branch 3 times, most recently from db868b4 to 8fc600e Compare September 7, 2021 22:18
gvr("flowcontrol.apiserver.k8s.io", "v1alpha1", "prioritylevelconfigurations"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"limited": {"assuredConcurrencyShares": 23}}}`,
gvr("flowcontrol.apiserver.k8s.io", "v1beta1", "prioritylevelconfigurations"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"limited": {"assuredConcurrencyShares": 23}}}`,
gvr("flowcontrol.apiserver.k8s.io", "v1beta2", "prioritylevelconfigurations"): `{"metadata": {"labels":{"a":"c"}}, "spec": {"limited": {"assuredConcurrencyShares": 23}}}`,
Copy link
Contributor Author

@tkashem tkashem Sep 8, 2021

Choose a reason for hiding this comment

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

This PR introduces v1beta2 for priority & fairness - v1beta2 is a straight copy from v1beta1 - no changes in the API spec.

TestApplyResetFields (integration test) is failing for v1beta2 of priorityLevelConfiguration with the following error

reset_fields_test.go:265: Failed to apply obj2: Apply failed with 4 conflicts: conflicts with "fieldmanager1":
        - .spec.limited.assuredConcurrencyShares
        - .status.conditions[type="MyStatus"]
        - .status.conditions[type="MyStatus"].type
        - .status.conditions[type="MyStatus"].type

but the same test for v1beta1 is passing.

@apelisse I am not familiar with the inner working of server side apply, i would appreciate it if you can provide any pointer for me to troubleshoot this issue further.

Copy link
Member

Choose a reason for hiding this comment

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

Very glad to see the integration test caught the gap. @apelisse, it would be good to document what people should do here and point them to the docs from the test failure

Looks like v1beta2 cases are needed in these methods:

  • flowSchemaStrategy#GetResetFields()
  • flowSchemaStatusStrategy#GetResetFields()
  • priorityLevelConfigurationStrategy#GetResetFields()
  • priorityLevelConfigurationStatusStrategy#GetResetFields()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @liggitt, I added the required GetResetFields fields for v1beta2 and now the test is passing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also, opened a new issue #104842 [ TestApplyResetFields test skips flowschemas resource due to flake].

But I ran it locally to make sure reset fields for flowschemas v1beta2 work as expected.

@@ -36,5 +37,6 @@ func Install(scheme *runtime.Scheme) {
utilruntime.Must(flowcontrol.AddToScheme(scheme))
utilruntime.Must(flowcontrolv1alpha1.AddToScheme(scheme))
utilruntime.Must(flowcontrolv1beta1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(flowcontrolv1beta1.SchemeGroupVersion, flowcontrolv1alpha1.SchemeGroupVersion))
utilruntime.Must(flowcontrolv1beta2.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(flowcontrolv1beta1.SchemeGroupVersion, flowcontrolv1beta2.SchemeGroupVersion))
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a reason that we can drop the v1alpha1?

Copy link
Member

@MikeSpreitzer MikeSpreitzer 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 to me.
I do not understand what is going wrong with the reset fields test.

@tkashem
Copy link
Contributor Author

tkashem commented Sep 13, 2021

I do not understand what is going wrong with the reset fields test.

@MikeSpreitzer GetResetFields was missing v1beta2, after adding the case it is all green now. But then I discovered a separate issue - #104842 which we will need to address in a separate PR.

@lavalamp
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 13, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lavalamp, MikeSpreitzer, tkashem

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 13, 2021
@k8s-ci-robot k8s-ci-robot merged commit cdcf2a2 into kubernetes:master Sep 14, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Sep 14, 2021
@liggitt liggitt moved this from Assigned to API review completed, 1.23 in API Reviews Oct 28, 2021
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/apiserver area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: API review completed, 1.23
Development

Successfully merging this pull request may close these issues.

None yet

8 participants