subcmd

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIntegration

func NewIntegration(logger *slog.Logger, kube *k8s.Kube) *cobra.Command

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func (*Config) Cmd

func (c *Config) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*Config) Complete

func (c *Config) Complete(args []string) error

Complete inspect the context to determine the path of the configuration file, or uses the embedded payload, makes sure the args are adequate.

func (*Config) PersistentFlags

func (c *Config) PersistentFlags(p *pflag.FlagSet)

PersistentFlags injects the sub-command flags.

func (*Config) Run

func (c *Config) Run() error

Run runs the subcommand main action, checks which flags are enabled to interact with cluster's configuration.

func (*Config) Validate

func (c *Config) Validate() error

Validate make sure all items are in place.

type Deploy

type Deploy struct {
	// contains filtered or unexported fields
}

Deploy is the deploy subcommand.

func (*Deploy) Cmd

func (d *Deploy) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*Deploy) Complete

func (d *Deploy) Complete(args []string) error

Complete verifies the object is complete.

func (*Deploy) Run

func (d *Deploy) Run() error

Run deploys the enabled dependencies listed on the configuration.

func (*Deploy) Validate

func (d *Deploy) Validate() error

Validate asserts the requirements to start the deployment are in place.

type Installer

type Installer struct {
	// contains filtered or unexported fields
}

Installer represents the installer subcommand to list and extract the embedded resources used for the installation process.

func NewInstaller

func NewInstaller(f *flags.Flags) *Installer

NewInstaller creates a new installer subcommand.

func (*Installer) Cmd

func (i *Installer) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*Installer) Complete

func (i *Installer) Complete(_ []string) error

Complete implements Interface.

func (*Installer) Run

func (i *Installer) Run() error

Run lists or extracts the embedded resources.

func (*Installer) Validate

func (i *Installer) Validate() error

Validate validates the informed flags are correct, and the conditions are met.

type IntegrationACS

type IntegrationACS struct {
	// contains filtered or unexported fields
}

IntegrationACS is the sub-command for the "integration acs", responsible for creating and updating the ACS integration secret.

func NewIntegrationACS

func NewIntegrationACS(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationACS

NewIntegrationACS creates the sub-command for the "integration acs" responsible to manage the TSSC integrations with the ACS service.

func (*IntegrationACS) Cmd

func (a *IntegrationACS) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationACS) Complete

func (a *IntegrationACS) Complete(args []string) error

Complete loads the configuration from cluster.

func (*IntegrationACS) Run

func (a *IntegrationACS) Run() error

Run creates or updates the ACS integration secret.

func (*IntegrationACS) Validate

func (a *IntegrationACS) Validate() error

Validate checks if the required configuration is set.

type IntegrationArtifactory

type IntegrationArtifactory struct {
	// contains filtered or unexported fields
}

IntegrationArtifactory is the sub-command for the "integration artifactory", responsible for creating and updating the Artifactory integration secret.

func NewIntegrationArtifactory

func NewIntegrationArtifactory(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationArtifactory

NewIntegrationArtifactory creates the sub-command for the "integration artifactory" responsible to manage the TSSC integrations with a Artifactory image registry.

func (*IntegrationArtifactory) Cmd

Cmd exposes the cobra instance.

func (*IntegrationArtifactory) Complete

func (a *IntegrationArtifactory) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationArtifactory) Run

func (a *IntegrationArtifactory) Run() error

Run creates or updates the Artifactory integration secret.

func (*IntegrationArtifactory) Validate

func (a *IntegrationArtifactory) Validate() error

Validate checks if the required configuration is set.

type IntegrationAzure

type IntegrationAzure struct {
	// contains filtered or unexported fields
}

IntegrationAzure is the sub-command for the "integration azure", responsible for creating and updating the Azure integration secret.

func NewIntegrationAzure

func NewIntegrationAzure(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationAzure

NewIntegrationAzure creates the sub-command for the "integration azure" responsible to manage the TSSC integrations with the Azure service.

func (*IntegrationAzure) Cmd

func (a *IntegrationAzure) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationAzure) Complete

func (a *IntegrationAzure) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationAzure) Run

func (a *IntegrationAzure) Run() error

Run creates or updates the Azure integration secret.

func (*IntegrationAzure) Validate

func (a *IntegrationAzure) Validate() error

Validate checks if the required configuration is set.

type IntegrationBitBucket

type IntegrationBitBucket struct {
	// contains filtered or unexported fields
}

IntegrationBitBucket is the sub-command for the "integration bitbucket", responsible for creating and updating the BitBucket integration secret.

func NewIntegrationBitBucket

func NewIntegrationBitBucket(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationBitBucket

NewIntegrationBitBucket creates the sub-command for the "integration bitbucket" responsible to manage the TSSC integrations with the BitBucket service.

func (*IntegrationBitBucket) Cmd

Cmd exposes the cobra instance.

func (*IntegrationBitBucket) Complete

func (b *IntegrationBitBucket) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationBitBucket) Run

func (b *IntegrationBitBucket) Run() error

