v2alpha1

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

+k8s:deepcopy-gen=package +kubebuilder:object:generate=true +groupName=kyverno.io

Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// GlobalContextEntryReasonSucceeded is the reason set when the globalcontextentry is ready
	GlobalContextEntryReasonSucceeded = "Succeeded"
	// GlobalContextEntryReasonFailed is the reason set when the globalcontextentry is not ready
	GlobalContextEntryReasonFailed = "Failed"
)
View Source
const (
	// PolicyConditionReady means that the globalcontextentry is ready
	GlobalContextEntryConditionReady = "Ready"
)
View Source
const GroupName = "kyverno.io"

GroupName specifies the group name used to register the objects.

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Depreciated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v2alpha1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v2alpha1"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func RegisterDefaults added in v1.10.5

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func ValidateContext added in v1.10.5

func ValidateContext(path *field.Path, context []kyvernov1.ContextEntry) (errs field.ErrorList)

func ValidateSchedule

func ValidateSchedule(path *field.Path, schedule string) (errs field.ErrorList)

ValidateSchedule validates whether the schedule specified is in proper cron format or not.

Types

type CleanupPolicy

type CleanupPolicy kyvernov2beta1.CleanupPolicy

CleanupPolicy defines a rule for resource cleanup.

func (*CleanupPolicy) DeepCopy

func (in *CleanupPolicy) DeepCopy() *CleanupPolicy

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

func (*CleanupPolicy) DeepCopyInto

func (in *CleanupPolicy) DeepCopyInto(out *CleanupPolicy)

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

func (*CleanupPolicy) DeepCopyObject

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

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

func (*CleanupPolicy) GetAPIVersion

func (p *CleanupPolicy) GetAPIVersion() string

GetAPIVersion returns the resource kind

func (*CleanupPolicy) GetExecutionTime added in v1.10.5

func (p *CleanupPolicy) GetExecutionTime() (*time.Time, error)

GetExecutionTime returns the execution time of the policy

func (*CleanupPolicy) GetKind

func (p *CleanupPolicy) GetKind() string

GetKind returns the resource kind

func (*CleanupPolicy) GetNextExecutionTime added in v1.10.5

func (p *CleanupPolicy) GetNextExecutionTime(time time.Time) (*time.Time, error)

GetNextExecutionTime returns the next execution time of the policy

func (*CleanupPolicy) GetSpec

func (p *CleanupPolicy) GetSpec() *CleanupPolicySpec

GetSpec returns the policy spec

func (*CleanupPolicy) GetStatus

func (p *CleanupPolicy) GetStatus() *CleanupPolicyStatus

GetStatus returns the policy status

func (*CleanupPolicy) IsNamespaced added in v1.10.5

func (p *CleanupPolicy) IsNamespaced() bool

IsNamespaced indicates if the policy is namespace scoped

func (*CleanupPolicy) Validate

func (p *CleanupPolicy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList)

Validate implements programmatic validation

type CleanupPolicyInterface

type CleanupPolicyInterface interface {
	metav1.Object
	IsNamespaced() bool
	GetSpec() *CleanupPolicySpec
	GetStatus() *CleanupPolicyStatus
	GetExecutionTime() (*time.Time, error)
	GetNextExecutionTime(time.Time) (*time.Time, error)
	Validate(sets.Set[string]) field.ErrorList
	GetKind() string
	GetAPIVersion() string
}

CleanupPolicyInterface abstracts the concrete policy type (CleanupPolicy vs ClusterCleanupPolicy) +kubebuilder:object:generate=false

type CleanupPolicyList

type CleanupPolicyList kyvernov2beta1.CleanupPolicyList

CleanupPolicyList is a list of ClusterPolicy instances.

func (*CleanupPolicyList) DeepCopy

func (in *CleanupPolicyList) DeepCopy() *CleanupPolicyList

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

func (*CleanupPolicyList) DeepCopyInto

func (in *CleanupPolicyList) DeepCopyInto(out *CleanupPolicyList)

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

func (*CleanupPolicyList) DeepCopyObject

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

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

type CleanupPolicySpec

type CleanupPolicySpec = kyvernov2beta1.CleanupPolicySpec

CleanupPolicySpec stores specifications for selecting resources that the user needs to delete and schedule when the matching resources needs deleted.

type CleanupPolicyStatus

type CleanupPolicyStatus = kyvernov2beta1.CleanupPolicyStatus

CleanupPolicyStatus stores the status of the policy.

type ClusterCleanupPolicy

type ClusterCleanupPolicy kyvernov2beta1.ClusterCleanupPolicy

ClusterCleanupPolicy defines rule for resource cleanup.

func (*ClusterCleanupPolicy) DeepCopy

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

func (*ClusterCleanupPolicy) DeepCopyInto

func (in *ClusterCleanupPolicy) DeepCopyInto(out *ClusterCleanupPolicy)

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

func (*ClusterCleanupPolicy) DeepCopyObject

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

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

func (*ClusterCleanupPolicy) GetAPIVersion

func (p *ClusterCleanupPolicy) GetAPIVersion() string

