openshift

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterNameFromURL added in v0.32.0

func ClusterNameFromURL(rawURL string) (string, error)

ClusterNameFromURL extracts the OpenShift cluster name from a console, API, or OAuth URL.

Types

type ClusterConfig added in v0.32.0

type ClusterConfig struct {
	Name               string
	APIURL             string
	TokenExchangeURL   string
	AudienceID         string
	LoginApplicationID string
	AuthURL            string
}

ClusterConfig describes the DNS-published configuration for an OpenShift cluster.

func LookupClusterConfig added in v0.32.0

func LookupClusterConfig(clusterName string) (*ClusterConfig, error)

LookupClusterConfig fetches the OpenShift cluster configuration from DNS TXT records.

func (*ClusterConfig) Validate added in v0.32.0

func (c *ClusterConfig) Validate() error

Validate verifies that the required cluster settings are present and plausible.

type LogFunc

type LogFunc func(format string, args ...any)

LogFunc receives informational messages generated during the flow.

type LoginCommandResult

type LoginCommandResult struct {
	Command string
	Token   string
	Server  string
}

LoginCommandResult contains the extracted `oc login` command details.

func FetchLoginCommand

func FetchLoginCommand(
	oauthBaseURL string,
	clusterURL string,
	authHost string,
	cookies []*http.Cookie,
	verifyCerts bool,
	logf LogFunc,
) (*LoginCommandResult, error)

FetchLoginCommand fetches the OpenShift token page and extracts the login command.

func FetchLoginCommandWithDeviceExchange added in v0.32.0

func FetchLoginCommandWithDeviceExchange(
	clusterURL string,
	verifyCerts bool,
	logf LogFunc,
	promptf func(auth.DeviceAuthorizationPrompt),
) (*LoginCommandResult, error)

FetchLoginCommandWithDeviceExchange authenticates to OpenShift using the CERN OIDC device flow.

Jump to

Keyboard shortcuts

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