Run creates or updates the BitBucket integration secret.

func (*IntegrationBitBucket) Validate

func (b *IntegrationBitBucket) Validate() error

Validate checks if the required configuration is set.

type IntegrationGitHub added in v1.8.0

type IntegrationGitHub struct {
	// contains filtered or unexported fields
}

IntegrationGitHub is the sub-command for the "integration github-app", responsible for creating and updating the GitHub Apps integration secret.

func NewIntegrationGitHub added in v1.8.0

func NewIntegrationGitHub(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationGitHub

NewIntegrationGitHub creates the sub-command for the "integration github", which manages the TSSC integration with a GitHub App.

func (*IntegrationGitHub) Cmd added in v1.8.0

func (g *IntegrationGitHub) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationGitHub) Complete added in v1.8.0

func (g *IntegrationGitHub) Complete(args []string) error

Complete captures the application name, and ensures it's ready to run.

func (*IntegrationGitHub) Run added in v1.8.0

func (g *IntegrationGitHub) Run() error

Manages the GitHub App and integration secret.

func (*IntegrationGitHub) Validate added in v1.8.0

func (g *IntegrationGitHub) Validate() error

Validate checks if the required configuration is set.

type IntegrationGitLab

type IntegrationGitLab struct {
	// contains filtered or unexported fields
}

IntegrationGitLab is the sub-command for the "integration gitlab", responsible for creating and updating the GitLab integration secret.

func NewIntegrationGitLab

func NewIntegrationGitLab(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationGitLab

NewIntegrationGitLab creates the sub-command for the "integration gitlab" responsible to manage the TSSC integrations with the GitLab service.

func (*IntegrationGitLab) Cmd

func (g *IntegrationGitLab) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationGitLab) Complete

func (g *IntegrationGitLab) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationGitLab) Run

func (g *IntegrationGitLab) Run() error

Run creates or updates the GitLab integration secret.

func (*IntegrationGitLab) Validate

func (g *IntegrationGitLab) Validate() error

Validate checks if the required configuration is set.

type IntegrationJenkins

type IntegrationJenkins struct {
	// contains filtered or unexported fields
}

IntegrationJenkins is the sub-command for the "integration jenkins", responsible for creating and updating the Jenkins integration secret.

func NewIntegrationJenkins

func NewIntegrationJenkins(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationJenkins

NewIntegrationJenkins creates the sub-command for the "integration jenkins" responsible to manage the TSSC integrations with the Jenkins service.

func (*IntegrationJenkins) Cmd

func (j *IntegrationJenkins) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationJenkins) Complete

func (j *IntegrationJenkins) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationJenkins) Run

func (j *IntegrationJenkins) Run() error

Run creates or updates the Jenkins integration secret.

func (*IntegrationJenkins) Validate

func (j *IntegrationJenkins) Validate() error

Validate checks if the required configuration is set.

type IntegrationNexus

type IntegrationNexus struct {
	// contains filtered or unexported fields
}

IntegrationNexus is the sub-command for the "integration nexus", responsible for creating and updating the Nexus integration secret.

func NewIntegrationNexus

func NewIntegrationNexus(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationNexus

NewIntegrationNexus creates the sub-command for the "integration nexus" responsible to manage the TSSC integrations with a Nexus image registry.

func (*IntegrationNexus) Cmd

func (n *IntegrationNexus) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationNexus) Complete

func (n *IntegrationNexus) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationNexus) Run

func (n *IntegrationNexus) Run() error

Run creates or updates the Nexus integration secret.

func (*IntegrationNexus) Validate

func (n *IntegrationNexus) Validate() error

Validate checks if the required configuration is set.

type IntegrationQuay

type IntegrationQuay struct {
	// contains filtered or unexported fields
}

IntegrationQuay is the sub-command for the "integration quay", responsible for creating and updating the Quay integration secret.

func NewIntegrationQuay

func NewIntegrationQuay(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationQuay

NewIntegrationQuay creates the sub-command for the "integration quay" responsible to manage the TSSC integrations with a Quay image registry.

func (*IntegrationQuay) Cmd

func (q *IntegrationQuay) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationQuay) Complete

func (q *IntegrationQuay) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationQuay) Run

func (q *IntegrationQuay) Run() error

Run creates or updates the Quay integration secret.

func (*IntegrationQuay) Validate

func (q *IntegrationQuay) Validate() error

Validate checks if the required configuration is set.

type IntegrationTrustedArtifactSigner added in v1.8.0

type IntegrationTrustedArtifactSigner struct {
	// contains filtered or unexported fields
}

IntegrationTrustedArtifactSigner is the sub-command for the "integration trusted-artifact-signer", responsible for creating and updating the TrustedArtifactSigner integration secret.

func NewIntegrationTrustedArtifactSigner added in v1.8.0

