v1beta1

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the policy v1beta1 API group +kubebuilder:object:generate=true +groupName=policy.open-cluster-management.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "policy.open-cluster-management.io", Version: "v1beta1"}

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

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type OperatorPolicy

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

	Spec   OperatorPolicySpec   `json:"spec,omitempty"`
	Status OperatorPolicyStatus `json:"status,omitempty"`
}

OperatorPolicy is the Schema for the operatorpolicies API

func (*OperatorPolicy) DeepCopy

func (in *OperatorPolicy) DeepCopy() *OperatorPolicy

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

func (*OperatorPolicy) DeepCopyInto

func (in *OperatorPolicy) DeepCopyInto(out *OperatorPolicy)

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

func (*OperatorPolicy) DeepCopyObject

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

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

type OperatorPolicyList

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

OperatorPolicyList contains a list of OperatorPolicy

func (*OperatorPolicyList) DeepCopy

func (in *OperatorPolicyList) DeepCopy() *OperatorPolicyList

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

func (*OperatorPolicyList) DeepCopyInto

func (in *OperatorPolicyList) DeepCopyInto(out *OperatorPolicyList)

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

func (*OperatorPolicyList) DeepCopyObject

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

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

type OperatorPolicySpec

type OperatorPolicySpec struct {
	Severity          policyv1.Severity          `json:"severity,omitempty"`          // low, medium, high
	RemediationAction policyv1.RemediationAction `json:"remediationAction,omitempty"` // inform, enforce
	ComplianceType    policyv1.ComplianceType    `json:"complianceType"`              // musthave

	// Include the name, namespace, and any `spec` fields for the OperatorGroup.
	// For more info, see `kubectl explain operatorgroup.spec` or
	// https://olm.operatorframework.io/docs/concepts/crds/operatorgroup/
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	OperatorGroup *runtime.RawExtension `json:"operatorGroup,omitempty"`

	// Include the namespace, and any `spec` fields for the Subscription.
	// For more info, see `kubectl explain subscription.spec` or
	// https://olm.operatorframework.io/docs/concepts/crds/subscription/
	// +kubebuilder:validation:Required
	// +kubebuilder:pruning:PreserveUnknownFields
	Subscription runtime.RawExtension `json:"subscription"`

	// Versions is a list of nonempty strings that specifies which installed versions are compliant when
	// in 'inform' mode, and which installPlans are approved when in 'enforce' mode
	Versions []policyv1.NonEmptyString `json:"versions,omitempty"`
}

OperatorPolicySpec defines the desired state of OperatorPolicy

func (*OperatorPolicySpec) DeepCopy

func (in *OperatorPolicySpec) DeepCopy() *OperatorPolicySpec

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

func (*OperatorPolicySpec) DeepCopyInto

func (in *OperatorPolicySpec) DeepCopyInto(out *OperatorPolicySpec)

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

type OperatorPolicyStatus

type OperatorPolicyStatus struct {
	// Most recent compliance state of the policy
	ComplianceState policyv1.ComplianceState `json:"compliant,omitempty"`
	// Historic details on the condition of the policy
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// List of resources processed by the policy
	// +optional
	RelatedObjects []policyv1.RelatedObject `json:"relatedObjects"`
}

OperatorPolicyStatus defines the observed state of OperatorPolicy

func (*OperatorPolicyStatus) DeepCopy

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

func (*OperatorPolicyStatus) DeepCopyInto

func (in *OperatorPolicyStatus) DeepCopyInto(out *OperatorPolicyStatus)

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

func (OperatorPolicyStatus) GetCondition added in v0.13.0

func (status OperatorPolicyStatus) GetCondition(condType string) (int, metav1.Condition)

Searches the conditions of the policy, and returns the index and condition matching the given condition Type. It will return -1 as the index if no condition of the specified Type is found.

func (OperatorPolicyStatus) RelatedObjsOfKind added in v0.13.0

func (status OperatorPolicyStatus) RelatedObjsOfKind(kind string) map[int]policyv1.RelatedObject

type RemovalAction

type RemovalAction string

RemovalAction : Keep, Delete, or DeleteIfUnused +kubebuilder:validation:Enum=Keep;Delete;DeleteIfUnused

const (
	// Keep is a RemovalBehavior indicating that the controller may not delete a type
	Keep RemovalAction = "Keep"
	// Delete is a RemovalBehavior indicating that the controller may delete a type
	Delete RemovalAction = "Delete"
	// DeleteIfUnused is a RemovalBehavior indicating that the controller may delete
	// a type only if is not being used by another subscription
	DeleteIfUnused RemovalAction = "DeleteIfUnused"
)

type RemovalBehavior

type RemovalBehavior struct {
	// Kind OperatorGroup
	OperatorGroups RemovalAction `json:"operatorGroups,omitempty"`
	// Kind Subscription
	Subscriptions RemovalAction `json:"subscriptions,omitempty"`
	// Kind ClusterServiceVersion
	CSVs RemovalAction `json:"clusterServiceVersions,omitempty"`
	// Kind InstallPlan
	InstallPlan RemovalAction `json:"installPlans,omitempty"`
	// Kind CustomResourceDefinitions
	CRDs RemovalAction `json:"customResourceDefinitions,omitempty"`
	// Kind APIServiceDefinitions
	APIServiceDefinitions RemovalAction `json:"apiServiceDefinitions,omitempty"`
}

RemovalBehavior defines resource behavior when policy is removed

func (*RemovalBehavior) DeepCopy added in v0.13.0

func (in *RemovalBehavior) DeepCopy() *RemovalBehavior

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

func (*RemovalBehavior) DeepCopyInto added in v0.13.0

func (in *RemovalBehavior) DeepCopyInto(out *RemovalBehavior)

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

type StatusConfig

type StatusConfig struct {
	CatalogSourceUnhealthy StatusConfigAction `json:"catalogSourceUnhealthy,omitempty"`
	DeploymentsUnavailable StatusConfigAction `json:"deploymentsUnavailable,omitempty"`
	UpgradesAvailable      StatusConfigAction `json:"upgradesAvailable,omitempty"`
	UpgradesProgressing    StatusConfigAction `json:"upgradesProgressing,omitempty"`
}

StatusConfig defines how resource statuses affect the OperatorPolicy status and compliance

func (*StatusConfig) DeepCopy added in v0.13.0

func (in *StatusConfig) DeepCopy() *StatusConfig

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

func (*StatusConfig) DeepCopyInto added in v0.13.0

func (in *StatusConfig) DeepCopyInto(out *StatusConfig)

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

type StatusConfigAction

type StatusConfigAction string

StatusConfigAction : StatusMessageOnly or NonCompliant +kubebuilder:validation:Enum=StatusMessageOnly;NonCompliant

const (
	// StatusMessageOnly is a StatusConfigAction that only shows the status message
	StatusMessageOnly StatusConfigAction = "StatusMessageOnly"
	// NonCompliant is a StatusConfigAction that shows the status message and sets
	// the compliance to NonCompliant
	NonCompliant StatusConfigAction = "NonCompliant"
)

Jump to

Keyboard shortcuts

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