Documentation
¶
Index ¶
- Variables
- func ClusterAuditPolicyDeletionAllowed(ctx context.Context, mgmtClient client.Client, ...) error
- func ClusterAuthenticationDeletionAllowed(ctx context.Context, mgmtClient client.Client, ...) error
- func ClusterDeployCredential(ctx context.Context, cl client.Client, systemNamespace string, ...) error
- func ClusterDeploymentDeletionAllowed(ctx context.Context, mgmtClient client.Client, cld *kcmv1.ClusterDeployment) error
- func ClusterTemplateK8sCompatibility(ctx context.Context, cl client.Client, clusterTemplate *kcmv1.ClusterTemplate, ...) error
- func ClusterTemplateProviders(ctx context.Context, mgmtClient client.Client, ...) error
- func ManagementDeletionAllowed(ctx context.Context, mgmtClient client.Client) error
- func ProvidersInUseFor(ctx context.Context, cl client.Client, pTpl *kcmv1.ProviderTemplate, ...) (map[string][]string, error)
- func RBACPolicyDeletionAllowed(ctx context.Context, mgmtClient client.Client, policy *kcmv1.RBACPolicy) error
- func RegionClusterReference(ctx context.Context, mgmtClient client.Client, systemNamespace string, ...) error
- func RegionDeletionAllowed(ctx context.Context, mgmtClient client.Client, rgn *kcmv1.Region) error
- func ServiceTemplatesK8sCompatibility(ctx context.Context, cl client.Client, in K8sCompatibilityInput) error
- func ServicesHaveValidTemplates(ctx context.Context, cl client.Client, services []kcmv1.Service, ns string) error
- func ValidateChangedProviderContracts(ctx context.Context, cl client.Client, release *kcmv1.Release, ...) (string, error)
- func ValidateClusterAuditPolicy(clPolicy *kcmv1.ClusterAuditPolicy) error
- func ValidateClusterAuthentication(ctx context.Context, mgmtClient client.Client, ...) error
- func ValidateMCSDelete(ctx context.Context, c client.Client, mcs *kcmv1.MultiClusterService) error
- func ValidateMCSDependencyOverall(ctx context.Context, c client.Client, mcs *kcmv1.MultiClusterService) error
- func ValidateProviderContracts(ctx context.Context, cl client.Client, release *kcmv1.Release, ...) (string, error)
- func ValidateRBACPolicy(policy *kcmv1.RBACPolicy) error
- func ValidateServiceDependencyOverall(services []kcmv1.Service) error
- type ClusterParent
- type ComponentsManager
- type InUseProviderParams
- type K8sCompatibilityInput
Constants ¶
This section is empty.
Variables ¶
var ErrK8sConstraintViolated = errors.New("k8s constraint violated")
ErrK8sConstraintViolated marks the one failure of ClusterTemplateK8sCompatibility that waiting cannot fix: the versions simply do not match. Everything else it returns - a template that cannot be read, a version that cannot be parsed - may well succeed on the next try, and callers have to tell the two apart.
var ErrProviderIsNotReady = errors.New("provider is not yet ready")
ErrProviderIsNotReady signals if the corresponding github.com/K0rdent/kcm/api/v1beta1.ProviderTemplate is not yet ready.
Functions ¶
func ClusterAuditPolicyDeletionAllowed ¶ added in v1.10.0
func ClusterAuthenticationDeletionAllowed ¶ added in v1.6.0
func ClusterDeployCredential ¶
func ClusterDeployCredential(ctx context.Context, cl client.Client, systemNamespace string, cd *kcmv1.ClusterDeployment, clusterTemplate *kcmv1.ClusterTemplate) error
ClusterDeployCredential validates a github.com/K0rdent/kcm/api/v1beta1.Credential object referred in the given github.com/K0rdent/kcm/api/v1beta1.ClusterDeployment is ready and supported by the given github.com/K0rdent/kcm/api/v1beta1.ClusterTemplate.
func ClusterTemplateK8sCompatibility ¶
func ClusterTemplateK8sCompatibility(ctx context.Context, cl client.Client, clusterTemplate *kcmv1.ClusterTemplate, cd *kcmv1.ClusterDeployment) error
ClusterTemplateK8sCompatibility validates the K8s version of the given github.com/K0rdent/kcm/api/v1beta1.ClusterTemplate satisfies the K8s constraints (if any) of the github.com/K0rdent/kcm/api/v1beta1.ServiceTemplate objects referenced by the given github.com/K0rdent/kcm/api/v1beta1.ClusterDeployment.
A violation is wrapped in ErrK8sConstraintViolated.
func ClusterTemplateProviders ¶
func ClusterTemplateProviders(ctx context.Context, mgmtClient client.Client, clusterTemplate *kcmv1.ClusterTemplate, cd *kcmv1.ClusterDeployment) error
ClusterTemplateProviders validates that all required providers are exposed and compatible by the parent object (either github.com/K0rdent/kcm/api/v1beta1.Management or github.com/K0rdent/kcm/api/v1beta1.Region).
func ProvidersInUseFor ¶
func ProvidersInUseFor(ctx context.Context, cl client.Client, pTpl *kcmv1.ProviderTemplate, obj ComponentsManager) (map[string][]string, error)
func RBACPolicyDeletionAllowed ¶ added in v1.12.0
func RBACPolicyDeletionAllowed(ctx context.Context, mgmtClient client.Client, policy *kcmv1.RBACPolicy) error
RBACPolicyDeletionAllowed returns an error if the given RBACPolicy is still referenced by any ClusterDeployment in its namespace, since those ClusterDeployments would be left pointing at a missing object.
func RegionClusterReference ¶
func RegionDeletionAllowed ¶
func ServiceTemplatesK8sCompatibility ¶
func ServiceTemplatesK8sCompatibility(ctx context.Context, cl client.Client, in K8sCompatibilityInput) error
ServiceTemplatesK8sCompatibility validates that the k8s constraints of the named github.com/K0rdent/kcm/api/v1beta1.ServiceTemplate objects are satisfied by the given k8s version.
A violation is wrapped in ErrK8sConstraintViolated.
func ServicesHaveValidTemplates ¶
func ServicesHaveValidTemplates(ctx context.Context, cl client.Client, services []kcmv1.Service, ns string) error
ServicesHaveValidTemplates validates the given array of github.com/K0rdent/kcm/api/v1beta1.Service checking if referenced github.com/K0rdent/kcm/api/v1beta1.ServiceTemplate is valid and is ready to be consumed.
func ValidateChangedProviderContracts ¶ added in v1.7.0
func ValidateChangedProviderContracts(ctx context.Context, cl client.Client, release *kcmv1.Release, oldObj, newObj ComponentsManager) (string, error)
ValidateChangedProviderContracts validates that all updated provider templates specified in the given github.com/K0rdent/kcm/api/v1beta1.Management or github.com/K0rdent/kcm/api/v1beta1.Region have compatible CAPI contract versions. Returns ErrProviderIsNotReady if the corresponding github.com/K0rdent/kcm/api/v1beta1.ProviderTemplate is not yet ready and the validation cannot proceed further.
func ValidateClusterAuditPolicy ¶ added in v1.10.0
func ValidateClusterAuditPolicy(clPolicy *kcmv1.ClusterAuditPolicy) error
func ValidateClusterAuthentication ¶ added in v1.6.0
func ValidateMCSDelete ¶
ValidateMCSDelete validates if it is safe to delete provided MCS.
func ValidateMCSDependencyOverall ¶
func ValidateMCSDependencyOverall(ctx context.Context, c client.Client, mcs *kcmv1.MultiClusterService) error
ValidateMCSDependencyOverall calls all of the functions related to MultiClusterService dependency validation one by one.
func ValidateProviderContracts ¶ added in v1.7.0
func ValidateProviderContracts(ctx context.Context, cl client.Client, release *kcmv1.Release, obj ComponentsManager) (string, error)
ValidateProviderContracts validates that all provider templates specified in the given github.com/K0rdent/kcm/api/v1beta1.Management or github.com/K0rdent/kcm/api/v1beta1.Region have compatible CAPI contract versions. Returns ErrProviderIsNotReady if the corresponding github.com/K0rdent/kcm/api/v1beta1.ProviderTemplate is not yet ready and the validation cannot proceed further.
func ValidateRBACPolicy ¶ added in v1.12.0
func ValidateRBACPolicy(policy *kcmv1.RBACPolicy) error
ValidateRBACPolicy performs structural validation that cannot be expressed via CRD schema (e.g. cross-field uniqueness).
func ValidateServiceDependencyOverall ¶
ValidateServiceDependencyOverall calls all of the functions related to service dependency validation one by one.
Types ¶
type ClusterParent ¶
type ClusterParent interface {
client.Object
HelmReleasePrefix() string
GetComponentsStatus() *kcmv1.ComponentsCommonStatus
}
type ComponentsManager ¶
type ComponentsManager interface {
client.Object
Components() kcmv1.ComponentsCommonSpec
}
type InUseProviderParams ¶
type InUseProviderParams struct {
// Regions maps region names to a boolean indicating whether
// this provider is in use in that region
Regions map[string]bool
// ProviderContracts is the list of supported Cluster API contract versions,
// e.g. infrastructure-aws: []{v1alpha3, v1alpha4, v1beta1}
ProviderContracts []string
}
InUseProviderParams describes in which regions this provider is currently in use and which Cluster API contract versions it supports
type K8sCompatibilityInput ¶
type K8sCompatibilityInput struct {
K8sVersion string
VersionSource string
Namespace string
Referrer string
Templates []string
}
K8sCompatibilityInput describes what is being checked against which version. The two descriptions end up in the message a user reads, so they are phrased as "the Kind ns/name".