func NewIntegrationTrustedArtifactSigner(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationTrustedArtifactSigner

NewIntegrationTrustedArtifactSigner creates the sub-command for the "integration trusted-artifact-signer" responsible to manage the TSSC integrations with the Trusted Artifact Signer services.

func (*IntegrationTrustedArtifactSigner) Cmd added in v1.8.0

Cmd exposes the cobra instance.

func (*IntegrationTrustedArtifactSigner) Complete added in v1.8.0

func (t *IntegrationTrustedArtifactSigner) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationTrustedArtifactSigner) Run added in v1.8.0

Run creates or updates the TrustedArtifactSigner integration secret.

func (*IntegrationTrustedArtifactSigner) Validate added in v1.8.0

Validate checks if the required configuration is set.

type IntegrationTrustification

type IntegrationTrustification struct {
	// contains filtered or unexported fields
}

IntegrationTrustification is the sub-command for the "integration trustification", responsible for creating and updating the Trustification integration secret.

func NewIntegrationTrustification

func NewIntegrationTrustification(
	logger *slog.Logger,
	kube *k8s.Kube,
	i *integration.Integration,
) *IntegrationTrustification

NewIntegrationTrustification creates the sub-command for the "integration trustification" responsible to manage the TSSC integrations with the Trustification service.

func (*IntegrationTrustification) Cmd

Cmd exposes the cobra instance.

func (*IntegrationTrustification) Complete

func (t *IntegrationTrustification) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationTrustification) Run

Run creates or updates the Trustification integration secret.

func (*IntegrationTrustification) Validate

func (t *IntegrationTrustification) Validate() error

Validate checks if the required configuration is set.

type Interface

type Interface interface {
	Cmd() *cobra.Command

	// Complete loads the external dependencies for the subcommand, such as
	// configuration files or checking the Kubernetes API client connectivity.
	Complete(_ []string) error

	// Validate checks the subcommand configuration, asserts the required fields
	// are valid before running the primary action.
	Validate() error

	// Run executes the subcommand "business logic".
	Run() error
}

Interface defines the interface for a subcommand, as well the sequence of steps each subcommand is obliged to follow.

func NewConfig

func NewConfig(
	logger *slog.Logger,
	f *flags.Flags,
	cfs *chartfs.ChartFS,
	kube *k8s.Kube,
) Interface

NewConfig instantiates the "config" subcommand.

func NewDeploy

func NewDeploy(
	logger *slog.Logger,
	f *flags.Flags,
	cfs *chartfs.ChartFS,
	kube *k8s.Kube,
) Interface

NewDeploy instantiates the deploy subcommand.

type MCPServer

type MCPServer struct {
	// contains filtered or unexported fields
}

MCPServer is a subcommand for starting the MCP server.

func NewMCPServer

func NewMCPServer(
	f *flags.Flags,
	cfs *chartfs.ChartFS,
	kube *k8s.Kube,
) *MCPServer

NewMCPServer creates a new MCPServer instance.

func (*MCPServer) Cmd

func (m *MCPServer) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*MCPServer) Complete

func (m *MCPServer) Complete(_ []string) error

Complete implements Interface.

func (*MCPServer) PersistentFlags

func (m *MCPServer) PersistentFlags(cmd *cobra.Command)

PersistentFlags adds flags to the command.

func (*MCPServer) Run

func (m *MCPServer) Run() error

Run starts the MCP server.

func (*MCPServer) Validate

func (m *MCPServer) Validate() error

Validate implements Interface.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner controls the "subcommands" workflow from end-to-end, each step of it is executed in the predefined sequence: Complete, Validate and Run.

func NewRunner

func NewRunner(subCmd Interface) *Runner

NewRunner completes the informed subcommand with the lifecycle methods.

func (*Runner) Cmd

func (r *Runner) Cmd() *cobra.Command

Cmd exposes the subcommand's cobra command instance.

type Template

type Template struct {
	// contains filtered or unexported fields
}

Template represents the "template" subcommand.

func NewTemplate

func NewTemplate(
	logger *slog.Logger,
	f *flags.Flags,
	cfs *chartfs.ChartFS,
	kube *k8s.Kube,
) *Template

NewTemplate creates the "template" subcommand with flags.

func (*Template) Cmd

func (t *Template) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*Template) Complete

func (t *Template) Complete(args []string) error

Complete parse the informed args as charts, when valid.

func (*Template) Run

func (t *Template) Run() error

Run Renders the templates.

func (*Template) Validate

func (t *Template) Validate() error

Validate checks if the chart path is a directory.

type Topology

type Topology struct {
	// contains filtered or unexported fields
}

Topology represents the topology subcommand, it reports the installer dependency topology based on the cluster configuration and Helm charts.

func NewTopology

func NewTopology(
	logger *slog.Logger,
	cfs *chartfs.ChartFS,
	kube *k8s.Kube,
) *Topology

NewTopology instantiates a new Topology subcommand.

func (*Topology) Cmd

func (t *Topology) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*Topology) Complete

func (t *Topology) Complete(_ []string) error

Complete instantiates the cluster configuration and charts.

func (*Topology) Run

func (t *Topology) Run() error

Run resolves the dependency graph.

func (*Topology) Validate

func (t *Topology) Validate() error

Validate validates the command.

Jump to

Keyboard shortcuts

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