kubernetes-sigs / network-policy-api

This repo addresses further work involving Kubernetes network security beyond the initial NetworkPolicy resource
Apache License 2.0
50 stars 28 forks source link

Do patch instead of update #218

Closed tssurya closed 2 months ago

tssurya commented 2 months ago

We are hitting a conformance test bug:

=== RUN   TestNetworkPolicyV2Conformance/AdminNetworkPolicyEgressNamedPort#01/Should_support_an_'allow-egress'_policy_for_named_port
2024-04-08T00:12:49.3743969Z     admin-network-policy-extended-egress-rules.go:78:
2024-04-08T00:12:49.3746768Z            Error Trace:    /home/runner/go/pkg/mod/sigs.k8s.io/network-policy-api@v0.1.3-0.20240311165859-d48faeeb0e02/conformance/tests/admin-network-policy-extended-egress-rules.go:78
2024-04-08T00:12:49.3748756Z            Error:          Received unexpected error:
2024-04-08T00:12:49.3752415Z                            Operation cannot be fulfilled on adminnetworkpolicies.policy.networking.k8s.io "egress-tcp": the object has been modified; please apply your changes to the latest version and try again
2024-04-08T00:12:49.3756029Z            Test:           TestNetworkPolicyV2Conformance/AdminNetworkPolicyEgressNamedPort#01/Should_support_an_'allow-egress'_policy_for_named_port
2024-04-08T00:12:49.3757297Z            Messages:       unable to update the admin network policy

that happens because resource version changes for the resource, let's use patch in our conformance tests instead of updates.

tssurya commented 2 months ago

/area conformance

tssurya commented 2 months ago

/kind bug

netlify[bot] commented 2 months ago

Deploy Preview for kubernetes-sigs-network-policy-api ready!

Name Link
Latest commit 135bf4bf87068173336ca236f413c1eaf0a4f6b9
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-network-policy-api/deploys/661b064c51c76900081cb995
Deploy Preview https://deploy-preview-218--kubernetes-sigs-network-policy-api.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astoycos, tssurya

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/network-policy-api/blob/main/OWNERS)~~ [astoycos] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment