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

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

Merged
merged 2 commits into from
Oct 13, 2022

Conversation

a7i
Copy link
Contributor

@a7i a7i commented Oct 9, 2022

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

  • provide string option --as for username impersonation
  • provide string option --as-uid for uid impersonation
  • provide stringArray option --as-group for group impersonation

Reference

Fixes #

Release Note

Provide cli options to enable Kubernetes user, uid, and group impersonation via `--as`, `--as-group` and `--as-uid` flags
  • 🎁 New feature: provide cli options to enable Kubernetes user, uid, and group impersonation via --as and --as-group flags

@knative-prow
Copy link

knative-prow bot commented Oct 9, 2022

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

@knative-prow knative-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 9, 2022
@knative-prow
Copy link

knative-prow bot commented Oct 9, 2022

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

@knative-prow knative-prow bot left a comment

Choose a reason for hiding this comment

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

@a7i: 0 warnings.

In response to this:

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-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

  • provide string option --as for username impersonation
  • provide stringArray option --as-group for group impersonation

Reference

Fixes #

Release Note

provide cli options to enable Kubernetes user and group impersonation via `--as` and `--as-group` flags
  • 🎁 New feature: provide cli options to enable Kubernetes user and group impersonation via --as and --as-group flags

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 9, 2022
@dsimansk
Copy link
Contributor

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 11, 2022
@dsimansk
Copy link
Contributor

@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

pkg/kn/root/root.go Outdated Show resolved Hide resolved
@knative-prow knative-prow bot requested review from rhuss and vyasgun October 11, 2022 11:18
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
@a7i a7i changed the title cli options to enable user and group impersonation cli options to enable user, uid, and group impersonation Oct 12, 2022
@dsimansk dsimansk added the kind/feature New feature or request label Oct 12, 2022
@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

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

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
@@            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 Coverage Δ
pkg/kn/commands/types.go 87.83% <100.00%> (+0.78%) ⬆️
pkg/kn/root/root.go 89.91% <100.00%> (+0.26%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@dsimansk
Copy link
Contributor

Thanks!

/approve
/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Oct 13, 2022
@knative-prow
Copy link

knative-prow bot commented Oct 13, 2022

[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:

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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 13, 2022
@knative-prow knative-prow bot merged commit 0382c17 into knative:main Oct 13, 2022
@a7i a7i deleted the user-impersonation branch October 13, 2022 15:24
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. kind/feature New feature or request lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants