validators

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: UPL-1.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FluentdOCISecretConfigEntry = "config"

	// UserPrincipal is default auth type
	UserPrincipal AuthenticationType = "user_principal"
	// InstancePrincipal is used for instance principle auth type
	InstancePrincipal       AuthenticationType = "instance_principal"
	ValidateInProgressError                    = "Updates to resource not allowed while uninstall or upgrade is in progress"

	FluentdOCISecretPrivateKeyEntry = "key"
	OciDNSSecretFileName            = "oci.yaml"
	// InstancePrincipalDelegationToken is used for instance principle delegation token auth type
	InstancePrincipalDelegationToken AuthenticationType = "instance_principle_delegation_token"
	// UnknownAuthenticationType is used for none meaningful auth type
	UnknownAuthenticationType AuthenticationType = "unknown_auth_type"
)

Variables

View Source
var ValidateKubernetesVersionSupported = validateKubernetesVersionSupportedInCluster

Functions

func CheckUpgradeRequired

func CheckUpgradeRequired(statusVersion string, bomVersion *semver.SemVersion) error

checkUpgradeRequired Returns an error if the current installed version is < the BOM version; if we're validating an update, this is an error condition, as we don't want to allow any updates without an upgrade

func CleanTempFiles

func CleanTempFiles(log *zap.SugaredLogger) error

func CombineErrors

func CombineErrors(errs []error) error

combineErrors combines multiple errors into one error, nil if no error

func GetClient

func GetClient(scheme *runtime.Scheme) (client.Client, error)

getClient returns a controller runtime client for the Verrazzano resource

func GetCurrentBomVersion

func GetCurrentBomVersion() (*semver.SemVersion, error)

GetCurrentBomVersion Get the version string from the bom and return it as a semver object

func GetInstallSecret

func GetInstallSecret(client client.Client, secretName string, secret *corev1.Secret) error

func GetPlatformOperatorPodList added in v1.7.0

func GetPlatformOperatorPodList(runtimeClient client.Client) (corev1.PodList, error)

func ValidateFluentdConfigData

func ValidateFluentdConfigData(secret *corev1.Secret) error

validateFluentdConfigData - Validate the OCI config contents in the Fluentd secret

func ValidateNewVersion

func ValidateNewVersion(currStatusVerString string, currSpecVerString string, newVerString string, bomVersion *semver.SemVersion) error

func ValidatePrivateKey

func ValidatePrivateKey(secretName string, pemData []byte) error

func ValidateSecretContents

func ValidateSecretContents(secretName string, bytes []byte, target interface{}) error

func ValidateSecretKey

func ValidateSecretKey(secret *corev1.Secret, dataKey string, target interface{}) ([]byte, error)

func ValidateUpgradeRequest

func ValidateUpgradeRequest(newSpecVerString string, currStatusVerString string, currSpecVerString string) error

ValidateUpgradeRequest Ensures hat an upgrade is requested as part of an update if necessary, and that the version of an upgrade request is valid.

func ValidateVersion

func ValidateVersion(requestedVersion string) error

ValidateVersion check that requestedVersion matches BOM requestedVersion

func ValidateVersionHigherOrEqual

func ValidateVersionHigherOrEqual(currentVersion string, requestedVersion string) bool

ValidateVersionHigherOrEqual checks that currentVersion matches requestedVersion or is a higher version

func VerifyPlatformOperatorSingleton added in v1.4.7

func VerifyPlatformOperatorSingleton(runtimeClient client.Client) error

VerifyPlatformOperatorSingleton Verifies that only one instance of the VPO is running; when upgrading operators, if the terminationGracePeriod for the pod is > 0 there's a chance that an old version may try to handle resource updates before terminating. In the longer term we may want some kind of leader-election strategy to support multiple instances, if that makes sense.

Types

type AuthData

type AuthData struct {
	Region      string             `json:"region"`
	Tenancy     string             `json:"tenancy"`
	User        string             `json:"user"`
	Key         string             `json:"key"`
	Fingerprint string             `json:"fingerprint"`
	AuthType    AuthenticationType `json:"authtype"`
}

OCI DNS Secret Auth

type AuthenticationType

type AuthenticationType string

type OciAuth

type OciAuth struct {
	Auth AuthData `json:"auth"`
}

OCI DNS Secret Auth Wrapper

Jump to

Keyboard shortcuts

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