GetAPIVersion returns the resource kind

func (*ClusterCleanupPolicy) GetExecutionTime added in v1.10.5

func (p *ClusterCleanupPolicy) GetExecutionTime() (*time.Time, error)

GetExecutionTime returns the execution time of the policy

func (*ClusterCleanupPolicy) GetKind

func (p *ClusterCleanupPolicy) GetKind() string

GetKind returns the resource kind

func (*ClusterCleanupPolicy) GetNextExecutionTime added in v1.10.5

func (p *ClusterCleanupPolicy) GetNextExecutionTime(time time.Time) (*time.Time, error)

GetNextExecutionTime returns the next execution time of the policy

func (*ClusterCleanupPolicy) GetSpec

GetSpec returns the policy spec

func (*ClusterCleanupPolicy) GetStatus

func (p *ClusterCleanupPolicy) GetStatus() *CleanupPolicyStatus

GetStatus returns the policy status

func (*ClusterCleanupPolicy) IsNamespaced added in v1.10.5

func (p *ClusterCleanupPolicy) IsNamespaced() bool

IsNamespaced indicates if the policy is namespace scoped

func (*ClusterCleanupPolicy) Validate

func (p *ClusterCleanupPolicy) Validate(clusterResources sets.Set[string]) (errs field.ErrorList)

Validate implements programmatic validation

type ClusterCleanupPolicyList

type ClusterCleanupPolicyList kyvernov2beta1.ClusterCleanupPolicyList

ClusterCleanupPolicyList is a list of ClusterCleanupPolicy instances.

func (*ClusterCleanupPolicyList) DeepCopy

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

func (*ClusterCleanupPolicyList) DeepCopyInto

func (in *ClusterCleanupPolicyList) DeepCopyInto(out *ClusterCleanupPolicyList)

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

func (*ClusterCleanupPolicyList) DeepCopyObject

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

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

type Exception

type Exception = kyvernov2beta1.Exception

Exception stores infos about a policy and rules

type ExternalAPICall added in v1.12.0

type ExternalAPICall struct {
	kyvernov1.APICall `json:",inline,omitempty"`
	// RefreshInterval defines the interval in duration at which to poll the APICall.
	// The duration is a sequence of decimal numbers, each with optional fraction and a unit suffix,
	// such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
	// +kubebuilder:validation:Format=duration
	// +kubebuilder:default=`10m`
	RefreshInterval *metav1.Duration `json:"refreshInterval,omitempty"`
}

func (*ExternalAPICall) DeepCopy added in v1.12.0

func (in *ExternalAPICall) DeepCopy() *ExternalAPICall

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

func (*ExternalAPICall) DeepCopyInto added in v1.12.0

func (in *ExternalAPICall) DeepCopyInto(out *ExternalAPICall)

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

func (*ExternalAPICall) Validate added in v1.12.0

func (e *ExternalAPICall) Validate(path *field.Path) (errs field.ErrorList)

Validate implements programmatic validation

type GlobalContextEntry added in v1.12.0

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

	// Spec declares policy exception behaviors.
	Spec GlobalContextEntrySpec `json:"spec" yaml:"spec"`

	// Status contains globalcontextentry runtime data.
	// +optional
	Status GlobalContextEntryStatus `json:"status,omitempty"`
}

GlobalContextEntry declares resources to be cached.

func (*GlobalContextEntry) DeepCopy added in v1.12.0

func (in *GlobalContextEntry) DeepCopy() *GlobalContextEntry

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

func (*GlobalContextEntry) DeepCopyInto added in v1.12.0

func (in *GlobalContextEntry) DeepCopyInto(out *GlobalContextEntry)

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

func (*GlobalContextEntry) DeepCopyObject added in v1.12.0

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

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

func (*GlobalContextEntry) GetStatus added in v1.12.0

GetStatus returns the globalcontextentry status

func (*GlobalContextEntry) IsNamespaced added in v1.12.0

func (c *GlobalContextEntry) IsNamespaced() bool

IsNamespaced indicates if the policy is namespace scoped

func (*GlobalContextEntry) Validate added in v1.12.0

func (c *GlobalContextEntry) Validate() (errs field.ErrorList)

Validate implements programmatic validation

type GlobalContextEntryList added in v1.12.0

type GlobalContextEntryList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []GlobalContextEntry `json:"items"`
}

GlobalContextEntryList is a list of Cached Context Entries

func (*GlobalContextEntryList) DeepCopy added in v1.12.0

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

func (*GlobalContextEntryList) DeepCopyInto added in v1.12.0

func (in *GlobalContextEntryList) DeepCopyInto(out *GlobalContextEntryList)

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

func (*GlobalContextEntryList) DeepCopyObject added in v1.12.0

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

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

type GlobalContextEntrySpec added in v1.12.0

