versioncmd

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package versioncmd contains version cmd

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchCrossplaneVersion added in v0.7.1

func FetchCrossplaneVersion(ctx context.Context, cfg *rest.Config) (string, error)

FetchCrossplaneVersion returns the Crossplane server version using the provided REST config. It mirrors the upstream github.com/crossplane/crossplane/v2/cmd/crank/version.FetchCrossplaneVersion but accepts a pre-built *rest.Config instead of calling ctrl.GetConfig, so callers can honor the user's kubeconfig context (e.g. --context) even when running inside a Kubernetes pod.

TODO: Remove this fork once an upstream variant that accepts *rest.Config is available. Tracked in https://github.com/crossplane-contrib/crossplane-diff/issues/285.

Types

type Cmd

type Cmd struct {
	Client  bool            `` /* 127-byte string literal not displayed */
	Context kubecfg.Context `help:"Kubernetes context to use (defaults to current context)." name:"context"`
	// contains filtered or unexported fields
}

Cmd represents the version command.

func (*Cmd) BeforeApply added in v0.7.1

func (c *Cmd) BeforeApply(ctx *kong.Context) error

BeforeApply binds the Cmd pointer as the kubecfg.Provider so that providers resolved later (in Run) see the parsed --context value.

func (*Cmd) GetKubeContext added in v0.7.1

func (c *Cmd) GetKubeContext() kubecfg.Context

GetKubeContext implements kubecfg.Provider so the shared REST config provider (bound in main via kong.BindToProvider) can resolve a *rest.Config that honors the user's kubeconfig context.

func (*Cmd) Run

func (c *Cmd) Run(k *kong.Context) error

Run runs the version command.

Jump to

Keyboard shortcuts

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