subcmd

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 26 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,
) *IntegrationACS

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

func (*IntegrationACS) Cmd

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

Cmd exposes the cobra instance.

func (*IntegrationACS) Complete

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

Complete loads the configuration from cluster.

func (*IntegrationACS) Run

func (d *IntegrationACS) Run() error

Run creates or updates the ACS integration secret.

func (*IntegrationACS) Validate

func (d *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,
) *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 (d *IntegrationArtifactory) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationArtifactory) Run

func (d *IntegrationArtifactory) Run() error

Run creates or updates the Artifactory integration secret.

func (*IntegrationArtifactory) Validate

func (d *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,
) *IntegrationAzure

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

func (*IntegrationAzure) Cmd

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

Cmd exposes the cobra instance.

func (*IntegrationAzure) Complete

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

Complete is a no-op in this case.

func (*IntegrationAzure) Run

func (d *IntegrationAzure) Run() error

Run creates or updates the Azure integration secret.

func (*IntegrationAzure) Validate

func (d *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,
) *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 (d *IntegrationBitBucket) Complete(args []string) error

Complete is a no-op in this case.

func (*IntegrationBitBucket) Run

func (d *IntegrationBitBucket) Run() error

Run creates or updates the BitBucket integration secret.

func (*IntegrationBitBucket) Validate

func (d *IntegrationBitBucket) Validate() error

Validate checks if the required configuration is set.

type IntegrationGitHubApp

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

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

func NewIntegrationGitHubApp

func NewIntegrationGitHubApp(
	logger *slog.Logger,
	kube *k8s.Kube,
) *IntegrationGitHubApp

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

func (*IntegrationGitHubApp) Cmd

Cmd exposes the cobra instance.

func (*IntegrationGitHubApp) Complete

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

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

func (*IntegrationGitHubApp) Run

func (d *IntegrationGitHubApp) Run() error

Manages the GitHub App and integration secret.

func (*IntegrationGitHubApp) Validate

func (d *IntegrationGitHubApp) 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,
) *IntegrationGitLab

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

func (*IntegrationGitLab) Cmd

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

Cmd exposes the cobra instance.

func (*IntegrationGitLab) Complete

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

Complete is a no-op in this case.

func (*IntegrationGitLab) Run

func (d *IntegrationGitLab) Run() error

Run creates or updates the GitLab integration secret.

func (*IntegrationGitLab) Validate

func (d *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,
) *IntegrationJenkins

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

func (*IntegrationJenkins) Cmd

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

Cmd exposes the cobra instance.

func (*IntegrationJenkins) Complete

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

Complete is a no-op in this case.

func (*IntegrationJenkins) Run

func (d *IntegrationJenkins) Run() error

Run creates or updates the Jenkins integration secret.

func (*IntegrationJenkins) Validate

func (d *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,
) *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 (d *IntegrationNexus) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationNexus) Complete

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

Complete is a no-op in this case.

func (*IntegrationNexus) Run

func (d *IntegrationNexus) Run() error

Run creates or updates the Nexus integration secret.

func (*IntegrationNexus) Validate

func (d *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) *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 (d *IntegrationQuay) Cmd() *cobra.Command

Cmd exposes the cobra instance.

func (*IntegrationQuay) Complete

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

Complete is a no-op in this case.

func (*IntegrationQuay) Run

func (d *IntegrationQuay) Run() error

Run creates or updates the Quay integration secret.

func (*IntegrationQuay) Validate

func (d *IntegrationQuay) Validate() error

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,
) *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 (d *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 (d *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, 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