Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindYAML ¶
type BindYAML struct { Credential []CredentialVar `json:"credential"` CredentialFrom []CredentialFromSource `json:"credentialFrom"` }
BindYAML represents a yBundle plan bind.yaml structure
type CredentialFromSource ¶
type CredentialFromSource struct { // The ConfigMap to select from // + optional ConfigMapRef *NameSelector `json:"configMapRef,omitempty"` // The Secret to select from // +optional SecretRef *NameSelector `json:"secretRef,omitempty"` }
CredentialFromSource represents list of sources to populate credentials variables.
type CredentialVar ¶
type CredentialVar struct { // Required Name string `json:"name"` // Optional: no more than one of the following may be specified. Value string `json:"value"` // Optional: Specifies a source the value of this var should come from. ValueFrom *CredentialVarSource `json:"valueFrom,omitempty"` }
CredentialVar represents an credential variable.
type CredentialVarSource ¶
type CredentialVarSource struct { // Selects a key of a ConfigMap. // +optional ConfigMapKeyRef *KeySelector `json:"configMapKeyRef,omitempty"` // Selects a key of a Secret in the helm release namespace. // +optional SecretKeyRef *KeySelector `json:"secretKeyRef,omitempty"` // Selects a field from a Service. // +optional ServiceRef *JSONPathSelector `json:"serviceRef,omitempty"` }
CredentialVarSource represents a source for the value of an CredentialVar. ONLY ONE of its fields may be set.
type JSONPathSelector ¶
type JSONPathSelector struct { NameSelector `json:",inline"` // JSONPath template for extracting given value from resource. JSONPath string `json:"jsonpath"` }
JSONPathSelector select a field of a k8s resource by defining JSONPath
type KeySelector ¶
type KeySelector struct { NameSelector `json:",inline"` // The key of the resource to select from. Key string `json:"key"` }
KeySelector selects a key of a k8s resource.
type NameSelector ¶
type NameSelector struct { // Name the name of k8s resource. Name string `json:"name"` }
NameSelector selects by the name of k8s resource.
type RenderedBindYAML ¶
type RenderedBindYAML []byte
RenderedBindYAML is used to represent already rendered YAML for binding.
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer purpose is to render helm template directives, like: {{ .Release.Namespace }}
func (*Renderer) Render ¶
func (r *Renderer) Render(bindTemplate internal.BundlePlanBindTemplate, resp *rls.InstallReleaseResponse) (RenderedBindYAML, error)
Render renders given bindTemplate in context of helm Chart by e.g. replacing directives like: {{ .Release.Namespace }}
type ResolveOutput ¶
type ResolveOutput struct {
Credentials internal.InstanceCredentials
}
ResolveOutput represents results of Resolve.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver implements resolver for chart values.
func NewResolver ¶
func NewResolver(clientCoreV1 corev1.CoreV1Interface) *Resolver
NewResolver returns new instance of Resolver.
func (*Resolver) Resolve ¶
func (r *Resolver) Resolve(bindYAML RenderedBindYAML, ns internal.Namespace) (*ResolveOutput, error)
Resolve determines the final value of credentials
Resolve policy rules 1. When a key exists in multiple sources defined by `credentialFrom` section, then the value associated with the last source will take precedence 2. When you duplicate a key in `credential` section then error will be returned 3. Values defined by `credentialFrom` section will be overridden by values from `credential` section if keys will be duplicated