features

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LatestOperatorMajorVersion = "2.0.0"

	ResourceVersion             = "mongodb.com/atlas-resource-version"
	ResourceAtlasProject        = "atlasprojects"
	ResourceAtlasDeployment     = "atlasdeployments"
	ResourceAtlasDatabaseUser   = "atlasdatabaseusers"
	ResourceAtlasBackupSchedule = "atlasbackupschedules"
	ResourceAtlasBackupPolicy   = "atlasbackuppolicies"
	ResourceAtlasTeam           = "atlasteams"
	ResourceAtlasDataFederation = "atlasdatafederations"
	ResourceAtlasFederatedAuth  = "atlasfederatedauths"
)

Variables

View Source
var (
	ErrVersionNotSupportedFmt    = "version '%s' is not supported"
	ErrDownloadResourceFailedFmt = "can not download resource '%s': %v"
	ErrDocumentIsEmpty           = errors.New("document is empty")
	ErrDocumentHasNoVersions     = errors.New("document contains no versions")
	ErrDocumentHasNoSchema       = errors.New("document contains no Schema")
	ErrDocumentHasNoSpec         = errors.New("document contains no Spec")
)

Functions

func CRDCompatibleVersion

func CRDCompatibleVersion(operatorVersion string) (string, error)

func GetResourcesForVersion

func GetResourcesForVersion(version string) ([]string, bool)

func SupportedVersions

func SupportedVersions() []string

Types

type AtlasCRDs

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

func NewAtlasCRDs

func NewAtlasCRDs(crdProvider crds.AtlasOperatorCRDProvider, version string) (*AtlasCRDs, error)

func (*AtlasCRDs) FeatureExist

func (a *AtlasCRDs) FeatureExist(resourceName, featurePath string) bool

FeatureExist resourceName: one of SupportedResources featurePath: dot-separated string - path in CRD spec to check.

func (*AtlasCRDs) Patch

func (a *AtlasCRDs) Patch(obj runtime.Object) error

type FeatureValidator

type FeatureValidator interface {
	FeatureExist(resourceName, version string) bool
}

type Patcher

type Patcher interface {
	Patch(crdSpec *v1.JSONSchemaProps, obj runtime.Object) error
}

Patcher is the type that is able to patch Kubernetes objects using a CRD specification.

func NopPatcher

func NopPatcher() Patcher

NopPatcher does not patch anything.

func UnknownBackupPolicyFrequencyTypesPruner

func UnknownBackupPolicyFrequencyTypesPruner() Patcher

UnknownBackupPolicyFrequencyTypesPruner removes backup policy items from a backup policy with unknown frequency types. It inspects the CRD definition to determine supported frequency types.

type PatcherFunc

type PatcherFunc func(crdSpec *v1.JSONSchemaProps, obj runtime.Object) error

PatcherFunc is a convenience function wrapper around Patcher.

func (PatcherFunc) Patch

func (pf PatcherFunc) Patch(crdSpec *v1.JSONSchemaProps, obj runtime.Object) error

Jump to

Keyboard shortcuts

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