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

Add WorkloadSelector definition in a common directory. #1032

Merged
merged 4 commits into from
Aug 13, 2019

Conversation

liminw
Copy link
Contributor

@liminw liminw commented Aug 9, 2019

No description provided.

@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Aug 9, 2019
@liminw liminw requested a review from yangminzhu August 9, 2019 23:52
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 9, 2019
@liminw liminw requested a review from rshriram August 9, 2019 23:53

#####################
# Generation Rules
#####################

generate: \
generate-type \
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be tab instead of whitespaces.

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.


option go_package="istio.io/api/type/v1beta1";

// WorkloadSelector specifies the criteria used to determine if a policy can be applied
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to hide the doc, I think you also need $hide_from_docs here.

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.

Copy link
Member

Choose a reason for hiding this comment

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

Can you also update the EnvoyFilter to use this workload selector [and update the comments in envoyfilter accordingly] ? The workloadSelector there has not been released yet.
There is a workloadSelector in the Sidecar.proto.. Please remove it and make the sidecar refer to this. Since the sidecar uses workloadSelector.labels, i suggest you add a labels field in this proto and mark it as deprecated.
In the implementation, its as simple as copying the value from the existing labels field into the new matchLabels field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will do EnvoyFilter/Sidecar proto change in a separate PR.

cue.yaml Outdated
@@ -7,6 +7,8 @@ openapi:
fieldFilter: "min.*|max.*"

directories:
type/v1beta1:
- mode: all
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to use perFile

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.

@costinm
Copy link
Contributor

costinm commented Aug 10, 2019 via email

@liminw
Copy link
Contributor Author

liminw commented Aug 12, 2019

@costinm I think there is consensus we need a common "selector" definition. This PR just added one following Istio Config Model.
The existing selector definitions are already different.

In sidecar

workloadSelector:
   labels:
      app: A

In Gateway,

selector:
   app: A

As @rshriram commented in this PR, if we choose consistency, some form of deprecation cannot be avoided.

I don't care too much about the exact naming, as long as there is consensus. Since we are introducing beta API now, I think it is important to make sure API stability and consistency.

@louiscryan Any recommendation?


option go_package="istio.io/api/type/v1beta1";

// $hide_from_docs
Copy link
Member

Choose a reason for hiding this comment

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

no hide from docs if this is going to be used by Sidecar/envoyfilter etc.

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.

@istio-testing istio-testing merged commit 2745b7c into istio:master Aug 13, 2019
@liminw liminw deleted the selector branch August 13, 2019 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants