provider

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteValsSecret

func DeleteValsSecret(ctx context.Context, client dynamic.Interface, secretName string, namespace string) error

func New

func New(version string) func() provider.Provider

func NewSecretDataSource

func NewSecretDataSource() datasource.DataSource

func NewValsSecretDataSource

func NewValsSecretDataSource() datasource.DataSource

func NewValsSecretResource

func NewValsSecretResource() resource.Resource

Types

type DataSource

type DataSource struct {
	// Ref value to the secret in the format ref+backend://path
	// https://github.com/helmfile/vals
	Ref string `json:"ref"`
	// Encoding type for the secret. Only base64 supported. Optional
	Encoding string `json:"encoding,omitempty"`
}

DataSource defines a secret

type Database

type Database struct {
	// Defines the database type
	Driver string `json:"driver"`
	// Credentials to access the database
	LoginCredentials DatabaseLoginCredentials `json:"loginCredentials,omitempty"`
	// Database port number
	Port int `json:"port,omitempty"`
	// Key in the secret containing the database username
	UsernameKey string `json:"usernameKey,omitempty"`
	// Key in the secret containing the database username
	PasswordKey string `json:"passwordKey"`
	// Used for MySQL only, the host part for the username
	UserHost string `json:"userHost,omitempty"`
	// List of hosts to connect to, they'll be tried in sequence until one succeeds
	Hosts []string `json:"hosts"`
}

Database defines a DB connection

type DatabaseLoginCredentials

type DatabaseLoginCredentials struct {
	// Name of the secret containing the credentials to be able to log in to the database
	SecretName string `json:"secretName"`
	// Optional namespace of the secret, default current namespace
	Namespace string `json:"namespace,omitempty"`
	// Key in the secret containing the database username
	UsernameKey string `json:"usernameKey,omitempty"`
	// Key in the secret containing the database username
	PasswordKey string `json:"passwordKey"`
}

DatabaseLoginCredentials holds the access details for the DB

type KubeClientsets

type KubeClientsets interface {
	MainClientset() (*kubernetes.Clientset, error)
	AggregatorClientset() (*aggregator.Clientset, error)
	DynamicClient() (dynamic.Interface, error)
	DiscoveryClient() (discovery.DiscoveryInterface, error)
	RestClientConfig() (*restclient.Config, error)
}

type SecretDataSource

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

SecretDataSource defines the data source implementation.

func (*SecretDataSource) Configure

func (*SecretDataSource) Metadata

func (*SecretDataSource) Read

func (*SecretDataSource) Schema

type SecretDataSourceModel

type SecretDataSourceModel struct {
	Name       types.String `tfsdk:"name"`
	Namespace  types.String `tfsdk:"namespace"`
	Data       types.String `tfsdk:"data"`
	BinaryData types.String `tfsdk:"binary_data"`
	Type       types.String `tfsdk:"type"`
}

SecretDataSourceModel describes the data source data model.

type TfDataSource

type TfDataSource struct {
	Key      types.String `tfsdk:"key"`
	Ref      types.String `tfsdk:"ref"`
	Encoding types.String `tfsdk:"encoding"`
}

TfDataSource is a copy of DataSource using the Tf data types

type TfTemplateSource

type TfTemplateSource struct {
	Name  types.String `tfsdk:"name"`
	Value types.String `tfsdk:"value"`
}

TfTemplate is a copy of DataSource using the Tf data types

type ValsOperatorProvider

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

ValsOperatorProvider defines the provider implementation.

func (*ValsOperatorProvider) Configure

func (*ValsOperatorProvider) DataSources

func (p *ValsOperatorProvider) DataSources(ctx context.Context) []func() datasource.DataSource

func (*ValsOperatorProvider) Metadata

func (*ValsOperatorProvider) Resources

func (p *ValsOperatorProvider) Resources(ctx context.Context) []func() resource.Resource

func (*ValsOperatorProvider) Schema

type ValsOperatorProviderModel

type ValsOperatorProviderModel struct {
	Host     types.String `tfsdk:"host"`
	Username types.String `tfsdk:"username"`
	Password types.String `tfsdk:"password"`
	Insecure types.Bool   `tfsdk:"insecure"`

	TLSServerName        types.String `tfsdk:"tls_server_name"`
	ClientCertificate    types.String `tfsdk:"client_certificate"`
	ClientKey            types.String `tfsdk:"client_key"`
	ClusterCACertificate types.String `tfsdk:"cluster_ca_certificate"`

	ConfigPaths []types.String `tfsdk:"config_paths"`
	ConfigPath  types.String   `tfsdk:"config_path"`

	ConfigContext         types.String `tfsdk:"config_context"`
	ConfigContextAuthInfo types.String `tfsdk:"config_context_auth_info"`
	ConfigContextCluster  types.String `tfsdk:"config_context_cluster"`

	Token types.String `tfsdk:"token"`

	ProxyURL types.String `tfsdk:"proxy_url"`

	IgnoreAnnotations types.List `tfsdk:"ignore_annotations"`
	IgnoreLabels      types.List `tfsdk:"ignore_labels"`

	Exec []struct {
		APIVersion types.String            `tfsdk:"api_version"`
		Command    types.String            `tfsdk:"command"`
		Env        map[string]types.String `tfsdk:"env"`
		Args       []types.String          `tfsdk:"args"`
	} `tfsdk:"exec"`
}

KubernetesProviderModel describes the provider data model.

type ValsSecret

type ValsSecret struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ValsSecretSpec   `json:"spec,omitempty"`
	Status ValsSecretStatus `json:"status,omitempty"`
}

ValsSecret is the Schema for the valssecrets API

func CreateValsSecret

func CreateValsSecret(ctx context.Context, client dynamic.Interface, plan ValsSecretResourceModel) (*ValsSecret, error)

func GetValsSecret

func GetValsSecret(ctx context.Context, client dynamic.Interface, secretName string, namespace string) (*ValsSecret, error)

type ValsSecretDataSource

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

ValsSecretDataSource defines the data source implementation.

func (*ValsSecretDataSource) Configure

func (*ValsSecretDataSource) Metadata

func (*ValsSecretDataSource) Read

func (*ValsSecretDataSource) Schema

type ValsSecretDataSourceModel

type ValsSecretDataSourceModel struct {
	Name      types.String       `tfsdk:"name"`
	Namespace types.String       `tfsdk:"namespace"`
	Data      []TfDataSource     `tfsdk:"data"`
	Template  []TfTemplateSource `tfsdk:"template"`
	Type      types.String       `tfsdk:"type"`
	Ttl       types.Int64        `tfsdk:"ttl"`
}

ValsSecretDataSourceModel describes the data source data model.

type ValsSecretReference

type ValsSecretReference struct {
	Name     string `tfsdk:"name"`
	Ref      string `tfsdk:"ref"`
	Encoding string `tfsdk:"encoding"`
}

type ValsSecretResource

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

ValsSecretResource defines the resource implementation.

func (*ValsSecretResource) Configure

func (*ValsSecretResource) Create

func (*ValsSecretResource) Delete

func (*ValsSecretResource) ImportState

func (*ValsSecretResource) Metadata

func (*ValsSecretResource) Read

func (*ValsSecretResource) Schema

func (*ValsSecretResource) Update

type ValsSecretResourceModel

type ValsSecretResourceModel struct {
	Name      types.String          `tfsdk:"name"`
	Namespace types.String          `tfsdk:"namespace"`
	SecretRef []ValsSecretReference `tfsdk:"secret_ref"`
	Template  []ValsSecretTemplate  `tfsdk:"template"`
	Type      types.String          `tfsdk:"type"`
	Ttl       types.Int64           `tfsdk:"ttl"`
}

ValsSecretResourceModel describes the resource data model.

type ValsSecretSpec

type ValsSecretSpec struct {
	Name      string                `json:"name,omitempty"`
	Data      map[string]DataSource `json:"data"`
	TTL       int64                 `json:"ttl,omitempty"`
	Type      string                `json:"type,omitempty"`
	Databases []Database            `json:"databases,omitempty"`
	Template  map[string]string     `json:"template,omitempty"`
}

ValsSecretSpec defines the desired state of ValsSecret

type ValsSecretStatus

type ValsSecretStatus struct {
}

ValsSecretStatus defines the observed state of ValsSecret

type ValsSecretTemplate

type ValsSecretTemplate struct {
	Name  string `tfsdk:"name"`
	Value string `tfsdk:"value"`
}

Jump to

Keyboard shortcuts

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