v1alpha1

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains Policy resources. +kubebuilder:object:generate=true +groupName=policy.spaces.upbound.io +versionName=v1alpha1

Index

Constants

View Source
const (
	Group   = "policy.spaces.upbound.io"
	Version = "v1alpha1"
)

Package type metadata.

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	// SharedUpboundPolicyKind is kind of SharedUpboundPolicy
	SharedUpboundPolicyKind = reflect.TypeOf(SharedUpboundPolicy{}).Name()

	// SharedUpboundPolicyGroupKind is group kind of SharedUpboundPolicy
	SharedUpboundPolicyGroupKind = schema.GroupKind{Group: Group, Kind: SharedUpboundPolicyKind}.String()

	// SharedUpboundPolicyKindAPIVersion is apiVersion and kind of SharedUpboundPolicy
	SharedUpboundPolicyKindAPIVersion = SharedUpboundPolicyKind + "." + SchemeGroupVersion.String()

	// SharedUpboundPolicyGroupVersionKind is GVK of SharedUpboundPolicy
	SharedUpboundPolicyGroupVersionKind = SchemeGroupVersion.WithKind(SharedUpboundPolicyKind)

	// SharedUpboundPolicyGroupVersionResource is GVR of SharedUpboundPolicy
	SharedUpboundPolicyGroupVersionResource = SchemeGroupVersion.WithResource("sharedupboundpolicies")
)

Functions

This section is empty.

Types

type ClusterPolicyConditionType

type ClusterPolicyConditionType string

ClusterPolicyConditionType is controlplane ClusterPolicy condition type

type ClusterPolicyStatusCondition

type ClusterPolicyStatusCondition struct {
	Type   ClusterPolicyConditionType `json:"type"`
	Status corev1.ConditionStatus     `json:"status"`

	// +optional
	Message string `json:"message,omitempty"`
}

ClusterPolicyStatusCondition is controlplane ClusterPolicy status condition

func (*ClusterPolicyStatusCondition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPolicyStatusCondition.

func (*ClusterPolicyStatusCondition) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SharedUpboundPolicy

type SharedUpboundPolicy struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   SharedUpboundPolicySpec   `json:"spec,omitempty"`
	Status SharedUpboundPolicyStatus `json:"status,omitempty"`
}

SharedUpboundPolicy specifies a shared Kyverno policy projected into the specified ControlPlanes of the same namespace as SharedUpboundPolicy. +kubebuilder:object:root=true +kubebuilder:storageversion +kubebuilder:printcolumn:name="Provisioned",type=string,JSONPath=`.metadata.annotations.sharedupboundpolicies\.internal\.spaces\.upbound\.io/provisioned-total` +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:subresource:status +kubebuilder:resource:scope=Namespaced,categories={policies},shortName=sup

func (*SharedUpboundPolicy) ControlPlaneSelector

func (c *SharedUpboundPolicy) ControlPlaneSelector() func(obj client.Object) (bool, error)

ControlPlaneSelector returns a function that can be used for checking if a given object matches the selector.

func (*SharedUpboundPolicy) DeepCopy

func (in *SharedUpboundPolicy) DeepCopy() *SharedUpboundPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedUpboundPolicy.

func (*SharedUpboundPolicy) DeepCopyInto

func (in *SharedUpboundPolicy) DeepCopyInto(out *SharedUpboundPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SharedUpboundPolicy) DeepCopyObject

func (in *SharedUpboundPolicy) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SharedUpboundPolicyList

type SharedUpboundPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SharedUpboundPolicy `json:"items"`
}

SharedUpboundPolicyList contains a list of SharedUpboundPolicy. +kubebuilder:object:root=true

func (*SharedUpboundPolicyList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedUpboundPolicyList.

func (*SharedUpboundPolicyList) DeepCopyInto

func (in *SharedUpboundPolicyList) DeepCopyInto(out *SharedUpboundPolicyList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SharedUpboundPolicyList) DeepCopyObject

func (in *SharedUpboundPolicyList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*SharedUpboundPolicyList) Objects

func (s *SharedUpboundPolicyList) Objects() []client.Object

Objects return the list of items.

type SharedUpboundPolicyProvisioningFailure

type SharedUpboundPolicyProvisioningFailure struct {
	// ControlPlane name where the failure occurred.
	ControlPlane string `json:"controlPlane"`

	// List of conditions.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

SharedUpboundPolicyProvisioningFailure defines policy provisioning failure.

func (*SharedUpboundPolicyProvisioningFailure) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedUpboundPolicyProvisioningFailure.

func (*SharedUpboundPolicyProvisioningFailure) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SharedUpboundPolicyProvisioningSuccess

type SharedUpboundPolicyProvisioningSuccess struct {
	// ControlPlane name where the external secret got successfully projected.
	ControlPlane string `json:"controlPlane"`
}

SharedUpboundPolicyProvisioningSuccess defines policy provisioning success.

func (*SharedUpboundPolicyProvisioningSuccess) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedUpboundPolicyProvisioningSuccess.

func (*SharedUpboundPolicyProvisioningSuccess) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SharedUpboundPolicySpec

type SharedUpboundPolicySpec struct {
	// PolicyName is the name to use when creating policy within a control plane.
	// optional, if not set, SharedUpboundPolicy name will be used.
	// When set, it is immutable.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="policyName is immutable"
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:MinLength=1
	// +optional
	PolicyName string `json:"policyName,omitempty"`

	// The metadata of the policy to be created.
	// +optional
	PolicyMetadata *v1alpha1.ResourceMetadata `json:"policyMetadata,omitempty"`

	// The policy is projected only to control planes
	// matching the provided selector. Either names or a labelSelector must be specified.
	// +kubebuilder:validation:XValidation:rule="(has(self.labelSelectors) || has(self.names)) && (size(self.labelSelectors) > 0 || size(self.names) > 0)",message="either names or a labelSelector must be specified"
	ControlPlaneSelector v1alpha1.ResourceSelector `json:"controlPlaneSelector"`

	// The rest of spec follows Kyverno policy spec.
	// See https://htmlpreview.github.io/?https://github.com/kyverno/kyverno/blob/main/docs/user/crd/index.html#kyverno.io/v1.Spec
	kyvernov1.Spec `json:",inline"`
}

SharedUpboundPolicySpec defines the desired state of SharedUpboundPolicy. +kubebuilder:validation:XValidation:rule="has(self.policyName) == has(oldSelf.policyName)",message="policyName is immutable"

func (*SharedUpboundPolicySpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedUpboundPolicySpec.

func (*SharedUpboundPolicySpec) DeepCopyInto

func (in *SharedUpboundPolicySpec) DeepCopyInto(out *SharedUpboundPolicySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SharedUpboundPolicyStatus

type SharedUpboundPolicyStatus struct {

	// observed resource generation.
	// +optional
	ObservedGeneration *int64 `json:"observedGeneration,omitempty"`

	// list of provisioning failures.
	// +optional
	// +listType=map
	// +listMapKey=controlPlane
	Failed []SharedUpboundPolicyProvisioningFailure `json:"failed,omitempty"`

	// List of successfully provisioned targets.
	// +optional
	// +listType=map
	// +listMapKey=controlPlane
	Provisioned []SharedUpboundPolicyProvisioningSuccess `json:"provisioned,omitempty"`
}

SharedUpboundPolicyStatus defines the observed state of the projected polcies.

func (*SharedUpboundPolicyStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedUpboundPolicyStatus.

func (*SharedUpboundPolicyStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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