knative / client

Knative developer experience, docs, reference Knative CLI implementation
Apache License 2.0
354 stars 262 forks source link

cli options to enable user, uid, and group impersonation #1745

Closed a7i closed 2 years ago

a7i commented 2 years ago

Description

CLI options to enable kubernetes user and group impersonation

❯ ./kn options
The following options can be passed to any command:

      --as string              username to impersonate for the operation
      --as-uid string          uid to impersonate for the operation
      --as-group stringArray   group to impersonate for the operation, this flag can be repeated to specify multiple groups
      --cluster string         name of the kubeconfig cluster to use
      --config string          kn configuration file (default: ~/.config/kn/config.yaml)
      --context string         name of the kubeconfig context to use
      --kubeconfig string      kubectl configuration file (default: ~/.kube/config)
      --log-http               log http traffic

Changes

Reference

Fixes #

Release Note

Provide cli options to enable Kubernetes user, uid, and group impersonation via `--as`, `--as-group` and `--as-uid` flags
knative-prow[bot] commented 2 years ago

Welcome @a7i! It looks like this is your first PR to knative/client 🎉

knative-prow[bot] commented 2 years ago

Hi @a7i. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
dsimansk commented 2 years ago

/ok-to-test

dsimansk commented 2 years ago

@a7i thanks for the PR! Looks good at a first glance!

Can you pls take a look at failing unit test? https://github.com/knative/client/actions/runs/3212622694/jobs/5277761586#step:7:20

codecov[bot] commented 2 years ago

Codecov Report

Base: 79.87% // Head: 79.89% // Increases project coverage by +0.01% :tada:

Coverage data is based on head (4dcf7c7) compared to base (6bbbd50). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1745 +/- ## ========================================== + Coverage 79.87% 79.89% +0.01% ========================================== Files 174 174 Lines 13577 13589 +12 ========================================== + Hits 10845 10857 +12 Misses 1990 1990 Partials 742 742 ``` | [Impacted Files](https://codecov.io/gh/knative/client/pull/1745?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative) | Coverage Δ | | |---|---|---| | [pkg/kn/commands/types.go](https://codecov.io/gh/knative/client/pull/1745/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative#diff-cGtnL2tuL2NvbW1hbmRzL3R5cGVzLmdv) | `87.83% <100.00%> (+0.78%)` | :arrow_up: | | [pkg/kn/root/root.go](https://codecov.io/gh/knative/client/pull/1745/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative#diff-cGtnL2tuL3Jvb3Qvcm9vdC5nbw==) | `89.91% <100.00%> (+0.26%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

dsimansk commented 2 years ago

Thanks!

/approve /lgtm

knative-prow[bot] commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a7i, dsimansk

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: - ~~[OWNERS](https://github.com/knative/client/blob/main/OWNERS)~~ [dsimansk] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment