Documentation
¶
Overview ¶
Package components provides functions for managing the validator components.
Index ¶
- Constants
- func ConfigureBaseValidator(vc *ValidatorConfig, kubeconfig string)
- func ConfigureNetworkPlugin(vc *ValidatorConfig, config NetworkConfig)
- func ConfigureOciPlugin(vc *ValidatorConfig, config OciConfig)
- func ConfigureVspherePlugin(vc *ValidatorConfig, config VsphereConfig)
- func SaveValidatorConfig(c *ValidatorConfig, tc *cfg.TaskConfig) error
- type AWSPluginConfig
- type AzurePluginConfig
- type AzureStaticDeploymentValues
- type BasicAuth
- type CACert
- type Env
- type KindConfig
- type NetworkConfig
- type NetworkPluginConfig
- type OCIPluginConfig
- type OciConfig
- type ProxyConfig
- type PublicKeySecret
- type Registry
- type RegistryConfig
- type Secret
- type SinkConfig
- type ValidatorConfig
- type VsphereConfig
- type VsphereEntityPrivilegeRule
- type VspherePluginConfig
- type VsphereRolePrivilegeRule
- type VsphereTagRule
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 ConfigureBaseValidator ¶ added in v0.0.3
func ConfigureBaseValidator(vc *ValidatorConfig, kubeconfig string)
ConfigureBaseValidator configures the base validator configuration
func ConfigureNetworkPlugin ¶ added in v0.0.3
func ConfigureNetworkPlugin(vc *ValidatorConfig, config NetworkConfig)
ConfigureNetworkPlugin configures the network plugin.
func ConfigureOciPlugin ¶ added in v0.0.3
func ConfigureOciPlugin(vc *ValidatorConfig, config OciConfig)
ConfigureOciPlugin configures the OCI plugin.
func ConfigureVspherePlugin ¶ added in v0.0.3
func ConfigureVspherePlugin(vc *ValidatorConfig, config VsphereConfig)
ConfigureVspherePlugin configures the vSphere plugin.
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"`
ReleaseSecret *Secret `yaml:"helmReleaseSecret"`
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"`
ReleaseSecret *Secret `yaml:"helmReleaseSecret"`
ServiceAccountName string `yaml:"serviceAccountName,omitempty"`
TenantID string `yaml:"tenantId"`
ClientID string `yaml:"clientId"`
ClientSecret string `yaml:"clientSecret"`
RuleTypes map[int]string `yaml:"ruleTypes"`
PlacementTypes map[int]string `yaml:"placementTypes"`
StaticDeploymentTypes map[int]string `yaml:"staticDeploymentTypes"`
StaticDeploymentValues map[int]*AzureStaticDeploymentValues `yaml:"staticDeploymentValues"`
Validator *azure.AzureValidatorSpec `yaml:"validator"`
}
AzurePluginConfig represents the Azure plugin configuration.
type AzureStaticDeploymentValues ¶
type AzureStaticDeploymentValues struct {
Subscription string `yaml:"subscriptionUuid"`
ResourceGroup string `yaml:"resourceGroupUuid"`
VirtualNetwork string `yaml:"virtualNetworkUuid"`
Subnet string `yaml:"subnetUuid"`
ComputeGallery string `yaml:"computeGalleryUuid"`
}
AzureStaticDeploymentValues represents the static deployment values for Azure.
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 NetworkConfig ¶ added in v0.0.3
type NetworkConfig struct {
VcenterServer string
IPRangeRules []network_api.IPRangeRule
TCPConnRules []network_api.TCPConnRule
}
NetworkConfig represents the network plugin configuration.
type NetworkPluginConfig ¶
type NetworkPluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
ReleaseSecret *Secret `yaml:"helmReleaseSecret"`
Validator *network.NetworkValidatorSpec `yaml:"validator"`
}
NetworkPluginConfig represents the network plugin configuration.
type OCIPluginConfig ¶
type OCIPluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
ReleaseSecret *Secret `yaml:"helmReleaseSecret"`
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.
type OciConfig ¶ added in v0.0.3
type OciConfig struct {
// HostRefs is a map of hostnames to a list of artifact references
HostRefs map[string][]string
}
OciConfig represents the OCI plugin configuration.
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.
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 {
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"`
NetworkPlugin *NetworkPluginConfig `yaml:"networkPlugin,omitempty"`
OCIPlugin *OCIPluginConfig `yaml:"ociPlugin,omitempty"`
VspherePlugin *VspherePluginConfig `yaml:"vspherePlugin,omitempty"`
AzurePlugin *AzurePluginConfig `yaml:"azurePlugin,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.
type VsphereConfig ¶ added in v0.0.3
type VsphereConfig struct {
Username string
Password string
VcenterServer string
Datacenter string
ClusterName string
ImageTemplateFolder string
NodePoolResourceRequirements []vsphereapi.NodepoolResourceRequirement
TagValidationRules []vsphereapi.TagValidationRule
Privileges []string
}
VsphereConfig represents the vSphere plugin configuration.
type VsphereEntityPrivilegeRule ¶
type VsphereEntityPrivilegeRule struct {
vsphereapi.EntityPrivilegeValidationRule `yaml:",inline"`
ClusterScoped bool `yaml:"clusterScoped"`
}
VsphereEntityPrivilegeRule represents a vSphere entity privilege rule.
type VspherePluginConfig ¶
type VspherePluginConfig struct {
Enabled bool `yaml:"enabled"`
Release *validator.HelmRelease `yaml:"helmRelease"`
ReleaseSecret *Secret `yaml:"helmReleaseSecret"`
Account *vsphere.CloudAccount `yaml:"account"`
Validator *vsphereapi.VsphereValidatorSpec `yaml:"validator"`
VsphereEntityPrivilegeRules []VsphereEntityPrivilegeRule `yaml:"vsphereEntityPrivilegeRules"`
VsphereRolePrivilegeRules []VsphereRolePrivilegeRule `yaml:"vsphereRolePrivilegeRules"`
VsphereTagRules []VsphereTagRule `yaml:"vsphereTagRules"`
}
VspherePluginConfig represents the vSphere plugin configuration.
type VsphereRolePrivilegeRule ¶
type VsphereRolePrivilegeRule struct {
vsphereapi.GenericRolePrivilegeValidationRule `yaml:",inline"`
Name string `yaml:"name"`
}
VsphereRolePrivilegeRule represents a vSphere role privilege rule.
type VsphereTagRule ¶
type VsphereTagRule struct {
vsphereapi.TagValidationRule `yaml:",inline"`
}
VsphereTagRule represents a vSphere tag rule.