utils

package
v1.69.14 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAddressFieldIsNotFound = errors.New("secret has no address field")
View Source
var ErrCAFieldIsNotFound = errors.New("secret has no ca field")
View Source
var ErrClusterIsBootstrappedFieldIsNotFound = errors.New("secret has no clusterIsBootstrapped field")
View Source
var ErrDockerConfigFieldIsNotFound = errors.New("secret has no .dockerconfigjson field")
View Source
var ErrImageRegistryFieldIsNotFound = errors.New("secret has no imagesRegistry field")
View Source
var ErrPathFieldIsNotFound = errors.New("secret has no path field")
View Source
var ErrSchemeFieldIsNotFound = errors.New("secret has no scheme field")

Functions

func EnableModule added in v1.67.0

func EnableModule(downloadedModulesDir, oldSymlinkPath, newSymlinkPath, modulePath string) error

EnableModule deletes old symlinks and creates a new one

func EnsureModuleDocumentation added in v1.67.0

func EnsureModuleDocumentation(
	ctx context.Context,
	cli client.Client,
	moduleName, moduleSource, moduleChecksum, moduleVersion, modulePath string,
	ownerRef metav1.OwnerReference,
) error

EnsureModuleDocumentation creates or updates module documentation

func GenerateRegistryOptions

func GenerateRegistryOptions(ri *RegistryConfig, logger *log.Logger) []cr.Option

func GenerateRegistryOptionsFromModuleSource added in v1.65.0

func GenerateRegistryOptionsFromModuleSource(ms *v1alpha1.ModuleSource, clusterUUID string, logger *log.Logger) []cr.Option

GenerateRegistryOptionsFromModuleSource fetches settings from ModuleSource and generate registry options from them

func GetClusterUUID added in v1.67.0

func GetClusterUUID(ctx context.Context, cli client.Client) string

GetClusterUUID gets uuid from the secret or generate a new one

func GetModuleSymlink(rootPath, moduleName string) (string, error)

GetModuleSymlink walks over the root dir to find a module symlink by regexp

func GetModuleVersion added in v1.69.0

func GetModuleVersion(moduleSymlink string) (string, error)

GetModuleVersion gets version of the module by symlink(/downloaded/modules/{moduleName})

func GetNotificationConfig added in v1.67.0

func GetNotificationConfig(ctx context.Context, cli client.Client) (releaseUpdater.NotificationConfig, error)

GetNotificationConfig gets config from discovery secret

func ModulePullOverrideExists added in v1.67.0

func ModulePullOverrideExists(ctx context.Context, cli client.Client, moduleName string) (bool, error)

ModulePullOverrideExists checks if module pull override for the module exists

func SyncModuleRegistrySpec added in v1.67.0

func SyncModuleRegistrySpec(downloadedModulesDir, moduleName, moduleVersion string, moduleSource *v1alpha1.ModuleSource) error

SyncModuleRegistrySpec compares and updates current registry settings of a deployed module (in the ./openapi/values.yaml file) and the registry settings set in the related module source

func Update added in v1.67.0

func Update[Object client.Object](ctx context.Context, cli client.Client, object Object, updater func(obj Object) bool) error

Update updates object with retryOnConflict to avoid conflict

func UpdatePolicy added in v1.67.0

func UpdatePolicy(ctx context.Context, cli client.Client, embeddedPolicy *helpers.ModuleUpdatePolicySpecContainer, moduleName string) (*v1alpha2.ModuleUpdatePolicy, error)

UpdatePolicy returns policy for the module, if no policy, embeddedPolicy is returned

func UpdateStatus added in v1.67.0

func UpdateStatus[Object client.Object](ctx context.Context, cli client.Client, object Object, updater func(obj Object) bool) error

UpdateStatus updates object status with retryOnConflict to avoid conflict

Types

type DeckhouseRegistrySecret added in v1.65.0

type DeckhouseRegistrySecret struct {
	DockerConfig          string
	Address               string
	ClusterIsBootstrapped bool
	ImageRegistry         string
	Path                  string
	Scheme                string
	CA                    string
}

func ParseDeckhouseRegistrySecret added in v1.65.0

func ParseDeckhouseRegistrySecret(data map[string][]byte) (*DeckhouseRegistrySecret, error)

type FakeLayer added in v1.60.0

type FakeLayer struct {
	v1.Layer

	FilesContent map[string]string // pair: filename - file content
}

func (FakeLayer) Size added in v1.60.0

func (fl FakeLayer) Size() (int64, error)

func (FakeLayer) Uncompressed added in v1.60.0

func (fl FakeLayer) Uncompressed() (io.ReadCloser, error)

type RegistryConfig added in v1.65.0

type RegistryConfig struct {
	DockerConfig string
	CA           string
	Scheme       string
	UserAgent    string
}

Jump to

Keyboard shortcuts

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