From 7cab5753deab2a73adcdb6f6e0694f9996ac5b4a Mon Sep 17 00:00:00 2001 From: Abhishek Raut Date: Tue, 10 Mar 2020 14:18:22 -0700 Subject: [PATCH] Update code comment for NetworkPolicyPeer NetworkPolicyPeer in types has an outdated comment from the times when it only supported ingress rules. Update the comment to reflect the current usage of the field. --- api/openapi-spec/swagger.json | 2 +- pkg/apis/networking/types.go | 2 +- staging/src/k8s.io/api/networking/v1/generated.proto | 2 +- staging/src/k8s.io/api/networking/v1/types.go | 2 +- .../src/k8s.io/api/networking/v1/types_swagger_doc_generated.go | 2 +- staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger.json | 2 +- staging/src/k8s.io/kubectl/testdata/openapi/swagger.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index f1f617e6d69..4cb96f65948 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -11656,7 +11656,7 @@ ] }, "io.k8s.api.networking.v1.NetworkPolicyPeer": { - "description": "NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of fields are allowed", + "description": "NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed", "properties": { "ipBlock": { "$ref": "#/definitions/io.k8s.api.networking.v1.IPBlock", diff --git a/pkg/apis/networking/types.go b/pkg/apis/networking/types.go index 4177eab95d6..2d91dd643bb 100644 --- a/pkg/apis/networking/types.go +++ b/pkg/apis/networking/types.go @@ -158,7 +158,7 @@ type IPBlock struct { Except []string } -// NetworkPolicyPeer describes a peer to allow traffic from. +// NetworkPolicyPeer describes a peer to allow traffic to/from. type NetworkPolicyPeer struct { // This is a label selector which selects Pods. This field follows standard label // selector semantics; if present but empty, it selects all pods. diff --git a/staging/src/k8s.io/api/networking/v1/generated.proto b/staging/src/k8s.io/api/networking/v1/generated.proto index f2aa96900c5..211cb8587cd 100644 --- a/staging/src/k8s.io/api/networking/v1/generated.proto +++ b/staging/src/k8s.io/api/networking/v1/generated.proto @@ -109,7 +109,7 @@ message NetworkPolicyList { repeated NetworkPolicy items = 2; } -// NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of +// NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of // fields are allowed message NetworkPolicyPeer { // This is a label selector which selects Pods. This field follows standard label diff --git a/staging/src/k8s.io/api/networking/v1/types.go b/staging/src/k8s.io/api/networking/v1/types.go index 73580a50cfb..70af1166a68 100644 --- a/staging/src/k8s.io/api/networking/v1/types.go +++ b/staging/src/k8s.io/api/networking/v1/types.go @@ -161,7 +161,7 @@ type IPBlock struct { Except []string `json:"except,omitempty" protobuf:"bytes,2,rep,name=except"` } -// NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of +// NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of // fields are allowed type NetworkPolicyPeer struct { // This is a label selector which selects Pods. This field follows standard label diff --git a/staging/src/k8s.io/api/networking/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/networking/v1/types_swagger_doc_generated.go index b404e5b1169..1d3b479fb10 100644 --- a/staging/src/k8s.io/api/networking/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/networking/v1/types_swagger_doc_generated.go @@ -78,7 +78,7 @@ func (NetworkPolicyList) SwaggerDoc() map[string]string { } var map_NetworkPolicyPeer = map[string]string{ - "": "NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of fields are allowed", + "": "NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed", "podSelector": "This is a label selector which selects Pods. This field follows standard label selector semantics; if present but empty, it selects all pods.\n\nIf NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.", "namespaceSelector": "Selects Namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces.\n\nIf PodSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.", "ipBlock": "IPBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.", diff --git a/staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger.json b/staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger.json index 36a24895c9f..6e4b7d9cbc5 100644 --- a/staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger.json +++ b/staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger.json @@ -13744,7 +13744,7 @@ ] }, "io.k8s.api.networking.v1.NetworkPolicyPeer": { - "description": "NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of fields are allowed", + "description": "NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed", "properties": { "ipBlock": { "$ref": "#/definitions/io.k8s.api.networking.v1.IPBlock", diff --git a/staging/src/k8s.io/kubectl/testdata/openapi/swagger.json b/staging/src/k8s.io/kubectl/testdata/openapi/swagger.json index 36a24895c9f..6e4b7d9cbc5 100644 --- a/staging/src/k8s.io/kubectl/testdata/openapi/swagger.json +++ b/staging/src/k8s.io/kubectl/testdata/openapi/swagger.json @@ -13744,7 +13744,7 @@ ] }, "io.k8s.api.networking.v1.NetworkPolicyPeer": { - "description": "NetworkPolicyPeer describes a peer to allow traffic from. Only certain combinations of fields are allowed", + "description": "NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed", "properties": { "ipBlock": { "$ref": "#/definitions/io.k8s.api.networking.v1.IPBlock",