Skip to content

add label selector to DestinationRule subset config #3397

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions kubernetes/customresourcedefinitions.gen.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

704 changes: 702 additions & 2 deletions networking/v1alpha3/destination_rule.pb.go

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions networking/v1alpha3/destination_rule.pb.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions networking/v1alpha3/destination_rule.proto
Original file line number Diff line number Diff line change
@@ -337,6 +337,8 @@ message Subset {
// specified at the subset level will override the corresponding settings
// specified at the DestinationRule level.
TrafficPolicy traffic_policy = 3;

istio.type.v1beta1.LabelSelector selector = 4;
Copy link
Member

Choose a reason for hiding this comment

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

add some ducuments, what is the relationship with labels field

}

// Load balancing policies to apply for a specific destination. See Envoy's
313 changes: 292 additions & 21 deletions type/v1beta1/selector.pb.go
101 changes: 100 additions & 1 deletion type/v1beta1/selector.pb.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions type/v1beta1/selector.proto
Original file line number Diff line number Diff line change
@@ -129,3 +129,39 @@ message PolicyTargetReference {
// +kubebuilder:validation:XValidation:message="cross namespace referencing is not currently supported",rule="self.size() == 0"
string namespace = 4;
}

// A label selector requirement is a selector that contains values, a key, and an operator that
// relates the key and values.
// Copied from Kubernetes to avoid expensive dependency on Kubernetes libraries.
message LabelSelector {
// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
// map is equivalent to an element of matchExpressions, whose key field is "key", the
// operator is "In", and the values array contains only "value". The requirements are ANDed.
// +optional
map<string, string> matchLabels = 1;

// matchExpressions is a list of label selector requirements. The requirements are ANDed.
// +optional
repeated LabelSelectorRequirement matchExpressions = 2;
}

// A label selector requirement is a selector that contains values, a key, and an operator that
// relates the key and values.
// Copied from Kubernetes to avoid expensive dependency on Kubernetes libraries.
message LabelSelectorRequirement {
// key is the label key that the selector applies to.
// +patchMergeKey=key
// +patchStrategy=merge
string key = 1;

// operator represents a key's relationship to a set of values.
// Valid operators are In, NotIn, Exists and DoesNotExist.
string operator = 2;

// values is an array of string values. If the operator is In or NotIn,
// the values array must be non-empty. If the operator is Exists or DoesNotExist,
// the values array must be empty. This array is replaced during a strategic
// merge patch.
// +optional
repeated string values = 3;
}
42 changes: 42 additions & 0 deletions type/v1beta1/selector_deepcopy.gen.go
23 changes: 23 additions & 0 deletions type/v1beta1/selector_json.gen.go