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 labels to diff command #90857

Merged
merged 1 commit into from
Jun 30, 2020
Merged

Conversation

sethpollack
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
Would like to run be able to filter out things like secrets from kubectl diff

kubectl diff -f release.yaml -l app.kubernetes.io/component!=secrets

Does this PR introduce a user-facing change?:

add selectors to kubectl diff

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 7, 2020
@sethpollack
Copy link
Contributor Author

/sig cli

@k8s-ci-robot k8s-ci-robot added sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 7, 2020
@sethpollack
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-ipv6

@sethpollack
Copy link
Contributor Author

/test pull-kubernetes-kubemark-e2e-gce-big

@sethpollack
Copy link
Contributor Author

/assign @pwittrock

@apelisse
Copy link
Member

We've discussed about this problem in #87840. I think this idea is fresh and I sort of like it.

If we look at labels and annotations, my read is that it should be an annotation (please feel free to disagree). We could also possibly NOT make it a selector and just enforce the name directly: "hide-from-diff" (we should do much better than that and look at typical formats).

Thanks, thoughts?

@sethpollack
Copy link
Contributor Author

sethpollack commented Jun 29, 2020

We already have the concept of selectors in other kubectl commands like apply. This just ports over the selector flag from apply. This gives you the flexibility to exclude it from the diff or not, rather that enforcing it based on a convention.

@apelisse
Copy link
Member

apelisse commented Jun 29, 2020

OK I think there are two things here:

  1. People may only want to see resources based on labels, the same way you can do get, apply etc by label. That's a valid use-case.
  2. People want to hide secrets from diff. I think that deserves special logic, and people shouldn't use labels for that.

But we shouldn't block 1 because of 2.

/lgtm
/approve

Now, I would understand if you use that mechanism to hide secrets in the mean time, but I think we should have a better mechanism.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 29, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse, sethpollack

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 29, 2020
@apelisse
Copy link
Member

/retest

@sethpollack
Copy link
Contributor Author

Makes sense. I would still make 2 optional.

@apelisse
Copy link
Member

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 696e60d into kubernetes:master Jun 30, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 30, 2020
@sethpollack
Copy link
Contributor Author

Thanks @apelisse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants