crossplane

package
v0.1.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PackageTypes = []PackageType{
		Providers,
		Configurations,
		Functions,
	}

	ErrPolicyNotFound           = errors.New("policy is not installed yet")
	ErrFailedToGetPolicy        = errors.New("failed to get policy")
	ErrPolicyUnhealthy          = errors.New("policy is unhealthy")
	ErrPolicyBindingNotFound    = errors.New("policy binding is not installed yet")
	ErrFailedToGetPolicyBinding = errors.New("failed to get policy binding")
	ErrPolicyBindingUnhealthy   = errors.New("policy binding is unhealthy")
)

Functions

func AddProviderPrefix

func AddProviderPrefix(providerName string) string

func CheckIfPolicyIsInstalled

func CheckIfPolicyIsInstalled(pt PackageType) func(ctx context.Context, c client.Client) error

CheckIfPolicyIsInstalled checks if the policy and binding for the given PackageType is installed. If not, we cannot safely install or update the package and the hook will fail.

func DeploymentRuntimeNameForProviderConfig

func DeploymentRuntimeNameForProviderConfig(p *v1beta1.CrossplaneProviderConfig) string

DeploymentRuntimeNameForProviderConfig returns the name of a DeploymentRuntimeConfig manifest for a ProviderConfig. Currently the name is the same as the name of the provider.

func EmptyFromConfig

EmptyFromConfig converts a CrossplaneProviderConfig to a Crossplane Provider resource.

func GetPolicyName

func GetPolicyName(pt PackageType) string

func IsPolicyBindingHealthy

func IsPolicyBindingHealthy(binding *arv1.ValidatingAdmissionPolicyBinding) bool

func IsPolicyHealthy

func IsPolicyHealthy(policy *arv1.ValidatingAdmissionPolicy) bool

func ProviderNameForProviderConfig

func ProviderNameForProviderConfig(p *v1beta1.CrossplaneProviderConfig) string

ProviderNameForProviderConfig returns the name of a Provider crossplane manifest for a ProviderConfig. It consists of the name of the provider with a prefix.

func ReconcileDeploymentConfigRuntimeProtectionPolicy

func ReconcileDeploymentConfigRuntimeProtectionPolicy(avp *arv1.ValidatingAdmissionPolicy)

func ReconcileDeploymentConfigRuntimeProtectionPolicyBinding

func ReconcileDeploymentConfigRuntimeProtectionPolicyBinding(policyName string,
	avpd *arv1.ValidatingAdmissionPolicyBinding)

func ReconcilePolicy

func ReconcilePolicy(pt PackageType, policy *arv1.ValidatingAdmissionPolicy) error

func ReconcilePolicyBinding

func ReconcilePolicyBinding(cprName, policyName string, binding *arv1.ValidatingAdmissionPolicyBinding) error

func ReconcileProvider

func ReconcileProvider(provider *crossplanev1.Provider, config v1beta1.CrossplaneProviderConfig) error

func TrimProviderPrefix

func TrimProviderPrefix(providerName string) string

Types

type PackageType

type PackageType string
const (
	Providers      PackageType = "providers"
	Configurations PackageType = "configurations"
	Functions      PackageType = "functions"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