Help us shape the future of Go! Take the 2026 Go Developer Survey

plugin

package
v3.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigManagementPluginKind string = "ConfigManagementPlugin"
)

Variables

This section is empty.

Functions

func ValidatePluginConfig

func ValidatePluginConfig(config PluginConfig) error

Types

type CMPServerInitConstants

type CMPServerInitConstants struct {
	PluginConfig PluginConfig
}

type CmdError

type CmdError struct {
	Args   string
	Stderr string
	Cause  error
}

func (*CmdError) Error

func (ce *CmdError) Error() string

type Command

type Command struct {
	Command []string `json:"command,omitempty"`
	Args    []string `json:"args,omitempty"`
}

Command holds binary path and arguments list

type Discover

type Discover struct {
	Find     Find   `json:"find"`
	FileName string `json:"fileName"`
}

Discover holds find and fileName

func (Discover) IsDefined

func (d Discover) IsDefined() bool

type Dynamic

type Dynamic struct {
	Command
}

Dynamic hold the dynamic announcements for CMP's

type Find

type Find struct {
	Command
	Glob string `json:"glob"`
}

Find holds find command or glob pattern

type GenerateManifestStream

type GenerateManifestStream interface {
	Stream
	SendAndClose(response *apiclient.ManifestResponse) error
}

type MatchRepositoryStream

type MatchRepositoryStream interface {
	Stream
	SendAndClose(response *apiclient.RepositoryResponse) error
}

type Parameters

type Parameters struct {
	Static  []*apiclient.ParameterAnnouncement `yaml:"static"`
	Dynamic Command                            `yaml:"dynamic"`
}

Parameters holds static and dynamic configurations

type ParametersAnnouncementStream

type ParametersAnnouncementStream interface {
	Stream
	SendAndClose(response *apiclient.ParametersAnnouncementResponse) error
}

ParametersAnnouncementStream defines an interface able to send/receive a stream of parameter announcements.

type PluginConfig

type PluginConfig struct {
	metav1.TypeMeta `json:",inline"`
	Metadata        metav1.ObjectMeta `json:"metadata"`
	Spec            PluginConfigSpec  `json:"spec"`
}

func ReadPluginConfig

func ReadPluginConfig(filePath string) (*PluginConfig, error)

func (*PluginConfig) Address

func (cfg *PluginConfig) Address() string

type PluginConfigSpec

type PluginConfigSpec struct {
	Version          string     `json:"version"`
	Init             Command    `json:"init,omitempty"`
	Generate         Command    `json:"generate"`
	Discover         Discover   `json:"discover"`
	Parameters       Parameters `yaml:"parameters"`
	PreserveFileMode bool       `json:"preserveFileMode,omitempty"`
	ProvideGitCreds  bool       `json:"provideGitCreds,omitempty"`
}

type Service

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

Service implements ConfigManagementPluginService interface

func NewService

func NewService(initConstants CMPServerInitConstants) *Service

NewService returns a new instance of the ConfigManagementPluginService

func (*Service) CheckPluginConfiguration

func (s *Service) CheckPluginConfiguration(_ context.Context, _ *empty.Empty) (*apiclient.CheckPluginConfigurationResponse, error)

func (*Service) GenerateManifest

GenerateManifest runs generate command from plugin config file and returns generated manifest files

func (*Service) GetParametersAnnouncement

GetParametersAnnouncement gets parameter announcements for a given Application and repo contents.

func (*Service) Init

func (s *Service) Init(workDir string) error

func (*Service) MatchRepository

MatchRepository receives the application stream and checks whether its repository type is supported by the config management plugin server. The checks are implemented in the following order:

  1. If spec.Discover.FileName is provided it finds for a name match in Applications files
  2. If spec.Discover.Find.Glob is provided if finds for a glob match in Applications files
  3. Otherwise it runs the spec.Discover.Find.Command

type Stream

type Stream interface {
	Recv() (*apiclient.AppStreamRequest, error)
	Context() context.Context
}

Jump to

Keyboard shortcuts

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