Documentation
¶
Overview ¶
Package components provides functions for managing the validator components.
Index ¶
- Constants
- func SaveValidatorConfig(c *ValidatorConfig, tc *cfg.TaskConfig) error
- type AWSPluginConfig
- type AzurePluginConfig
- type BasicAuth
- type CACert
- type Env
- type KindConfig
- type MaasPluginConfig
- type NetworkPluginConfig
- type OCIPluginConfig
- type ProxyConfig
- type PublicKeySecret
- type Registry
- type RegistryConfig
- type Secret
- type SinkConfig
- type ValidatorConfig
- type VspherePluginConfig
Constants ¶
const UnspecifiedPort = -1
UnspecifiedPort is the value given to a Registry.Port when it is not specified.
Variables ¶
This section is empty.
Functions ¶
func SaveValidatorConfig ¶
func SaveValidatorConfig(c *ValidatorConfig, tc *cfg.TaskConfig) error
SaveValidatorConfig saves a validator configuration file to disk
Types ¶
type AWSPluginConfig ¶
type AWSPluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
AccessKeyID string `yaml:"accessKeyId,omitempty"`
SecretAccessKey string `yaml:"secretAccessKey,omitempty"`
SessionToken string `yaml:"sessionToken,omitempty"`
ServiceAccountName string `yaml:"serviceAccountName,omitempty"`
Validator *aws.AwsValidatorSpec `yaml:"validator"`
}
AWSPluginConfig represents the AWS plugin configuration.
type AzurePluginConfig ¶
type AzurePluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
ServiceAccountName string `yaml:"serviceAccountName,omitempty"`
Cloud string `yaml:"cloud"`
TenantID string `yaml:"tenantId"`
ClientID string `yaml:"clientId"`
ClientSecret string `yaml:"clientSecret"`
Validator *azure.AzureValidatorSpec `yaml:"validator"`
}
AzurePluginConfig represents the Azure plugin configuration.
type BasicAuth ¶ added in v0.0.5
BasicAuth represents basic authentication credentials.
func (*BasicAuth) Configured ¶ added in v0.0.5
Configured returns true if the basic auth is non-empty.
type CACert ¶ added in v0.0.5
type CACert struct {
Data string `yaml:"data"`
Name string `yaml:"name"`
Path string `yaml:"path"`
}
CACert represents a CA certificate.
type Env ¶ added in v0.0.5
type Env struct {
HTTPProxy string `yaml:"httpProxy,omitempty"`
HTTPSProxy string `yaml:"httpsProxy,omitempty"`
NoProxy string `yaml:"noProxy,omitempty"`
PodCIDR *string `yaml:"podCIDR"`
ProxyCACert *CACert `yaml:"proxyCaCert,omitempty"`
ServiceIPRange *string `yaml:"serviceIPRange"`
}
Env represents the environment configuration.
type KindConfig ¶
type KindConfig struct {
UseKindCluster bool `yaml:"useKindCluster"`
KindClusterName string `yaml:"kindClusterName"`
}
KindConfig represents the kind configuration.
type MaasPluginConfig ¶ added in v0.1.2
type MaasPluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
Validator *maas.MaasValidatorSpec `yaml:"validator"`
}
MaasPluginConfig represents the MAAS plugin configuration.
type NetworkPluginConfig ¶
type NetworkPluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
HTTPFileAuths [][]string `yaml:"httpFileAuths,omitempty"`
Validator *network.NetworkValidatorSpec `yaml:"validator"`
}
NetworkPluginConfig represents the network plugin configuration.
func (*NetworkPluginConfig) AddDummyHTTPFileAuth ¶ added in v0.1.0
func (c *NetworkPluginConfig) AddDummyHTTPFileAuth()
AddDummyHTTPFileAuth adds a dummy HTTP file auth to the NetworkPluginConfig. This keeps the slice in sync when reconfiguring the plugin.
func (*NetworkPluginConfig) HTTPFileAuthBytes ¶ added in v0.1.0
func (c *NetworkPluginConfig) HTTPFileAuthBytes() [][][]byte
HTTPFileAuthBytes converts a slice of basic authentication details from a [][]string to a [][][]byte. The former is required for YAML marshalling, encryption, and decryption, while the latter is required by the plugin's Validate method. TODO: refactor Network plugin to use [][]string.
type OCIPluginConfig ¶
type OCIPluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
Secrets []*Secret `yaml:"secrets,omitempty"`
PublicKeySecrets []*PublicKeySecret `yaml:"publicKeySecrets,omitempty"`
CaCertPaths map[int]string `yaml:"caCertPaths,omitempty"`
Validator *oci.OciValidatorSpec `yaml:"validator"`
}
OCIPluginConfig represents the OCI plugin configuration.
func (*OCIPluginConfig) AllPubKeys ¶ added in v0.1.0
func (c *OCIPluginConfig) AllPubKeys() map[string][][]byte
AllPubKeys returns a slice of public keys for each public key secret.
func (*OCIPluginConfig) BasicAuths ¶ added in v0.1.0
func (c *OCIPluginConfig) BasicAuths() map[string][]string
BasicAuths returns a slice of basic authentication details for each rule.
type ProxyConfig ¶
ProxyConfig represents the proxy configuration.
type PublicKeySecret ¶
PublicKeySecret represents a public key secret.
type Registry ¶ added in v0.0.5
type Registry struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
BasicAuth *BasicAuth `yaml:"basicAuth,omitempty"`
InsecureSkipTLSVerify bool `yaml:"insecureSkipTLSVerify"`
CACert *CACert `yaml:"caCert,omitempty"`
ReuseProxyCACert bool `yaml:"reuseProxyCACert,omitempty"`
BaseContentPath string `yaml:"baseContentPath"`
IsAirgapped bool `yaml:"isAirgapped"`
}
Registry represents the generic configuration for a registry. If IsAirgapped is true, a local Hauler registry is used.
func (*Registry) ChartEndpoint ¶ added in v0.0.5
ChartEndpoint returns the chart repository URL.
func (*Registry) ImageEndpoint ¶ added in v0.0.5
ImageEndpoint returns the image repository URL.
type RegistryConfig ¶ added in v0.0.5
RegistryConfig represents the artifact registry configuration.
func (*RegistryConfig) BasicAuthEnabled ¶ added in v0.1.0
func (c *RegistryConfig) BasicAuthEnabled() bool
BasicAuthEnabled returns true if basic auth is enabled on the RegistryConfig.
func (*RegistryConfig) ToHelmConfig ¶ added in v0.1.0
func (c *RegistryConfig) ToHelmConfig() *validator.HelmConfig
ToHelmConfig converts the RegistryConfig to a HelmConfig.
type Secret ¶
type Secret struct {
Name string `yaml:"name"`
BasicAuth *BasicAuth `yaml:"basicAuth,omitempty"`
Data map[string]string `yaml:"data,omitempty"`
CaCertFile string `yaml:"caCertFile,omitempty"`
Exists bool `yaml:"exists"`
}
Secret represents a k8s secret.
func (*Secret) ShouldCreate ¶
ShouldCreate returns true if the secret should be created.
type SinkConfig ¶
type SinkConfig struct {
Enabled bool `yaml:"enabled"`
CreateSecret bool `yaml:"createSecret"`
SecretName string `yaml:"secretName"`
Type string `yaml:"type"`
Values map[string]string `yaml:"values"`
}
SinkConfig represents the sink configuration.
type ValidatorConfig ¶
type ValidatorConfig struct {
HelmConfig *validator.HelmConfig `yaml:"helmConfig"`
Release *validator.HelmRelease `yaml:"helmRelease"`
ReleaseSecret *Secret `yaml:"helmReleaseSecret"`
KindConfig KindConfig `yaml:"kindConfig"`
Kubeconfig string `yaml:"kubeconfig"`
RegistryConfig *RegistryConfig `yaml:"registryConfig"`
SinkConfig *SinkConfig `yaml:"sinkConfig"`
ProxyConfig *ProxyConfig `yaml:"proxyConfig"`
ImageRegistry string `yaml:"imageRegistry"`
UseFixedVersions bool `yaml:"useFixedVersions"`
AWSPlugin *AWSPluginConfig `yaml:"awsPlugin,omitempty"`
AzurePlugin *AzurePluginConfig `yaml:"azurePlugin,omitempty"`
MaasPlugin *MaasPluginConfig `yaml:"maasPlugin,omitempty"`
NetworkPlugin *NetworkPluginConfig `yaml:"networkPlugin,omitempty"`
OCIPlugin *OCIPluginConfig `yaml:"ociPlugin,omitempty"`
VspherePlugin *VspherePluginConfig `yaml:"vspherePlugin,omitempty"`
}
ValidatorConfig represents the validator configuration.
func LoadValidatorConfig ¶
func LoadValidatorConfig(tc *cfg.TaskConfig) (*ValidatorConfig, error)
LoadValidatorConfig loads a validator configuration file from disk
func NewValidatorConfig ¶
func NewValidatorConfig() *ValidatorConfig
NewValidatorConfig creates a new ValidatorConfig object.
func NewValidatorFromConfig ¶
func NewValidatorFromConfig(tc *cfg.TaskConfig) (*ValidatorConfig, error)
NewValidatorFromConfig loads a validator configuration file from disk and decrypts it
func (*ValidatorConfig) AnyPluginEnabled ¶
func (c *ValidatorConfig) AnyPluginEnabled() bool
AnyPluginEnabled returns true if any plugin is enabled.
func (*ValidatorConfig) EnabledPluginsHaveRules ¶ added in v0.1.0
func (c *ValidatorConfig) EnabledPluginsHaveRules() (bool, []string)
EnabledPluginsHaveRules returns true if all enabled plugins have at least one rule configured.
type VspherePluginConfig ¶
type VspherePluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
Validator *vsphereapi.VsphereValidatorSpec `yaml:"validator"`
}
VspherePluginConfig represents the vSphere plugin configuration.