cmd

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivityCommand

func NewActivityCommand(opts ActivityCommandOptions) *cobra.Command

NewActivityCommand creates the root command for the activity CLI with the provided options. This allows external clients to provide their own factory, IO streams, or config flags. Pass an empty ActivityCommandOptions{} to use defaults.

func NewAuditCommand added in v0.3.0

func NewAuditCommand(f util.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewAuditCommand creates the audit command (replaces old query command)

func NewEventsCommand added in v0.3.0

func NewEventsCommand(f util.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewEventsCommand creates the events command

func NewFeedCommand added in v0.3.0

func NewFeedCommand(f util.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewFeedCommand creates the feed command

func NewHistoryCommand added in v0.2.0

func NewHistoryCommand(f util.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewHistoryCommand creates the history command

func NewQueryCommand

func NewQueryCommand(f util.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command

NewQueryCommand creates the query command

Types

type ActivityCommandOptions

type ActivityCommandOptions struct {
	// Factory is the kubectl factory to use for building clients.
	// If nil, a default factory will be created.
	Factory util.Factory

	// IOStreams for command input/output.
	// If not set, defaults to os.Stdin/Stdout/Stderr.
	IOStreams genericclioptions.IOStreams

	// ConfigFlags for kubeconfig management.
	// If nil and Factory is nil, default ConfigFlags will be created.
	// This field is ignored if Factory is provided.
	ConfigFlags *genericclioptions.ConfigFlags

	// EnableAdminCommands controls whether administrative commands are registered.
	// When true, the following subcommands are added:
	//   - policy  (ActivityPolicy management: preview)
	//   - reindex (ReindexJob management: create, list, status, delete)
	//
	// Set this to true in CLIs that target cluster administrators. Consumer CLIs
	// that only expose end-user query capabilities should leave this false.
	EnableAdminCommands bool
}

ActivityCommandOptions contains options for creating the activity command.

type AuditOptions added in v0.3.0

type AuditOptions struct {
	// Filter options
	Filter    string
	Namespace string
	Resource  string
	Verb      string
	User      string

	// Common flags
	TimeRange  common.TimeRangeFlags
	Pagination common.PaginationFlags
	Output     common.OutputFlags
	Suggest    common.SuggestFlags

	PrintFlags *genericclioptions.PrintFlags
	genericclioptions.IOStreams
	Factory util.Factory
}

AuditOptions contains the options for querying audit logs

func NewAuditOptions added in v0.3.0

func NewAuditOptions(f util.Factory, ioStreams genericclioptions.IOStreams) *AuditOptions

NewAuditOptions creates a new AuditOptions with default values

func (*AuditOptions) Complete added in v0.3.0

func (o *AuditOptions) Complete(cmd *cobra.Command) error

Complete fills in missing options

func (*AuditOptions) Run added in v0.3.0

func (o *AuditOptions) Run(ctx context.Context) error

Run executes the audit query

func (*AuditOptions) Validate added in v0.3.0

func (o *AuditOptions) Validate() error

Validate checks that required options are set correctly

type EventsOptions added in v0.3.0

type EventsOptions struct {
	// Filter options
	Namespace     string
	FieldSelector string
	Type          string
	Reason        string
	RegardingKind string
	RegardingName string

	// Common flags
	TimeRange  common.TimeRangeFlags
	Pagination common.PaginationFlags
	Output     common.OutputFlags
	Suggest    common.SuggestFlags

	PrintFlags *genericclioptions.PrintFlags
	genericclioptions.IOStreams
	Factory util.Factory
}

EventsOptions contains the options for querying Kubernetes events

func NewEventsOptions added in v0.3.0

func NewEventsOptions(f util.Factory, ioStreams genericclioptions.IOStreams) *EventsOptions

NewEventsOptions creates a new EventsOptions with default values

func (*EventsOptions) Complete added in v0.3.0

func (o *EventsOptions) Complete(cmd *cobra.Command) error

Complete fills in missing options

func (*EventsOptions) Run added in v0.3.0

func (o *EventsOptions) Run(ctx context.Context) error

Run executes the events query

func (*EventsOptions) Validate added in v0.3.0

func (o *EventsOptions) Validate() error

Validate checks that required options are set correctly

type FeedOptions added in v0.3.0

type FeedOptions struct {
	// Filter options
	Filter       string
	Namespace    string
	Actor        string
	Kind         string
	APIGroup     string
	ChangeSource string
	Search       string
	ResourceUID  string

	// Watch mode
	Watch bool

	// Common flags
	TimeRange  common.TimeRangeFlags
	Pagination common.PaginationFlags
	Output     common.OutputFlags
	Suggest    common.SuggestFlags

	PrintFlags *genericclioptions.PrintFlags
	genericclioptions.IOStreams
	Factory util.Factory
}

FeedOptions contains the options for querying activities

func NewFeedOptions added in v0.3.0

func NewFeedOptions(f util.Factory, ioStreams genericclioptions.IOStreams) *FeedOptions

NewFeedOptions creates a new FeedOptions with default values

func (*FeedOptions) Complete added in v0.3.0

func (o *FeedOptions) Complete(cmd *cobra.Command) error

Complete fills in missing options

func (*FeedOptions) Run added in v0.3.0

func (o *FeedOptions) Run(ctx context.Context) error

Run executes the feed query

func (*FeedOptions) Validate added in v0.3.0

func (o *FeedOptions) Validate() error

Validate checks that required options are set correctly

type HistoryOptions added in v0.2.0

type HistoryOptions struct {
	Namespace     string
	Resource      string
	Name          string
	ShowDiff      bool
	ContinueAfter string
	AllPages      bool

	// Common flags
	TimeRange  common.TimeRangeFlags
	Pagination common.PaginationFlags

	PrintFlags *genericclioptions.PrintFlags
	genericclioptions.IOStreams
	Factory util.Factory
}

HistoryOptions contains the options for viewing resource history

func NewHistoryOptions added in v0.2.0

func NewHistoryOptions(f util.Factory, ioStreams genericclioptions.IOStreams) *HistoryOptions

NewHistoryOptions creates a new HistoryOptions with default values

func (*HistoryOptions) Complete added in v0.2.0

func (o *HistoryOptions) Complete(cmd *cobra.Command, args []string) error

Complete fills in missing options

func (*HistoryOptions) Run added in v0.2.0

func (o *HistoryOptions) Run(ctx context.Context) error

Run executes the history command

func (*HistoryOptions) Validate added in v0.2.0

func (o *HistoryOptions) Validate() error

Validate checks that required options are set correctly

type QueryOptions

type QueryOptions struct {
	StartTime     string
	EndTime       string
	Filter        string
	Limit         int32
	ContinueAfter string
	AllPages      bool

	PrintFlags *genericclioptions.PrintFlags
	genericclioptions.IOStreams
	Factory util.Factory
}

QueryOptions contains the options for querying audit logs

func NewQueryOptions

func NewQueryOptions(f util.Factory, ioStreams genericclioptions.IOStreams) *QueryOptions

NewQueryOptions creates a new QueryOptions with default values

func (*QueryOptions) Complete

func (o *QueryOptions) Complete(cmd *cobra.Command) error

Complete fills in missing options

func (*QueryOptions) Run

func (o *QueryOptions) Run(ctx context.Context) error

Run executes the query

func (*QueryOptions) Validate

func (o *QueryOptions) Validate() error

Validate checks that required options are set correctly

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL