Documentation
¶
Index ¶
- Constants
- func ApplyHTTPClientObservability(ctx any, feature string, client *commonsHTTP.Client, explicit *har.Collector) middlewares.Middleware
- func ApplyHTTPObservability(ctx any, feature string, base netHTTP.RoundTripper, explicit *har.Collector) netHTTP.RoundTripper
- func CreateHTTPClient(ctx ConnectionContext, conn HTTPConnection) (*http.Client, error)
- func Get(ctx context.Context, connectionName string) (*models.Connection, error)
- func GetFilesystem(ctx context.Context, conn FilesystemProvider) (fs.FilesystemRW, error)
- func GetFilesystemForConnection(ctx context.Context, conn interface{}) (fs.FilesystemRW, error)
- func KubernetesMaxResources(ctx context.Context, connectionName string) (int, error)
- type AWSConnection
- func (t *AWSConnection) Client(ctx context.Context) (aws.Config, error)
- func (in *AWSConnection) DeepCopy() *AWSConnection
- func (in *AWSConnection) DeepCopyInto(out *AWSConnection)
- func (t *AWSConnection) FromModel(connection models.Connection)
- func (t *AWSConnection) GetPassword() types.EnvVar
- func (t *AWSConnection) GetProperties() map[string]string
- func (t *AWSConnection) GetURL() types.EnvVar
- func (t *AWSConnection) GetUsername() types.EnvVar
- func (t *AWSConnection) Populate(ctx ConnectionContext) error
- func (t AWSConnection) ToModel() models.Connection
- type AWSKMS
- type AzureConnection
- func (in *AzureConnection) DeepCopy() *AzureConnection
- func (in *AzureConnection) DeepCopyInto(out *AzureConnection)
- func (g *AzureConnection) FromModel(connection models.Connection)
- func (g *AzureConnection) HydrateConnection(ctx ConnectionContext) error
- func (g AzureConnection) ToModel() models.Connection
- func (g *AzureConnection) TokenCredential() (azcore.TokenCredential, error)
- type AzureKeyVault
- type CNRMConnection
- type ConnectionContext
- type ConnectionSetupResult
- type EKSConnection
- type ExecConnections
- type FilesystemProvider
- type GCPConnection
- func (in *GCPConnection) DeepCopy() *GCPConnection
- func (in *GCPConnection) DeepCopyInto(out *GCPConnection)
- func (t *GCPConnection) FromModel(connection models.Connection)
- func (t *GCPConnection) GetCertificate() types.EnvVar
- func (t *GCPConnection) GetURL() types.EnvVar
- func (g *GCPConnection) HydrateConnection(ctx ConnectionContext) error
- func (t *GCPConnection) ToModel() models.Connection
- func (g *GCPConnection) Token(ctx context.Context, freshToken bool, scopes ...string) (*oauth2.Token, error)
- func (g *GCPConnection) TokenSource(ctx context.Context, scopes ...string) (oauth2.TokenSource, error)
- func (g *GCPConnection) Validate() *GCPConnection
- type GCPKMS
- type GCSConnection
- func (g *GCSConnection) Client(ctx context.Context) (*gcs.Client, error)
- func (in *GCSConnection) DeepCopy() *GCSConnection
- func (in *GCSConnection) DeepCopyInto(out *GCSConnection)
- func (c *GCSConnection) Filesystem(ctx context.Context) (fs.FilesystemRW, error)
- func (t *GCSConnection) GetProperties() map[string]string
- func (g *GCSConnection) HydrateConnection(ctx ConnectionContext) error
- func (g *GCSConnection) Validate() *GCSConnection
- type GKEConnection
- func (t *GKEConnection) Client(ctx context.Context) (*container.Service, error)
- func (in *GKEConnection) DeepCopy() *GKEConnection
- func (in *GKEConnection) DeepCopyInto(out *GKEConnection)
- func (t *GKEConnection) KubernetesClient(ctx context.Context, freshToken bool) (kubernetes.Interface, *rest.Config, error)
- func (t *GKEConnection) Populate(ctx ConnectionContext) error
- func (t *GKEConnection) Validate() *GKEConnection
- type GitClient
- type GitConnection
- func (in *GitConnection) DeepCopy() *GitConnection
- func (in *GitConnection) DeepCopyInto(out *GitConnection)
- func (git GitConnection) GetCertificate() types.EnvVar
- func (git GitConnection) GetPassword() types.EnvVar
- func (git GitConnection) GetURL() types.EnvVar
- func (git GitConnection) GetUsername() types.EnvVar
- func (c *GitConnection) HydrateConnection(ctx context.Context) error
- type GitDirtydeprecated
- type GitWorktree
- type HTTPConnection
- func (in *HTTPConnection) DeepCopy() *HTTPConnection
- func (in *HTTPConnection) DeepCopyInto(out *HTTPConnection)
- func (t *HTTPConnection) FromModel(connection models.Connection) error
- func (h HTTPConnection) GetEndpoint() string
- func (h *HTTPConnection) Hydrate(ctx ConnectionContext, namespace string) (*HTTPConnection, error)
- func (h HTTPConnection) IsEmpty() bool
- func (h HTTPConnection) Transport() netHTTP.RoundTripper
- type KubeconfigConnection
- type KubernetesConnection
- func (c KubernetesConnection) CanExpire() bool
- func (in *KubernetesConnection) DeepCopy() *KubernetesConnection
- func (in *KubernetesConnection) DeepCopyInto(out *KubernetesConnection)
- func (c KubernetesConnection) Hash() string
- func (t KubernetesConnection) Populate(ctx context.Context, freshToken bool) (kubernetes.Interface, *rest.Config, error)
- func (c KubernetesConnection) String() string
- func (t KubernetesConnection) ToModel() models.Connection
- type Loki
- type OpenTelemetry
- type PrometheusConnection
- func (in *PrometheusConnection) DeepCopy() *PrometheusConnection
- func (in *PrometheusConnection) DeepCopyInto(out *PrometheusConnection)
- func (t *PrometheusConnection) FromModel(connection models.Connection) error
- func (p *PrometheusConnection) NewClient(ctx context.Context) (v1.API, error)
- func (p *PrometheusConnection) Populate(ctx ConnectionContext) error
- type S3Connection
- func (in *S3Connection) DeepCopy() *S3Connection
- func (in *S3Connection) DeepCopyInto(out *S3Connection)
- func (c *S3Connection) Filesystem(ctx context.Context) (fs.FilesystemRW, error)
- func (t *S3Connection) GetProperties() map[string]string
- func (t *S3Connection) Populate(ctx ConnectionContext) error
- func (c S3Connection) ToModel() models.Connection
- type SFTPConnection
- func (in *SFTPConnection) DeepCopy() *SFTPConnection
- func (in *SFTPConnection) DeepCopyInto(out *SFTPConnection)
- func (c *SFTPConnection) Filesystem(ctx context.Context) (fs.FilesystemRW, error)
- func (c SFTPConnection) GetPort() int
- func (c *SFTPConnection) HydrateConnection(ctx ConnectionContext) (err error)
- func (c SFTPConnection) ToModel() models.Connection
- type SMBConnection
- func (in *SMBConnection) DeepCopy() *SMBConnection
- func (in *SMBConnection) DeepCopyInto(out *SMBConnection)
- func (c *SMBConnection) Filesystem(ctx context.Context) (fs.FilesystemRW, error)
- func (c SMBConnection) GetPort() int
- func (c *SMBConnection) Populate(ctx ConnectionContext) error
- func (c SMBConnection) ToModel() models.Connection
- type SQLConnection
- func (s *SQLConnection) Client(ctx context.Context) (*databasesql.DB, error)
- func (in *SQLConnection) DeepCopy() *SQLConnection
- func (in *SQLConnection) DeepCopyInto(out *SQLConnection)
- func (s *SQLConnection) FromModel(connection models.Connection) error
- func (s *SQLConnection) HydrateConnection(ctx context.Context) error
- func (s SQLConnection) ToModel() models.Connection
- func (s SQLConnection) UseDatabase(database string) (SQLConnection, error)
- type TLSConfig
Constants ¶
const ( ServiceGithub = "github" ServiceGitlab = "gitlab" )
const DefaultKubernetesMaxResources = 20
Variables ¶
This section is empty.
Functions ¶
func ApplyHTTPClientObservability ¶ added in v0.1.13
func ApplyHTTPClientObservability(ctx any, feature string, client *commonsHTTP.Client, explicit *har.Collector) middlewares.Middleware
ApplyHTTPClientObservability attaches HAR capture and HTTP logging to a commons HTTP client for the given feature. It returns a middleware suitable for reuse on derived (e.g. token) clients, or nil when nothing was attached.
func ApplyHTTPObservability ¶ added in v0.1.13
func ApplyHTTPObservability(ctx any, feature string, base netHTTP.RoundTripper, explicit *har.Collector) netHTTP.RoundTripper
ApplyHTTPObservability wraps a RoundTripper with HAR capture and HTTP logging for the given feature, honouring the context's effective levels.
func CreateHTTPClient ¶
func CreateHTTPClient(ctx ConnectionContext, conn HTTPConnection) (*http.Client, error)
CreateHTTPClient requires a hydrated connection
func GetFilesystem ¶
func GetFilesystem(ctx context.Context, conn FilesystemProvider) (fs.FilesystemRW, error)
GetFilesystem returns a filesystem interface from any connection that implements FilesystemProvider
func GetFilesystemForConnection ¶
func GetFilesystemForConnection(ctx context.Context, conn interface{}) (fs.FilesystemRW, error)
GetFilesystemForConnection is a helper that attempts to get a filesystem from various connection types
func KubernetesMaxResources ¶ added in v0.1.29
KubernetesMaxResources resolves the resource-discovery cap stored on a Kubernetes connection. An unnamed ambient connection and an unset property both use the documented default.
Types ¶
type AWSConnection ¶
type AWSConnection struct {
// ConnectionName of the connection. It'll be used to populate the endpoint, accessKey and secretKey.
ConnectionName string `yaml:"connection,omitempty" json:"connection,omitempty"`
AccessKey types.EnvVar `yaml:"accessKey,omitempty" json:"accessKey,omitempty"`
SecretKey types.EnvVar `yaml:"secretKey,omitempty" json:"secretKey,omitempty"`
SessionToken types.EnvVar `yaml:"sessionToken,omitempty" json:"sessionToken,omitempty"`
AssumeRole string `yaml:"assumeRole,omitempty" json:"assumeRole,omitempty"`
Region string `yaml:"region,omitempty" json:"region,omitempty"`
Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty"`
// Skip TLS verify when connecting to aws
SkipTLSVerify bool `yaml:"skipTLSVerify,omitempty" json:"skipTLSVerify,omitempty"`
}
+kubebuilder:object:generate=true
func (*AWSConnection) DeepCopy ¶
func (in *AWSConnection) DeepCopy() *AWSConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSConnection.
func (*AWSConnection) DeepCopyInto ¶
func (in *AWSConnection) DeepCopyInto(out *AWSConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AWSConnection) FromModel ¶
func (t *AWSConnection) FromModel(connection models.Connection)
func (*AWSConnection) GetPassword ¶
func (t *AWSConnection) GetPassword() types.EnvVar
func (*AWSConnection) GetProperties ¶
func (t *AWSConnection) GetProperties() map[string]string
func (*AWSConnection) GetURL ¶
func (t *AWSConnection) GetURL() types.EnvVar
func (*AWSConnection) GetUsername ¶
func (t *AWSConnection) GetUsername() types.EnvVar
func (*AWSConnection) Populate ¶
func (t *AWSConnection) Populate(ctx ConnectionContext) error
Populate populates an AWSConnection with credentials and other information. If a connection name is specified, it'll be used to populate the endpoint, accessKey and secretKey.
func (AWSConnection) ToModel ¶
func (t AWSConnection) ToModel() models.Connection
type AWSKMS ¶
type AWSKMS struct {
AWSConnection `json:",inline"`
// keyID can be an alias (eg: alias/ExampleAlias?region=us-east-1) or the ARN
KeyID string `json:"keyID,omitempty"`
}
func (*AWSKMS) FromModel ¶
func (t *AWSKMS) FromModel(conn models.Connection)
func (*AWSKMS) Populate ¶
func (t *AWSKMS) Populate(ctx ConnectionContext) error
func (*AWSKMS) SecretKeeper ¶
type AzureConnection ¶
type AzureConnection struct {
ConnectionName string `yaml:"connection,omitempty" json:"connection,omitempty"`
ClientID *types.EnvVar `yaml:"clientID,omitempty" json:"clientID,omitempty"`
ClientSecret *types.EnvVar `yaml:"clientSecret,omitempty" json:"clientSecret,omitempty"`
TenantID string `yaml:"tenantID,omitempty" json:"tenantID,omitempty"`
}
+kubebuilder:object:generate=true
func (*AzureConnection) DeepCopy ¶
func (in *AzureConnection) DeepCopy() *AzureConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureConnection.
func (*AzureConnection) DeepCopyInto ¶
func (in *AzureConnection) DeepCopyInto(out *AzureConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*AzureConnection) FromModel ¶
func (g *AzureConnection) FromModel(connection models.Connection)
func (*AzureConnection) HydrateConnection ¶
func (g *AzureConnection) HydrateConnection(ctx ConnectionContext) error
HydrateConnection attempts to find the connection by name and populate the endpoint and credentials.
func (AzureConnection) ToModel ¶
func (g AzureConnection) ToModel() models.Connection
func (*AzureConnection) TokenCredential ¶
func (g *AzureConnection) TokenCredential() (azcore.TokenCredential, error)
type AzureKeyVault ¶
type AzureKeyVault struct {
AzureConnection `json:",inline"`
// keyID is a URL to the key in the format
// https://<vault-name>.vault.azure.net/keys/<key-name>
KeyID string `json:"keyID,omitempty"`
}
func (*AzureKeyVault) FromModel ¶
func (t *AzureKeyVault) FromModel(conn models.Connection)
func (*AzureKeyVault) Populate ¶
func (t *AzureKeyVault) Populate(ctx ConnectionContext) error
func (*AzureKeyVault) SecretKeeper ¶
func (t *AzureKeyVault) SecretKeeper(ctx commonsContext.Context) (*secrets.Keeper, error)
type CNRMConnection ¶
type CNRMConnection struct {
GKE GKEConnection `json:"gke" yaml:"gke"`
ClusterResource string `json:"clusterResource"`
ClusterResourceNamespace string `json:"clusterResourceNamespace"`
}
+kubebuilder:object:generate=true
func (*CNRMConnection) DeepCopy ¶
func (in *CNRMConnection) DeepCopy() *CNRMConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CNRMConnection.
func (*CNRMConnection) DeepCopyInto ¶
func (in *CNRMConnection) DeepCopyInto(out *CNRMConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CNRMConnection) KubernetesClient ¶
func (t *CNRMConnection) KubernetesClient(ctx context.Context, freshToken bool) (kubernetes.Interface, *rest.Config, error)
func (*CNRMConnection) Populate ¶
func (t *CNRMConnection) Populate(ctx ConnectionContext) error
type ConnectionContext ¶
type ConnectionSetupResult ¶
type ConnectionSetupResult struct {
Sources []string `json:"source,omitempty"`
EnvVars []string `json:"envVars,omitempty"`
ApiServer string `json:"kubeApiServer,omitempty"`
Cleanup func() error `json:"-"`
}
func SetupConnection ¶
func SetupConnection(ctx context.Context, connections ExecConnections, cmd *osExec.Cmd) (result *ConnectionSetupResult, resultErr error)
SetupConnections creates the necessary credential files and injects env vars into the cmd
type EKSConnection ¶
type EKSConnection struct {
AWSConnection `json:",inline" yaml:",inline"`
Cluster string `json:"cluster"`
}
+kubebuilder:object:generate=true
func (*EKSConnection) DeepCopy ¶
func (in *EKSConnection) DeepCopy() *EKSConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSConnection.
func (*EKSConnection) DeepCopyInto ¶
func (in *EKSConnection) DeepCopyInto(out *EKSConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*EKSConnection) KubernetesClient ¶
func (t *EKSConnection) KubernetesClient(ctx context.Context, freshToken bool) (kubernetes.Interface, *rest.Config, error)
func (*EKSConnection) Populate ¶
func (t *EKSConnection) Populate(ctx ConnectionContext) error
type ExecConnections ¶
type ExecConnections struct {
FromConfigItem *string `yaml:"fromConfigItem,omitempty" json:"fromConfigItem,omitempty" template:"true"`
// EKSPodIdentity when enabled will allow access to AWS_* env vars
EKSPodIdentity bool `json:"eksPodIdentity,omitempty"`
// ServiceAccount when enabled will allow access to KUBERNETES env vars
ServiceAccount bool `json:"serviceAccount,omitempty"`
Kubernetes *KubernetesConnection `yaml:"kubernetes,omitempty" json:"kubernetes,omitempty"`
AWS *AWSConnection `yaml:"aws,omitempty" json:"aws,omitempty"`
GCP *GCPConnection `yaml:"gcp,omitempty" json:"gcp,omitempty"`
Azure *AzureConnection `yaml:"azure,omitempty" json:"azure,omitempty"`
}
+kubebuilder:object:generate=true
func (*ExecConnections) DeepCopy ¶
func (in *ExecConnections) DeepCopy() *ExecConnections
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecConnections.
func (*ExecConnections) DeepCopyInto ¶
func (in *ExecConnections) DeepCopyInto(out *ExecConnections)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FilesystemProvider ¶
type FilesystemProvider interface {
Filesystem(ctx context.Context) (fs.FilesystemRW, error)
}
FilesystemProvider is implemented by connections that can provide a filesystem interface
type GCPConnection ¶
type GCPConnection struct {
// ConnectionName of the connection. It'll be used to populate the endpoint and credentials.
ConnectionName string `yaml:"connection,omitempty" json:"connection,omitempty"`
Endpoint string `yaml:"endpoint" json:"endpoint,omitempty"`
Credentials *types.EnvVar `yaml:"credentials" json:"credentials,omitempty"`
// Skip TLS verify
SkipTLSVerify bool `yaml:"skipTLSVerify,omitempty" json:"skipTLSVerify,omitempty"`
Project string `yaml:"project" json:"project,omitempty"`
}
+kubebuilder:object:generate=true
func (*GCPConnection) DeepCopy ¶
func (in *GCPConnection) DeepCopy() *GCPConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPConnection.
func (*GCPConnection) DeepCopyInto ¶
func (in *GCPConnection) DeepCopyInto(out *GCPConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GCPConnection) FromModel ¶
func (t *GCPConnection) FromModel(connection models.Connection)
func (*GCPConnection) GetCertificate ¶
func (t *GCPConnection) GetCertificate() types.EnvVar
func (*GCPConnection) GetURL ¶
func (t *GCPConnection) GetURL() types.EnvVar
func (*GCPConnection) HydrateConnection ¶
func (g *GCPConnection) HydrateConnection(ctx ConnectionContext) error
HydrateConnection attempts to find the connection by name and populate the endpoint and credentials.
func (*GCPConnection) ToModel ¶
func (t *GCPConnection) ToModel() models.Connection
func (*GCPConnection) TokenSource ¶
func (g *GCPConnection) TokenSource(ctx context.Context, scopes ...string) (oauth2.TokenSource, error)
func (*GCPConnection) Validate ¶
func (g *GCPConnection) Validate() *GCPConnection
type GCPKMS ¶
type GCPKMS struct {
GCPConnection `json:",inline"`
// keyID points to the key in the format
// projects/MYPROJECT/locations/MYLOCATION/keyRings/MYKEYRING/cryptoKeys/MYKEY
KeyID string `json:"keyID,omitempty"`
}
func (*GCPKMS) FromModel ¶
func (t *GCPKMS) FromModel(conn models.Connection)
func (*GCPKMS) Populate ¶
func (t *GCPKMS) Populate(ctx ConnectionContext) error
func (*GCPKMS) SecretKeeper ¶
type GCSConnection ¶
type GCSConnection struct {
GCPConnection `json:",inline"`
Bucket string `yaml:"bucket,omitempty" json:"bucket,omitempty"`
}
+kubebuilder:object:generate=true
func (*GCSConnection) DeepCopy ¶
func (in *GCSConnection) DeepCopy() *GCSConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCSConnection.
func (*GCSConnection) DeepCopyInto ¶
func (in *GCSConnection) DeepCopyInto(out *GCSConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GCSConnection) Filesystem ¶
func (c *GCSConnection) Filesystem(ctx context.Context) (fs.FilesystemRW, error)
Filesystem returns a filesystem interface for GCS operations
func (*GCSConnection) GetProperties ¶
func (t *GCSConnection) GetProperties() map[string]string
func (*GCSConnection) HydrateConnection ¶
func (g *GCSConnection) HydrateConnection(ctx ConnectionContext) error
HydrateConnection attempts to find the connection by name and populate the endpoint and credentials.
func (*GCSConnection) Validate ¶
func (g *GCSConnection) Validate() *GCSConnection
type GKEConnection ¶
type GKEConnection struct {
GCPConnection `json:",inline" yaml:",inline"`
ProjectID string `json:"projectID"`
Zone string `json:"zone"`
Cluster string `json:"cluster"`
}
+kubebuilder:object:generate=true
func (*GKEConnection) DeepCopy ¶
func (in *GKEConnection) DeepCopy() *GKEConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GKEConnection.
func (*GKEConnection) DeepCopyInto ¶
func (in *GKEConnection) DeepCopyInto(out *GKEConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GKEConnection) KubernetesClient ¶
func (t *GKEConnection) KubernetesClient(ctx context.Context, freshToken bool) (kubernetes.Interface, *rest.Config, error)
func (*GKEConnection) Populate ¶
func (t *GKEConnection) Populate(ctx ConnectionContext) error
func (*GKEConnection) Validate ¶
func (t *GKEConnection) Validate() *GKEConnection
type GitClient ¶
type GitClient struct {
Auth transport.AuthMethod
URL string
Owner, Repo, Branch string
Depth int
AzureDevops bool
// TLS is the git-over-HTTPS transport config (custom CA, client
// certificate, insecure-skip-verify). nil leaves go-git's default TLS.
TLS *tls.Config
}
func CreateGitConfig ¶
func CreateGitConfig(ctx context.Context, conn *GitConnection) (*GitClient, error)
func (GitClient) GetContext ¶
func (GitClient) GetShortURL ¶
func (GitClient) LoggerName ¶
func (GitClient) RedactedURL ¶ added in v0.1.13
RedactedURL returns the URL with userinfo elided, falling back to the raw URL when it doesn't parse.
type GitConnection ¶
type GitConnection struct {
URL string `yaml:"url,omitempty" json:"url,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Connection string `yaml:"connection,omitempty" json:"connection,omitempty"`
Username *types.EnvVar `yaml:"username,omitempty" json:"username,omitempty"`
Password *types.EnvVar `yaml:"password,omitempty" json:"password,omitempty"`
Certificate *types.EnvVar `yaml:"certificate,omitempty" json:"certificate,omitempty"`
// TLS configures custom CA, client certificate and insecure-skip-verify for
// git-over-HTTPS. InsecureSkipVerify also skips SSH host-key verification.
TLS TLSConfig `yaml:"tls,omitempty" json:"tls,omitempty"`
// Type of connection e.g. github, gitlab
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`
Depth *int `yaml:"depth,omitempty" json:"depth,omitempty"`
// Worktree creates a native git worktree for the checkout before running.
Worktree *GitWorktree `yaml:"worktree,omitempty" json:"worktree,omitempty"`
// Since is a commit-ish whose merge-base diff against HEAD is folded into
// the reported dirtyFiles. Informational only.
Since string `yaml:"since,omitempty" json:"since,omitempty"`
// Deprecated: no-op, retained so existing configs keep parsing. Use
// GitWorktree.Uncommitted / GitWorktree.Ignored and Since instead.
Dirty *GitDirty `yaml:"dirty,omitempty" json:"dirty,omitempty"`
// Destination is the full path to where the contents of the URL should be downloaded to.
// If left empty, the sha256 hash of the URL will be used as the dir name.
Destination *string `yaml:"destination,omitempty" json:"destination,omitempty"`
}
+kubebuilder:object:generate=true
func (*GitConnection) DeepCopy ¶
func (in *GitConnection) DeepCopy() *GitConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitConnection.
func (*GitConnection) DeepCopyInto ¶
func (in *GitConnection) DeepCopyInto(out *GitConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (GitConnection) GetCertificate ¶
func (git GitConnection) GetCertificate() types.EnvVar
func (GitConnection) GetPassword ¶
func (git GitConnection) GetPassword() types.EnvVar
func (GitConnection) GetURL ¶
func (git GitConnection) GetURL() types.EnvVar
func (GitConnection) GetUsername ¶
func (git GitConnection) GetUsername() types.EnvVar
func (*GitConnection) HydrateConnection ¶
func (c *GitConnection) HydrateConnection(ctx context.Context) error
type GitDirty
deprecated
added in
v0.1.13
type GitDirty struct {
Staged bool `yaml:"staged,omitempty" json:"staged,omitempty"`
Unstaged bool `yaml:"unstaged,omitempty" json:"unstaged,omitempty"`
Untracked bool `yaml:"untracked,omitempty" json:"untracked,omitempty"`
Since string `yaml:"since,omitempty" json:"since,omitempty"`
}
Deprecated: no-op. See GitConnection.Dirty. +kubebuilder:object:generate=true
func (*GitDirty) DeepCopy ¶ added in v0.1.13
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitDirty.
func (*GitDirty) DeepCopyInto ¶ added in v0.1.13
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GitWorktree ¶ added in v0.1.13
type GitWorktree struct {
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
Prefix string `yaml:"prefix,omitempty" json:"prefix,omitempty"`
Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`
Base string `yaml:"base,omitempty" json:"base,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Keep bool `yaml:"keep,omitempty" json:"keep,omitempty"`
// Uncommitted carries staged, unstaged and untracked changes from the
// source repo into the worktree. The source is never mutated.
Uncommitted bool `yaml:"uncommitted,omitempty" json:"uncommitted,omitempty"`
// Ignored copies gitignored content into the worktree.
Ignored bool `yaml:"ignored,omitempty" json:"ignored,omitempty"`
}
+kubebuilder:object:generate=true
func (*GitWorktree) DeepCopy ¶ added in v0.1.13
func (in *GitWorktree) DeepCopy() *GitWorktree
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitWorktree.
func (*GitWorktree) DeepCopyInto ¶ added in v0.1.13
func (in *GitWorktree) DeepCopyInto(out *GitWorktree)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GitWorktree) IsEnabled ¶ added in v0.1.13
func (w *GitWorktree) IsEnabled() bool
type HTTPConnection ¶
type HTTPConnection struct {
ConnectionName string `json:"connection,omitempty" yaml:"connection,omitempty"`
types.HTTPBasicAuth `json:",inline"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
Bearer types.EnvVar `json:"bearer,omitempty" yaml:"bearer,omitempty"`
OAuth types.OAuth `json:"oauth,omitempty" yaml:"oauth,omitempty"`
TLS TLSConfig `json:"tls,omitempty" yaml:"tls,omitempty"`
}
+kubebuilder:object:generate=true
func NewHTTPConnection ¶
func NewHTTPConnection(ctx ConnectionContext, conn models.Connection) (HTTPConnection, error)
func (*HTTPConnection) DeepCopy ¶
func (in *HTTPConnection) DeepCopy() *HTTPConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPConnection.
func (*HTTPConnection) DeepCopyInto ¶
func (in *HTTPConnection) DeepCopyInto(out *HTTPConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*HTTPConnection) FromModel ¶
func (t *HTTPConnection) FromModel(connection models.Connection) error
func (HTTPConnection) GetEndpoint ¶
func (h HTTPConnection) GetEndpoint() string
func (*HTTPConnection) Hydrate ¶
func (h *HTTPConnection) Hydrate(ctx ConnectionContext, namespace string) (*HTTPConnection, error)
func (HTTPConnection) IsEmpty ¶ added in v0.1.29
func (h HTTPConnection) IsEmpty() bool
IsEmpty reports whether the connection names no endpoint and carries no credentials, i.e. it would hydrate into nothing usable.
func (HTTPConnection) Transport ¶
func (h HTTPConnection) Transport() netHTTP.RoundTripper
type KubeconfigConnection ¶
type KubeconfigConnection struct {
// Connection name to populate kubeconfig
ConnectionName string `json:"connection,omitempty"`
Kubeconfig *types.EnvVar `json:"kubeconfig,omitempty"`
}
+kubebuilder:object:generate=true
func (*KubeconfigConnection) DeepCopy ¶
func (in *KubeconfigConnection) DeepCopy() *KubeconfigConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeconfigConnection.
func (*KubeconfigConnection) DeepCopyInto ¶
func (in *KubeconfigConnection) DeepCopyInto(out *KubeconfigConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (KubeconfigConnection) Populate ¶
func (t KubeconfigConnection) Populate(ctx context.Context) (kubernetes.Interface, *rest.Config, error)
type KubernetesConnection ¶
type KubernetesConnection struct {
KubeconfigConnection `json:",inline"`
EKS *EKSConnection `json:"eks,omitempty"`
GKE *GKEConnection `json:"gke,omitempty"`
CNRM *CNRMConnection `json:"cnrm,omitempty"`
}
+kubebuilder:object:generate=true
func (KubernetesConnection) CanExpire ¶
func (c KubernetesConnection) CanExpire() bool
func (*KubernetesConnection) DeepCopy ¶
func (in *KubernetesConnection) DeepCopy() *KubernetesConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesConnection.
func (*KubernetesConnection) DeepCopyInto ¶
func (in *KubernetesConnection) DeepCopyInto(out *KubernetesConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (KubernetesConnection) Hash ¶
func (c KubernetesConnection) Hash() string
Hash returns a unique identifier of a KubernetesConnection, suitable for caching
func (KubernetesConnection) Populate ¶
func (t KubernetesConnection) Populate(ctx context.Context, freshToken bool) (kubernetes.Interface, *rest.Config, error)
func (KubernetesConnection) String ¶
func (c KubernetesConnection) String() string
String returns a human readable string representation of the KubernetesConnection
func (KubernetesConnection) ToModel ¶
func (t KubernetesConnection) ToModel() models.Connection
type Loki ¶
type Loki struct {
HTTPConnection `json:",inline" yaml:",inline"`
}
Loki is an HTTP endpoint like any other, and the connection form stores its credentials under the shared HTTP authentication contract (Properties keyed by authType). Embedding HTTPConnection is what makes basic, OAuth, bearer and mTLS all reachable, the same way PrometheusConnection does it.
+kubebuilder:object:generate=true
func (*Loki) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Loki.
func (*Loki) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Loki) Populate ¶
func (c *Loki) Populate(ctx ConnectionContext) error
type OpenTelemetry ¶ added in v0.1.23
func NewOpenTelemetry ¶ added in v0.1.23
func NewOpenTelemetry(connection *models.Connection) (OpenTelemetry, error)
func (OpenTelemetry) ResolveOpenSearch ¶ added in v0.1.23
func (connection OpenTelemetry) ResolveOpenSearch(ctx connectionHydrator) (*models.Connection, error)
type PrometheusConnection ¶
type PrometheusConnection struct {
HTTPConnection `json:",inline" yaml:",inline"`
}
+kubebuilder:object:generate=true
func (*PrometheusConnection) DeepCopy ¶
func (in *PrometheusConnection) DeepCopy() *PrometheusConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrometheusConnection.
func (*PrometheusConnection) DeepCopyInto ¶
func (in *PrometheusConnection) DeepCopyInto(out *PrometheusConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PrometheusConnection) FromModel ¶
func (t *PrometheusConnection) FromModel(connection models.Connection) error
func (*PrometheusConnection) Populate ¶
func (p *PrometheusConnection) Populate(ctx ConnectionContext) error
type S3Connection ¶
type S3Connection struct {
AWSConnection `json:",inline"`
Bucket string `yaml:"bucket,omitempty" json:"bucket,omitempty"`
// glob path to restrict matches to a subset
ObjectPath string `yaml:"objectPath,omitempty" json:"objectPath,omitempty"`
// Use path style path: http://s3.amazonaws.com/BUCKET/KEY instead of http://BUCKET.s3.amazonaws.com/KEY
UsePathStyle bool `yaml:"usePathStyle,omitempty" json:"usePathStyle,omitempty"`
}
+kubebuilder:object:generate=true
func (*S3Connection) DeepCopy ¶
func (in *S3Connection) DeepCopy() *S3Connection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new S3Connection.
func (*S3Connection) DeepCopyInto ¶
func (in *S3Connection) DeepCopyInto(out *S3Connection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*S3Connection) Filesystem ¶
func (c *S3Connection) Filesystem(ctx context.Context) (fs.FilesystemRW, error)
Filesystem returns a filesystem interface for S3 operations
func (*S3Connection) GetProperties ¶
func (t *S3Connection) GetProperties() map[string]string
func (*S3Connection) Populate ¶
func (t *S3Connection) Populate(ctx ConnectionContext) error
Populate populates an AWSConnection with credentials and other information. If a connection name is specified, it'll be used to populate the endpoint, accessKey and secretKey.
func (S3Connection) ToModel ¶
func (c S3Connection) ToModel() models.Connection
type SFTPConnection ¶
type SFTPConnection struct {
// ConnectionName of the connection. It'll be used to populate the connection fields.
ConnectionName string `yaml:"connection,omitempty" json:"connection,omitempty"`
// Port for the SSH server. Defaults to 22
Port int `yaml:"port,omitempty" json:"port,omitempty"`
Host string `yaml:"host,omitempty" json:"host,omitempty"`
types.Authentication `yaml:",inline" json:",inline"`
}
+kubebuilder:object:generate=true
func (*SFTPConnection) DeepCopy ¶
func (in *SFTPConnection) DeepCopy() *SFTPConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SFTPConnection.
func (*SFTPConnection) DeepCopyInto ¶
func (in *SFTPConnection) DeepCopyInto(out *SFTPConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SFTPConnection) Filesystem ¶
func (c *SFTPConnection) Filesystem(ctx context.Context) (fs.FilesystemRW, error)
Filesystem returns a filesystem interface for SFTP operations
func (SFTPConnection) GetPort ¶
func (c SFTPConnection) GetPort() int
func (*SFTPConnection) HydrateConnection ¶
func (c *SFTPConnection) HydrateConnection(ctx ConnectionContext) (err error)
func (SFTPConnection) ToModel ¶
func (c SFTPConnection) ToModel() models.Connection
type SMBConnection ¶
type SMBConnection struct {
types.Authentication `yaml:",inline" json:",inline"`
// ConnectionName of the connection. It'll be used to populate the connection fields.
ConnectionName string `yaml:"connection,omitempty" json:"connection,omitempty"`
// Port on which smb server is running. Defaults to 445
Port int `yaml:"port,omitempty" json:"port,omitempty"`
Domain string `yaml:"domain,omitempty" json:"domain,omitempty"`
}
+kubebuilder:object:generate=true
func (*SMBConnection) DeepCopy ¶
func (in *SMBConnection) DeepCopy() *SMBConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SMBConnection.
func (*SMBConnection) DeepCopyInto ¶
func (in *SMBConnection) DeepCopyInto(out *SMBConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SMBConnection) Filesystem ¶
func (c *SMBConnection) Filesystem(ctx context.Context) (fs.FilesystemRW, error)
Filesystem returns a filesystem interface for SMB operations
func (SMBConnection) GetPort ¶
func (c SMBConnection) GetPort() int
func (*SMBConnection) Populate ¶
func (c *SMBConnection) Populate(ctx ConnectionContext) error
func (SMBConnection) ToModel ¶
func (c SMBConnection) ToModel() models.Connection
type SQLConnection ¶ added in v0.1.13
type SQLConnection struct {
ConnectionName string `yaml:"connection,omitempty" json:"connection,omitempty"`
Type string `yaml:"type,omitempty" json:"type,omitempty"`
URL types.EnvVar `yaml:"url,omitempty" json:"url,omitempty"`
Username types.EnvVar `yaml:"username,omitempty" json:"username,omitempty"`
Password types.EnvVar `yaml:"password,omitempty" json:"password,omitempty"`
Properties types.JSONStringMap `yaml:"properties,omitempty" json:"properties,omitempty"`
}
SQLConnection is a multi-driver SQL connection (postgres, mysql, sqlserver). Ported from duty/connection so commons-db data providers can open arbitrary SQL backends from a models.Connection or an inline URL.
+kubebuilder:object:generate=true
func (*SQLConnection) Client ¶ added in v0.1.13
func (s *SQLConnection) Client(ctx context.Context) (*databasesql.DB, error)
Client creates and returns a database/sql DB client.
NOTE: Must be run on a hydrated SQLConnection.
func (*SQLConnection) DeepCopy ¶ added in v0.1.27
func (in *SQLConnection) DeepCopy() *SQLConnection
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SQLConnection.
func (*SQLConnection) DeepCopyInto ¶ added in v0.1.27
func (in *SQLConnection) DeepCopyInto(out *SQLConnection)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SQLConnection) FromModel ¶ added in v0.1.13
func (s *SQLConnection) FromModel(connection models.Connection) error
func (*SQLConnection) HydrateConnection ¶ added in v0.1.13
func (s *SQLConnection) HydrateConnection(ctx context.Context) error
func (SQLConnection) ToModel ¶ added in v0.1.13
func (s SQLConnection) ToModel() models.Connection
func (SQLConnection) UseDatabase ¶ added in v0.1.15
func (s SQLConnection) UseDatabase(database string) (SQLConnection, error)
UseDatabase returns a copy of the connection scoped to database. Credentials remain in their existing EnvVar fields and are applied when Client is opened.
type TLSConfig ¶
type TLSConfig struct {
// InsecureSkipVerify controls whether a client verifies the server's
// certificate chain and host name
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty"`
// HandshakeTimeout defaults to 10 seconds
HandshakeTimeout time.Duration `json:"handshakeTimeout,omitempty" yaml:"handshakeTimeout,omitempty"`
// PEM encoded certificate of the CA to verify the server certificate
CA types.EnvVar `json:"ca,omitempty" yaml:"ca,omitempty"`
// PEM encoded client certificate
Cert types.EnvVar `json:"cert,omitempty" yaml:"cert,omitempty"`
// PEM encoded client private key
Key types.EnvVar `json:"key,omitempty" yaml:"key,omitempty"`
}
+kubebuilder:object:generate=true
func (*TLSConfig) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig.
func (*TLSConfig) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (TLSConfig) TLSClientConfig ¶ added in v0.1.29
TLSClientConfig builds the tls.Config this connection describes. Exported because not every client is an http.RoundTripper — the Loki tail stream needs the same certificates on a websocket dialer.