type GlobalContextEntrySpec struct {
	// Stores a list of Kubernetes resources which will be cached.
	// Mutually exclusive with APICall.
	// +kubebuilder:validation:Optional
	KubernetesResource *KubernetesResource `json:"kubernetesResource,omitempty"`

	// Stores results from an API call which will be cached.
	// Mutually exclusive with KubernetesResource.
	// This can be used to make calls to external (non-Kubernetes API server) services.
	// It can also be used to make calls to the Kubernetes API server in such cases:
	// 1. A POST is needed to create a resource.
	// 2. Finer-grained control is needed. Example: To restrict the number of resources cached.
	// +kubebuilder:validation:Optional
	APICall *ExternalAPICall `json:"apiCall,omitempty"`
}

GlobalContextEntrySpec stores policy exception spec

func (*GlobalContextEntrySpec) DeepCopy added in v1.12.0

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

func (*GlobalContextEntrySpec) DeepCopyInto added in v1.12.0

func (in *GlobalContextEntrySpec) DeepCopyInto(out *GlobalContextEntrySpec)

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

func (*GlobalContextEntrySpec) IsAPICall added in v1.12.0

func (c *GlobalContextEntrySpec) IsAPICall() bool

func (*GlobalContextEntrySpec) IsResource added in v1.12.0

func (c *GlobalContextEntrySpec) IsResource() bool

func (*GlobalContextEntrySpec) Validate added in v1.12.0

func (c *GlobalContextEntrySpec) Validate(path *field.Path) (errs field.ErrorList)

Validate implements programmatic validation

type GlobalContextEntryStatus added in v1.12.0

type GlobalContextEntryStatus struct {
	// Deprecated in favor of Conditions
	Ready bool `json:"ready" yaml:"ready"`
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// Indicates the time when the globalcontextentry was last refreshed successfully for the API Call
	// +optional
	LastRefreshTime metav1.Time `json:"lastRefreshTime,omitempty"`
}

func (*GlobalContextEntryStatus) DeepCopy added in v1.12.0

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

func (*GlobalContextEntryStatus) DeepCopyInto added in v1.12.0

func (in *GlobalContextEntryStatus) DeepCopyInto(out *GlobalContextEntryStatus)

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

func (*GlobalContextEntryStatus) IsReady added in v1.12.0

func (status *GlobalContextEntryStatus) IsReady() bool

IsReady indicates if the globalcontextentry has loaded

func (*GlobalContextEntryStatus) SetReady added in v1.12.0

func (status *GlobalContextEntryStatus) SetReady(ready bool, message string)

func (*GlobalContextEntryStatus) UpdateRefreshTime added in v1.12.0

func (status *GlobalContextEntryStatus) UpdateRefreshTime()

type KubernetesResource added in v1.12.0

type KubernetesResource struct {
	// Group defines the group of the resource.
	// +kubebuilder:validation:Required
	Group string `json:"group,omitempty"`
	// Version defines the version of the resource.
	// +kubebuilder:validation:Required
	Version string `json:"version,omitempty"`
	// Resource defines the type of the resource.
	// Requires the pluralized form of the resource kind in lowercase. (Ex., "deployments")
	// +kubebuilder:validation:Required
	Resource string `json:"resource,omitempty"`
	// Namespace defines the namespace of the resource. Leave empty for cluster scoped resources.
	// If left empty for namespaced resources, all resources from all namespaces will be cached.
	// +kubebuilder:validation:Optional
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

KubernetesResource stores infos about kubernetes resource that should be cached

func (*KubernetesResource) DeepCopy added in v1.12.0

func (in *KubernetesResource) DeepCopy() *KubernetesResource

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

func (*KubernetesResource) DeepCopyInto added in v1.12.0

func (in *KubernetesResource) DeepCopyInto(out *KubernetesResource)

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

func (*KubernetesResource) Validate added in v1.12.0

func (k *KubernetesResource) Validate(path *field.Path) (errs field.ErrorList)

Validate implements programmatic validation

type PolicyException

type PolicyException kyvernov2beta1.PolicyException

PolicyException declares resources to be excluded from specified policies.

func (*PolicyException) Contains

func (p *PolicyException) Contains(policy string, rule string) bool

Contains returns true if it contains an exception for the given policy/rule pair

func (*PolicyException) DeepCopy

func (in *PolicyException) DeepCopy() *PolicyException

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

func (*PolicyException) DeepCopyInto

func (in *PolicyException) DeepCopyInto(out *PolicyException)

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

func (*PolicyException) DeepCopyObject

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

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

func (*PolicyException) GetKind added in v1.12.0

func (p *PolicyException) GetKind() string

func (*PolicyException) Validate

func (p *PolicyException) Validate() (errs field.ErrorList)

Validate implements programmatic validation

type PolicyExceptionList

type PolicyExceptionList kyvernov2beta1.PolicyExceptionList

PolicyExceptionList is a list of Policy Exceptions

func (*PolicyExceptionList) DeepCopy

func (in *PolicyExceptionList) DeepCopy() *PolicyExceptionList

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

func (*PolicyExceptionList) DeepCopyInto

func (in *PolicyExceptionList) DeepCopyInto(out *PolicyExceptionList)

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

func (*PolicyExceptionList) DeepCopyObject

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

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

Jump to

Keyboard shortcuts

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