KubectlAuthCanISettings Class

Summary

Check whether an action is allowed. VERB is a logical Kubernetes API verb like 'get', 'list', 'watch', 'delete', etc. TYPE is a Kubernetes resource. Shortcuts and groups will be resolved. NONRESOURCEURL is a partial URL that starts with "/". NAME is the name of a particular Kubernetes resource. This command pairs nicely with impersonation. See --as global flag.
Assembly
Cake.Kubectl.dll
Namespace
Cake.Kubectl
Base Types
graph BT Type-->Base0["AutoToolSettings"] click Base0 "/api/Cake.Kubectl/AutoToolSettings" Base0-->Base1["ToolSettings"] Type["KubectlAuthCanISettings"] class Type type-node

Syntax

public sealed class KubectlAuthCanISettings : AutoToolSettings

Examples

# Check to see if I can create pods in any namespace kubectl auth can-i create pods --all-namespaces # Check to see if I can list deployments in my current namespace kubectl auth can-i list deployments.apps # Check to see if service account "foo" of namespace "dev" can list pods # in the namespace "prod". # You must be allowed to use impersonation for the global option "--as". kubectl auth can-i list pods --as=system:serviceaccount:dev:foo -n prod # Check to see if I can do everything in my current namespace ("*" means all) kubectl auth can-i '*' '*' # Check to see if I can get the job named "bar" in namespace "foo" kubectl auth can-i list jobs.batch/bar -n foo # Check to see if I can read pod logs kubectl auth can-i get pods --subresource=log # Check to see if I can access the URL /logs/ kubectl auth can-i get /logs/ # List all allowed actions in namespace "foo" kubectl auth can-i --list --namespace=foo

Attributes

Type Description
NullableContextAttribute
NullableAttribute
CompilerGeneratedAttribute

Constructors

Properties

Name Value Summary
AllNamespaces Nullable<bool>
-A, --all-namespaces If true, check the specified action in all namespaces.
List Nullable<bool>
--list If true, prints all allowed actions.
NoHeaders Nullable<bool>
--no-headers If true, prints allowed actions without headers
Quiet Nullable<bool>
-q, --quiet If true, suppress output and just return the exit code.
Subresource string
--subresource SubResource such as pod/log or deployment/scale

Extension Methods

Name Value Summary
Dump<KubectlAuthCanISettings>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<KubectlAuthCanISettings>(KubectlAuthCanISettings[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<KubectlAuthCanISettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
NotNull<KubectlAuthCanISettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
ThrowIfNull<KubectlAuthCanISettings>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<KubectlAuthCanISettings>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Returns the string value or a Not set> markup suitable for Spectre.Console.
Requires the Cake.Issues addin