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

Remove/Withdraw NetworkPolicy Status #115843

Merged
merged 3 commits into from May 2, 2023

Conversation

rikatz
Copy link
Contributor

@rikatz rikatz commented Feb 16, 2023

What type of PR is this?

/kind cleanup
/kind feature
/kind deprecation

What this PR does / why we need it:

sig-network has decided to not move forward with NetworkPolicyStatus feature. This PR removes the feature implemented in #107963

Which issue(s) this PR fixes:

Fixes kubernetes/enhancements#2943

Special notes for your reviewer:

I've added the comment with the previous protobuf name, lmk if this is fine :)

Does this PR introduce a user-facing change?

Remove withdrawn feature NetworkPolicyStatus

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

- [KEP](https://github.com/kubernetes/enhancements/tree/master/keps/sig-network/2943-networkpolicy-status)

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. 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. labels Feb 16, 2023
@rikatz
Copy link
Contributor Author

rikatz commented Feb 16, 2023

/sig network

@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 16, 2023
@k8s-ci-robot k8s-ci-robot added area/code-generation area/network-policy Issues or PRs related to Network Policy subproject area/test kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Feb 16, 2023
@rikatz rikatz force-pushed the remote-netpol-status branch 2 times, most recently from 28ab43e to efb8a6f Compare February 16, 2023 18:44
@k8s-ci-robot k8s-ci-robot added area/conformance Issues or PRs related to kubernetes conformance tests sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. labels Feb 16, 2023
@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@sftim
Copy link
Contributor

sftim commented Feb 17, 2023

For the changelog, do we actually mean:

Changed NetworkPolicy to always have an empty `.status` field

or something similar? Maybe we'd also mention that the feature gate is now deprecated and doesn't work, and that NetworkPolicies never have a status subresource.

@cici37
Copy link
Contributor

cici37 commented Feb 21, 2023

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Feb 21, 2023
@liggitt
Copy link
Member

liggitt commented May 1, 2023

I don't think the "after_roundtrip" files are supposed to be checked in. @liggitt is that right?

They should persist when we're intentionally removing the ability to round trip all data known to previously released types, like we are here. The after_roundtrip files make visible the fact that current type definitions drop (or alter!!!) data which type definitions in previous releases serialized. They should be ~rare, and really only occur when we knowingly intentionally drop fields.

The diff shows the only thing getting dropped is the status stanza which we never allowed to persist in etcd because of the alpha feature:

diff -u \
   <(tail -c +5 networking.k8s.io.v1.NetworkPolicy.pb | protoc --decode_raw) \
   <(tail -c +5 networking.k8s.io.v1.NetworkPolicy.after_roundtrip.pb | protoc --decode_raw)
--- /dev/fd/63	2023-05-01 19:46:54
+++ /dev/fd/62	2023-05-01 19:46:54
@@ -144,23 +144,6 @@
     }
     4: "policyTypesValue"
   }
-  3 {
-    1 {
-      1: "typeValue"
-      2 {
-        14 {
-        }
-        12: 0x65756c6156737574
-      }
-      3: 3
-      4 {
-        1: 1072918861
-        2: 0
-      }
-      5: "reasonValue"
-      6: "messageValue"
-    }
-  }
 }
 3: ""
 4: ""
diff networking.k8s.io.v1.NetworkPolicy{,.after_roundtrip}.yaml
98,105d97
< status:
<   conditions:
<   - lastTransitionTime: "2004-01-01T01:01:01Z"
<     message: messageValue
<     observedGeneration: 3
<     reason: reasonValue
<     status: statusValue
<     type: typeValue
diff networking.k8s.io.v1.NetworkPolicy{,.after_roundtrip}.json
162,173d161
<   },
<   "status": {
<     "conditions": [
<       {
<         "type": "typeValue",
<         "status": "statusValue",
<         "observedGeneration": 3,
<         "lastTransitionTime": "2004-01-01T01:01:01Z",
<         "reason": "reasonValue",
<         "message": "messageValue"
<       }
<     ]

Status NetworkPolicyStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
// Status is tombstoned to show why 3 is a reserved protobuf tag.
// This commented field should remain, so in the future if we decide to reimplement
// NetworkPolicyStatus a different protobuf name and tag SHOULD be used!
Copy link
Member

Choose a reason for hiding this comment

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

the tombstone is good, though FYI, if we reimplement NetworkPolicyStatus in a future release, the type will have to be compatible with the current type, since the json field name of status would overlap for clients linked to API types that had the status field

@liggitt
Copy link
Member

liggitt commented May 1, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 1, 2023
@rikatz
Copy link
Contributor Author

rikatz commented May 1, 2023

thanks @liggitt and @thockin

I will find someone to approve the testdata as this one apparently does need specific approval.

@rikatz
Copy link
Contributor Author

rikatz commented May 2, 2023

/cc @dims @johnbelamaric
for testdata approval

@dims
Copy link
Member

dims commented May 2, 2023

/approve
/lgtm
/skip

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, rikatz, thockin

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 May 2, 2023
@k8s-ci-robot k8s-ci-robot merged commit d6471d0 into kubernetes:master May 2, 2023
18 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone May 2, 2023
@cici37
Copy link
Contributor

cici37 commented May 2, 2023

/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 May 2, 2023
bertinatto added a commit to bertinatto/origin that referenced this pull request Aug 14, 2023
Feature has been removed in Kubernetes 1.28: kubernetes/kubernetes#115843
bertinatto added a commit to bertinatto/origin that referenced this pull request Aug 14, 2023
Feature has been removed in Kubernetes 1.28: kubernetes/kubernetes#115843
bertinatto added a commit to bertinatto/origin that referenced this pull request Aug 14, 2023
Feature has been removed in Kubernetes 1.28: kubernetes/kubernetes#115843
bertinatto added a commit to bertinatto/origin that referenced this pull request Aug 14, 2023
bertinatto added a commit to bertinatto/origin that referenced this pull request Aug 14, 2023
bertinatto added a commit to bertinatto/origin that referenced this pull request Aug 16, 2023
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/code-generation area/conformance Issues or PRs related to kubernetes conformance tests area/network-policy Issues or PRs related to Network Policy subproject 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 kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. kind/feature Categorizes issue or PR as related to a new feature. 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/apps Categorizes an issue or PR as relevant to SIG Apps. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/network Categorizes an issue or PR as relevant to SIG Network. 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
None yet
Development

Successfully merging this pull request may close these issues.

NetworkPolicy Status - Features and parsing
10 participants