subcmd

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ACSModule = api.IntegrationModule{
		Name: string(integrations.ACS),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewACS()
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationACS(appCtx, runCtx, i)
		},
	}

	ArtifactoryModule = api.IntegrationModule{
		Name: string(integrations.Artifactory),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewContainerRegistry("")
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationArtifactory(appCtx, runCtx, i)
		},
	}

	AzureModule = api.IntegrationModule{
		Name: string(integrations.Azure),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewAzure()
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationAzure(appCtx, runCtx, i)
		},
	}

	BitBucketModule = api.IntegrationModule{
		Name: string(integrations.BitBucket),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewBitBucket()
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationBitBucket(appCtx, runCtx, i)
		},
	}

	GitHubModule = api.IntegrationModule{
		Name: string(integrations.GitHub),
		Init: func(l *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewGitHub(l)
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationGitHub(appCtx, runCtx, i)
		},
	}

	GitLabModule = api.IntegrationModule{
		Name: string(integrations.GitLab),
		Init: func(l *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewGitLab(l)
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationGitLab(appCtx, runCtx, i)
		},
	}

	JenkinsModule = api.IntegrationModule{
		Name: string(integrations.Jenkins),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewJenkins()
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationJenkins(appCtx, runCtx, i)
		},
	}

	NexusModule = api.IntegrationModule{
		Name: string(integrations.Nexus),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewContainerRegistry("")
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationNexus(appCtx, runCtx, i)
		},
	}

	QuayModule = api.IntegrationModule{
		Name: string(integrations.Quay),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewContainerRegistry(integration.QuayURL)
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationQuay(appCtx, runCtx, i)
		},
	}

	TrustedArtifactSignerModule = api.IntegrationModule{
		Name: string(integrations.TrustedArtifactSigner),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewTrustedArtifactSigner()
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationTrustedArtifactSigner(appCtx, runCtx, i)
		},
	}

	TrustificationAuthModule = api.IntegrationModule{
		Name: string(integrations.TrustificationAuth),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewTrustificationAuth()
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationTrustificationAuth(appCtx, runCtx, i)
		},
	}

	TrustificationModule = api.IntegrationModule{
		Name: string(integrations.Trustification),
		Init: func(_ *slog.Logger, _ k8s.Interface) integration.Interface {
			return integration.NewTrustification()
		},
		Command: func(appCtx *api.AppContext, runCtx *runcontext.RunContext, i *integration.Integration) api.SubCommand {
			return NewIntegrationTrustification(appCtx, runCtx, i)
		},
	}
)

Functions

func NewConfig

func NewConfig(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	f *flags.Flags,
) api.SubCommand

NewConfig instantiates the "config" subcommand.

func NewDeploy

func NewDeploy(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	f *flags.Flags,
	manager *integrations.Manager,
	installerTarball []byte,
) api.SubCommand

NewDeploy instantiates the deploy subcommand.

func NewIntegration

func NewIntegration(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	manager *integrations.Manager,
	f *flags.Flags,
) *cobra.Command

func StandardMCPToolsBuilder

func StandardMCPToolsBuilder() mcptools.MCPToolsBuilder

StandardMCPToolsBuilder returns a builder function that creates all standard MCP tools for the installer api. These tools provide the core MCP functionality.

func StandardModules

func StandardModules() []api.IntegrationModule

StandardModules returns the list of standard integration modules.

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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	f *flags.Flags,
	installerTarball []byte,
) *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 api.SubCommand.

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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationACS

NewIntegrationACS creates the sub-command for the "integration acs" responsible to manage the 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(_ []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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationArtifactory

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

func (*IntegrationArtifactory) Cmd

Cmd exposes the cobra instance.

func (*IntegrationArtifactory) Complete

func (a *IntegrationArtifactory) Complete(_ []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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationAzure

NewIntegrationAzure creates the sub-command for the "integration azure" responsible to manage the 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(_ []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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationBitBucket

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

func (*IntegrationBitBucket) Cmd

Cmd exposes the cobra instance.

func (*IntegrationBitBucket) Complete

func (b *IntegrationBitBucket) Complete(_ []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

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

func NewIntegrationGitHub(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationGitHub

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

func (*IntegrationGitHub) Cmd

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

Cmd exposes the cobra instance.

func (*IntegrationGitHub) Complete

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

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

func (*IntegrationGitHub) Run

func (g *IntegrationGitHub) Run() error

Manages the GitHub App and integration secret.

func (*IntegrationGitHub) Validate

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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationGitLab

NewIntegrationGitLab creates the sub-command for the "integration gitlab" responsible to manage the 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(_ []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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationJenkins

NewIntegrationJenkins creates the sub-command for the "integration jenkins" responsible to manage the 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(_ []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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationNexus

NewIntegrationNexus creates the sub-command for the "integration nexus" responsible to manage the 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(_ []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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationQuay

NewIntegrationQuay creates the sub-command for the "integration quay" responsible to manage the 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(_ []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

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

func NewIntegrationTrustedArtifactSigner(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationTrustedArtifactSigner

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

func (*IntegrationTrustedArtifactSigner) Cmd

Cmd exposes the cobra instance.

func (*IntegrationTrustedArtifactSigner) Complete

Complete is a no-op in this case.

func (*IntegrationTrustedArtifactSigner) Run

Run creates or updates the TrustedArtifactSigner integration secret.

func (*IntegrationTrustedArtifactSigner) Validate

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. It includes the coordinates to connect the cluster with remote Trustification services.

func NewIntegrationTrustification

func NewIntegrationTrustification(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationTrustification

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

func (*IntegrationTrustification) Cmd

Cmd exposes the cobra instance.

func (*IntegrationTrustification) Complete

func (t *IntegrationTrustification) Complete(_ []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 IntegrationTrustificationAuth

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

IntegrationTrustificationAuth is the sub-command for the "integration trustificationauth", responsible for creating and updating the trustificationauth integration secret.

func NewIntegrationTrustificationAuth

func NewIntegrationTrustificationAuth(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	i *integration.Integration,
) *IntegrationTrustificationAuth

NewIntegrationTrustificationAuth creates the sub-command for the "integration trustificationauth" responsible to manage the authentication integrations with the Trustification service.

func (*IntegrationTrustificationAuth) Cmd

Cmd exposes the cobra instance.

func (*IntegrationTrustificationAuth) Complete

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

Complete is a no-op in this case.

func (*IntegrationTrustificationAuth) Run

Run creates or updates the trustificationauth integration secret.

func (*IntegrationTrustificationAuth) Validate

func (t *IntegrationTrustificationAuth) Validate() error

Validate checks if the required configuration is set.

type MCPServer

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

MCPServer is a subcommand for starting the MCP server.

func NewMCPServer

func NewMCPServer(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	f *flags.Flags,
	manager *integrations.Manager,
	builder mcptools.MCPToolsBuilder,
	image string,
) *MCPServer

NewMCPServer creates a new MCPServer instance. It accepts the same runCtx as other subcommands. NewMCPToolsContext overrides the logger to io.Discard for MCP tools so that output does not corrupt the STDIO protocol.

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 api.SubCommand.

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 api.SubCommand.

type Template

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

Template represents the "template" subcommand.

func NewTemplate

func NewTemplate(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
	f *flags.Flags,
	installerTarball []byte,
) *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(
	appCtx *api.AppContext,
	runCtx *runcontext.RunContext,
) *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