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

docs: document matchExpressions field for post-selectors #13646

Conversation

crenshaw-dev
Copy link
Member

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

Please see Contribution FAQs if you have questions about your pull-request.

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (fd5f3c4) 49.47% compared to head (97bf018) 49.48%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #13646   +/-   ##
=======================================
  Coverage   49.47%   49.48%           
=======================================
  Files         256      256           
  Lines       43841    43841           
=======================================
+ Hits        21692    21695    +3     
+ Misses      19987    19985    -2     
+ Partials     2162     2161    -1     

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@crenshaw-dev crenshaw-dev enabled auto-merge (squash) May 18, 2023 22:15
blakepettersson added a commit to blakepettersson/argo-cd that referenced this pull request May 24, 2023
Related to argoproj#13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
crenshaw-dev pushed a commit that referenced this pull request May 27, 2023
* fix: allow cluster urls to be matched

Related to #13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
blakepettersson added a commit to blakepettersson/argo-cd that referenced this pull request May 27, 2023
* fix: allow cluster urls to be matched

Related to argoproj#13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
blakepettersson added a commit to blakepettersson/argo-cd that referenced this pull request May 27, 2023
* fix: allow cluster urls to be matched

Related to argoproj#13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
blakepettersson added a commit to blakepettersson/argo-cd that referenced this pull request May 27, 2023
* fix: allow cluster urls to be matched

Related to argoproj#13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
crenshaw-dev pushed a commit that referenced this pull request May 27, 2023
* fix: allow cluster urls to be matched

Related to #13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.



* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.



---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
crenshaw-dev pushed a commit that referenced this pull request May 27, 2023
* fix: allow cluster urls to be matched

Related to #13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.



* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.



---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
crenshaw-dev pushed a commit that referenced this pull request May 27, 2023
* fix: allow cluster urls to be matched

Related to #13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.



* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.



---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Copy link
Collaborator

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

LGTM

@crenshaw-dev crenshaw-dev merged commit c8e44ed into argoproj:master Jun 2, 2023
@crenshaw-dev crenshaw-dev deleted the document-post-selector-match-expressions branch June 2, 2023 19:01
schakrad pushed a commit to schakrad/argo-cd that referenced this pull request Jul 24, 2023
…roj#13770)

* fix: allow cluster urls to be matched

Related to argoproj#13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.

* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: schakrad <58915923+schakrad@users.noreply.github.com>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
* fix: allow cluster urls to be matched

Related to argoproj#13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
tesla59 pushed a commit to tesla59/argo-cd that referenced this pull request Dec 16, 2023
* fix: allow cluster urls to be matched

Related to argoproj#13646, and after discussion with @crenshaw-dev, it turns
out that matching on cluster urls is not possible. This is due to the
fact that the implementation of `LabelSelectorAsSelector` from
`k8s.io/apimachinery` validates that a label value is no longer than 63
characters, and validates that it's alphanumeric. In order to work
around that, we'll create our own implementation of
`LabelSelectorAsSelector`.

This implementation has been copied verbatim, with the difference that
in `isValidLabelValue`, we first check if the label value is a valid
url. If it is not, we proceed with the label checks as with the
original implementation.

Apart from that, the only other differences are making as much as
possible to be package-private; the intent is to only make `Matches`
and `LabelSelectorAsSelector` available from outside the package.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* chore: drop all label value restrictions

We want to be more flexible in what we accept in post-selectors, mainly
that we want to allow other values than only server urls. For this, we
will drop all restrictions that a typical "label value" would typically
have.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

---------

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
tesla59 pushed a commit to tesla59/argo-cd that referenced this pull request Dec 16, 2023
)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants