Documentation ¶
Overview ¶
Package configurations encapsulates all the functionality around Epinio configurations A Configuration is essentially a Secret with some Epinio specific labels. This allows us to use any Secret as a Configuration as long as someone labels it as such. In the future, we will use this to expose secrets created by Service helm charts as Configurations (https://github.com/epinio/epinio/issues/1281). Since we don't control the name of the produced secret in that case, we will need some method to tie a Configuration to a Service. This can be solved with some labels on the Configuration or the Service instance resource.
Index ¶
Constants ¶
const (
ConfigurationLabelKey = "epinio.suse.org/configuration"
)
Variables ¶
This section is empty.
Functions ¶
func ReplaceConfiguration ¶
func ReplaceConfiguration(ctx context.Context, cluster *kubernetes.Cluster, configuration *Configuration, data map[string]string) (bool, error)
ReplaceConfiguration replaces an existing configuration
func UpdateConfiguration ¶
func UpdateConfiguration(ctx context.Context, cluster *kubernetes.Cluster, configuration *Configuration, changes models.ConfigurationUpdateRequest) error
UpdateConfiguration modifies an existing configuration as per the instructions and writes the result back to the resource.
Types ¶
type Configuration ¶
type Configuration struct { Name string Namespace string Username string // contains filtered or unexported fields }
Configuration contains the information needed for Epinio to address a specific configuration.
func CreateConfiguration ¶
func CreateConfiguration(ctx context.Context, cluster *kubernetes.Cluster, name, namespace, username string, data map[string]string) (*Configuration, error)
CreateConfiguration creates a new configuration instance from namespace, name, and a map of parameters.
func Lookup ¶
func Lookup(ctx context.Context, kubeClient *kubernetes.Cluster, namespace, configuration string) (*Configuration, error)
Lookup locates a Configuration by namespace and name. It finds the Configuration instance by looking for the relevant Secret.
func (*Configuration) Delete ¶
func (s *Configuration) Delete(ctx context.Context) error
Delete destroys the configuration instance, i.e. its underlying secret holding the instance's parameters
func (*Configuration) Details ¶
Details returns the configuration instance's configuration. I.e. the parameter data.
func (*Configuration) User ¶
func (s *Configuration) User() string
User returns the configuration's username
type ConfigurationList ¶
type ConfigurationList []*Configuration
func List ¶
func List(ctx context.Context, cluster *kubernetes.Cluster, namespace string) (ConfigurationList, error)
List returns a ConfigurationList of all available Configurations in the specified namespace. If no namespace is specified (empty string) then configurations across all namespaces are returned.