resource

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFileToConfigmap

func ConvertFileToConfigmap(ctx context.Context, c client.Client, config *Config, namespace string, integrationName string,
	content string, rawContent []byte) (*corev1.ConfigMap, error)

ConvertFileToConfigmap convert a local file resource type in a configmap type taking care to create the Configmap on the cluster. The method will change the value of config parameter to reflect the conversion applied transparently.

func ParseFileValue

func ParseFileValue(value string) (localPath string, maybeDestinationPath string)

ParseFileValue will parse a file resource/config option to return the local path and the destination path expected.

Types

type Config

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

Config represents a config option.

func ParseConfig

func ParseConfig(item string) (*Config, error)

ParseConfig will parse a config and return a Config.

func ParseResource

func ParseResource(item string) (*Config, error)

ParseResource will parse a resource and return a Config.

func ParseVolume

func ParseVolume(item string) (*Config, error)

ParseVolume will parse a volume and return a Config.

func (*Config) ContentType

func (config *Config) ContentType() ContentType

ContentType is the type of content used for the configuration.

func (*Config) DestinationPath

func (config *Config) DestinationPath() string

DestinationPath is the location where the resource will be stored on destination.

func (*Config) Key

func (config *Config) Key() string

Key is the key specified for the resource.

func (*Config) Name

func (config *Config) Name() string

Name is the name of the resource.

func (*Config) StorageType

func (config *Config) StorageType() StorageType

StorageType is the type of storage used for the configuration.

func (*Config) String

func (config *Config) String() string

String represents the unparsed value of the resource.

type ContentType

type ContentType string

ContentType represent what kind of a content is, either data or purely text configuration.

const (
	// ContentTypeData can contain binary content, won't be parsed to look for user properties.
	ContentTypeData ContentType = "data"
	// ContentTypeText can't contain binary content, will be parsed to look for user properties.
	ContentTypeText ContentType = "text"
)

type StorageType

type StorageType string

StorageType represent a resource/config type such as configmap, secret or local file.

const (
	// StorageTypeConfigmap --.
	StorageTypeConfigmap StorageType = "configmap"
	// StorageTypeSecret --.
	StorageTypeSecret StorageType = "secret"
	// StorageTypeFile --.
	StorageTypeFile StorageType = "file"
	// StorageTypePVC --.
	StorageTypePVC StorageType = "pvc"
)

Jump to

Keyboard shortcuts

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