Help us shape the future of Go! Take the 2026 Go Developer Survey

v1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 12 Imported by: 28

Documentation

Overview

+groupName=samples.operator.openshift.io Package v1 ist he v1 version of the API.

Index

Constants

View Source
const (
	Version   = "v1"
	GroupName = "samples.operator.openshift.io"
)
View Source
const (
	// SamplesRegistryCredentials is the name for a secret that contains a username+password/token
	// for the registry, where if the secret is present, will be used for authentication.
	// The corresponding secret is required to already be formatted as a
	// dockerconfig secret so that it can just be copied
	// to the openshift namespace
	// for use during imagestream import.
	SamplesRegistryCredentials = "samples-registry-credentials"
	// ConfigName is the name/identifier of the static, singleton operator employed for the samples.
	ConfigName = "cluster"
	// X86Architecture is the value used to specify the x86_64 hardware architecture
	// in the Architectures array field.
	X86Architecture = "x86_64"
	// AMDArchitecture is the golang value for x86 64 bit hardware architecture; for the purposes
	// of this operator, it is equivalent to X86Architecture, which is kept for historical/migration
	// purposes
	AMDArchitecture = "amd64"
	// ARMArchitecture is the value used to specify the aarch64 hardware architecture
	// in the Architectures array field.
	ARMArchitecture = "arm64"
	// PPCArchitecture is the value used to specify the ppc64le hardware architecture
	// in the Architectures array field.
	PPCArchitecture = "ppc64le"
	// S390Architecture is the value used to specify the s390x hardware architecture
	// in the Architecture array field.
	S390Architecture = "s390x"
	// ConfigFinalizer is the text added to the Config.Finalizer field
	// to enable finalizer processing.
	ConfigFinalizer = GroupName + "/finalizer"
	// SamplesManagedLabel is the key for a label added to all the imagestreams and templates
	// in the openshift namespace that the Config is managing.  This label is adjusted
	// when changes to the SkippedImagestreams and SkippedTemplates fields are made.
	SamplesManagedLabel = GroupName + "/managed"
	// SamplesVersionAnnotation is the key for an annotation set on the imagestreams, templates,
	// and secret that this operator manages that signifies the version of the operator that
	// last managed the particular resource.
	SamplesVersionAnnotation = GroupName + "/version"
	// SamplesRecreateCredentialAnnotation is the key for an annotation set on the secret used
	// for authentication when configuration moves from Removed to Managed but the associated secret
	// in the openshift namespace does not exist.  This will initiate creation of the credential
	// in the openshift namespace.
	SamplesRecreateCredentialAnnotation = GroupName + "/recreate"
	// OperatorNamespace is the namespace the operator runs in.
	OperatorNamespace = "openshift-cluster-samples-operator"
)

Variables

View Source
var (
	ErrInvalidLengthGenerated        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenerated          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	GroupVersion  = schema.GroupVersion{Group: GroupName, Version: Version}
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// Install is a function which adds this version to a scheme
	Install = SchemeBuilder.AddToScheme

	// SchemeGroupVersion generated code relies on this name
	// Deprecated
	SchemeGroupVersion = GroupVersion
	// AddToScheme exists solely to keep the old generators creating valid code
	// DEPRECATED
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Config

type Config struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is the standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`

	// +kubebuilder:validation:Required
	// +required
	Spec ConfigSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
	// +optional
	Status ConfigStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

Config contains the configuration and detailed condition status for the Samples Operator.

Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +openshift:compatibility-gen:level=1

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

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

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

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

func (*Config) DeepCopyObject

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

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

func (*Config) Descriptor

func (*Config) Descriptor() ([]byte, []int)

func (*Config) Marshal

func (m *Config) Marshal() (dAtA []byte, err error)

func (*Config) MarshalTo

func (m *Config) MarshalTo(dAtA []byte) (int, error)

func (*Config) MarshalToSizedBuffer

func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) Size

func (m *Config) Size() (n int)

func (*Config) String

func (this *Config) String() string

func (Config) SwaggerDoc

func (Config) SwaggerDoc() map[string]string

func (*Config) Unmarshal

func (m *Config) Unmarshal(dAtA []byte) error

func (*Config) XXX_DiscardUnknown

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal

func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Config) XXX_Merge

func (m *Config) XXX_Merge(src proto.Message)

func (*Config) XXX_Size

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal

func (m *Config) XXX_Unmarshal(b []byte) error

type ConfigCondition

type ConfigCondition struct {
	// type of condition.
	Type ConfigConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ConfigConditionType"`
	// status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
	// lastUpdateTime is the last time this condition was updated.
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,3,opt,name=lastUpdateTime"`
	// lastTransitionTime is the last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
	// reason is what caused the condition's last transition.
	Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
	// message is a human readable message indicating details about the transition.
	Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
}

ConfigCondition captures various conditions of the Config as entries are processed.

func (*ConfigCondition) DeepCopy

func (in *ConfigCondition) DeepCopy() *ConfigCondition

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

func (*ConfigCondition) DeepCopyInto

func (in *ConfigCondition) DeepCopyInto(out *ConfigCondition)

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

func (*ConfigCondition) Descriptor

func (*ConfigCondition) Descriptor() ([]byte, []int)

func (*ConfigCondition) Marshal

func (m *ConfigCondition) Marshal() (dAtA []byte, err error)

func (*ConfigCondition) MarshalTo

func (m *ConfigCondition) MarshalTo(dAtA []byte) (int, error)

func (*ConfigCondition) MarshalToSizedBuffer

func (m *ConfigCondition) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigCondition) ProtoMessage

func (*ConfigCondition) ProtoMessage()

func (*ConfigCondition) Reset

func (m *ConfigCondition) Reset()

func (*ConfigCondition) Size

func (m *ConfigCondition) Size() (n int)

func (*ConfigCondition) String

func (this *ConfigCondition) String() string

func (ConfigCondition) SwaggerDoc

func (ConfigCondition) SwaggerDoc() map[string]string

func (*ConfigCondition) Unmarshal

func (m *ConfigCondition) Unmarshal(dAtA []byte) error

func (*ConfigCondition) XXX_DiscardUnknown

func (m *ConfigCondition) XXX_DiscardUnknown()

func (*ConfigCondition) XXX_Marshal

func (m *ConfigCondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigCondition) XXX_Merge

func (m *ConfigCondition) XXX_Merge(src proto.Message)

func (*ConfigCondition) XXX_Size

func (m *ConfigCondition) XXX_Size() int

func (*ConfigCondition) XXX_Unmarshal

func (m *ConfigCondition) XXX_Unmarshal(b []byte) error

type ConfigConditionType

type ConfigConditionType string
const (
	// ImportCredentialsExist represents the state of any credentials specified by
	// the SamplesRegistry field in the Spec.
	ImportCredentialsExist ConfigConditionType = "ImportCredentialsExist"
	// SamplesExist represents whether an incoming Config has been successfully
	// processed or not all, or whether the last Config to come in has been
	// successfully processed.
	SamplesExist ConfigConditionType = "SamplesExist"
	// ConfigurationValid represents whether the latest Config to come in
	// tried to make a support configuration change.  Currently, changes to the
	// InstallType and Architectures list after initial processing is not allowed.
	ConfigurationValid ConfigConditionType = "ConfigurationValid"
	// ImageChangesInProgress represents the state between where the samples operator has
	// started updating the imagestreams and when the spec and status generations for each
	// tag match.  The list of imagestreams that are still in progress will be stored
	// in the Reason field of the condition.  The Reason field being empty corresponds
	// with this condition being marked true.
	ImageChangesInProgress ConfigConditionType = "ImageChangesInProgress"
	// RemovePending represents whether the Config Spec ManagementState
	// has been set to Removed, but we have not completed the deletion of the
	// samples, pull secret, etc. and set the Config Spec ManagementState to Removed.
	// Also note, while a samples creation/update cycle is still in progress, and ImageChagesInProgress
	// is True, the operator will not initiate the deletions, as we
	// do not want the create/updates and deletes of the samples to be occurring in parallel.
	// So the actual Removed processing will be initated only after ImageChangesInProgress is set
	// to false.  Once the deletions are done, and the Status ManagementState is Removed, this
	// condition is set back to False.  Lastly, when this condition is set to True, the
	// ClusterOperator Progressing condition will be set to True.
	RemovePending ConfigConditionType = "RemovePending"
	// MigrationInProgress represents the special case where the operator is running off of
	// a new version of its image, and samples are deployed of a previous version.  This condition
	// facilitates the maintenance of this operator's ClusterOperator object.
	MigrationInProgress ConfigConditionType = "MigrationInProgress"
	// ImportImageErrorsExist registers any image import failures, separate from ImageChangeInProgress,
	// so that we can a) indicate a problem to the ClusterOperator status, b) mark the current
	// change cycle as complete in both ClusterOperator and Config; retry on import will
	// occur by the next relist interval if it was an intermittent issue;
	ImportImageErrorsExist ConfigConditionType = "ImportImageErrorsExist"
)

type ConfigList

type ConfigList struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is the standard list's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ListMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
	Items           []Config `json:"items" protobuf:"bytes,2,rep,name=items"`
}

Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). +openshift:compatibility-gen:level=1

func (*ConfigList) DeepCopy

func (in *ConfigList) DeepCopy() *ConfigList

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

func (*ConfigList) DeepCopyInto

func (in *ConfigList) DeepCopyInto(out *ConfigList)

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

func (*ConfigList) DeepCopyObject

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

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

func (*ConfigList) Descriptor

func (*ConfigList) Descriptor() ([]byte, []int)

func (*ConfigList) Marshal

func (m *ConfigList) Marshal() (dAtA []byte, err error)

func (*ConfigList) MarshalTo

func (m *ConfigList) MarshalTo(dAtA []byte) (int, error)

func (*ConfigList) MarshalToSizedBuffer

func (m *ConfigList) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigList) ProtoMessage

func (*ConfigList) ProtoMessage()

func (*ConfigList) Reset

func (m *ConfigList) Reset()

func (*ConfigList) Size

func (m *ConfigList) Size() (n int)

func (*ConfigList) String

func (this *ConfigList) String() string

func (ConfigList) SwaggerDoc

func (ConfigList) SwaggerDoc() map[string]string

func (*ConfigList) Unmarshal

func (m *ConfigList) Unmarshal(dAtA []byte) error

func (*ConfigList) XXX_DiscardUnknown

func (m *ConfigList) XXX_DiscardUnknown()

func (*ConfigList) XXX_Marshal

func (m *ConfigList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigList) XXX_Merge

func (m *ConfigList) XXX_Merge(src proto.Message)

func (*ConfigList) XXX_Size

func (m *ConfigList) XXX_Size() int

func (*ConfigList) XXX_Unmarshal

func (m *ConfigList) XXX_Unmarshal(b []byte) error

type ConfigSpec

type ConfigSpec struct {
	// managementState is top level on/off type of switch for all operators.
	// When "Managed", this operator processes config and manipulates the samples accordingly.
	// When "Unmanaged", this operator ignores any updates to the resources it watches.
	// When "Removed", it reacts that same wasy as it does if the Config object
	// is deleted, meaning any ImageStreams or Templates it manages (i.e. it honors the skipped
	// lists) and the registry secret are deleted, along with the ConfigMap in the operator's
	// namespace that represents the last config used to manipulate the samples,
	ManagementState operatorv1.ManagementState `json:"managementState,omitempty" protobuf:"bytes,1,opt,name=managementState"`

	// samplesRegistry allows for the specification of which registry is accessed
	// by the ImageStreams for their image content.  Defaults on the content in https://github.com/openshift/library
	// that are pulled into this github repository, but based on our pulling only ocp content it typically
	// defaults to registry.redhat.io.
	SamplesRegistry string `json:"samplesRegistry,omitempty" protobuf:"bytes,2,opt,name=samplesRegistry"`

	// architectures determine which hardware architecture(s) to install, where x86_64, ppc64le, and s390x are the only
	// supported choices currently.
	Architectures []string `json:"architectures,omitempty" protobuf:"bytes,4,opt,name=architectures"`

	// skippedImagestreams specifies names of image streams that should NOT be
	// created/updated.  Admins can use this to allow them to delete content
	// they don’t want.  They will still have to manually delete the
	// content but the operator will not recreate(or update) anything
	// listed here.
	SkippedImagestreams []string `json:"skippedImagestreams,omitempty" protobuf:"bytes,5,opt,name=skippedImagestreams"`

	// skippedTemplates specifies names of templates that should NOT be
	// created/updated.  Admins can use this to allow them to delete content
	// they don’t want.  They will still have to manually delete the
	// content but the operator will not recreate(or update) anything
	// listed here.
	SkippedTemplates []string `json:"skippedTemplates,omitempty" protobuf:"bytes,6,opt,name=skippedTemplates"`
}

ConfigSpec contains the desired configuration and state for the Samples Operator, controlling various behavior around the imagestreams and templates it creates/updates in the openshift namespace.

func (*ConfigSpec) DeepCopy

func (in *ConfigSpec) DeepCopy() *ConfigSpec

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

func (*ConfigSpec) DeepCopyInto

func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec)

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

func (*ConfigSpec) Descriptor

func (*ConfigSpec) Descriptor() ([]byte, []int)

func (*ConfigSpec) Marshal

func (m *ConfigSpec) Marshal() (dAtA []byte, err error)

func (*ConfigSpec) MarshalTo

func (m *ConfigSpec) MarshalTo(dAtA []byte) (int, error)

func (*ConfigSpec) MarshalToSizedBuffer

func (m *ConfigSpec) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigSpec) ProtoMessage

func (*ConfigSpec) ProtoMessage()

func (*ConfigSpec) Reset

func (m *ConfigSpec) Reset()

func (*ConfigSpec) Size

func (m *ConfigSpec) Size() (n int)

func (*ConfigSpec) String

func (this *ConfigSpec) String() string

func (ConfigSpec) SwaggerDoc

func (ConfigSpec) SwaggerDoc() map[string]string

func (*ConfigSpec) Unmarshal

func (m *ConfigSpec) Unmarshal(dAtA []byte) error

func (*ConfigSpec) XXX_DiscardUnknown

func (m *ConfigSpec) XXX_DiscardUnknown()

func (*ConfigSpec) XXX_Marshal

func (m *ConfigSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigSpec) XXX_Merge

func (m *ConfigSpec) XXX_Merge(src proto.Message)

func (*ConfigSpec) XXX_Size

func (m *ConfigSpec) XXX_Size() int

func (*ConfigSpec) XXX_Unmarshal

func (m *ConfigSpec) XXX_Unmarshal(b []byte) error

type ConfigStatus

type ConfigStatus struct {
	// managementState reflects the current operational status of the on/off switch for
	// the operator.  This operator compares the ManagementState as part of determining that we are turning
	// the operator back on (i.e. "Managed") when it was previously "Unmanaged".
	// +patchMergeKey=type
	// +patchStrategy=merge
	ManagementState operatorv1.ManagementState `json:"managementState,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=managementState"`
	// conditions represents the available maintenance status of the sample
	// imagestreams and templates.
	// +patchMergeKey=type
	// +patchStrategy=merge
	Conditions []ConfigCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"`

	// samplesRegistry allows for the specification of which registry is accessed
	// by the ImageStreams for their image content.  Defaults on the content in https://github.com/openshift/library
	// that are pulled into this github repository, but based on our pulling only ocp content it typically
	// defaults to registry.redhat.io.
	// +patchMergeKey=type
	// +patchStrategy=merge
	SamplesRegistry string `json:"samplesRegistry,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,3,rep,name=samplesRegistry"`

	// architectures determine which hardware architecture(s) to install, where x86_64 and ppc64le are the
	// supported choices.
	// +patchMergeKey=type
	// +patchStrategy=merge
	Architectures []string `json:"architectures,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,5,rep,name=architectures"`

	// skippedImagestreams specifies names of image streams that should NOT be
	// created/updated.  Admins can use this to allow them to delete content
	// they don’t want.  They will still have to manually delete the
	// content but the operator will not recreate(or update) anything
	// listed here.
	// +patchMergeKey=type
	// +patchStrategy=merge
	SkippedImagestreams []string `` /* 127-byte string literal not displayed */

	// skippedTemplates specifies names of templates that should NOT be
	// created/updated.  Admins can use this to allow them to delete content
	// they don’t want.  They will still have to manually delete the
	// content but the operator will not recreate(or update) anything
	// listed here.
	// +patchMergeKey=type
	// +patchStrategy=merge
	SkippedTemplates []string `json:"skippedTemplates,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,7,rep,name=skippedTemplates"`

	// version is the value of the operator's payload based version indicator when it was last successfully processed
	// +patchMergeKey=type
	// +patchStrategy=merge
	Version string `json:"version,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,8,rep,name=version"`
}

ConfigStatus contains the actual configuration in effect, as well as various details that describe the state of the Samples Operator.

func (*ConfigStatus) DeepCopy

func (in *ConfigStatus) DeepCopy() *ConfigStatus

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

func (*ConfigStatus) DeepCopyInto

func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus)

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

func (*ConfigStatus) Descriptor

func (*ConfigStatus) Descriptor() ([]byte, []int)

func (*ConfigStatus) Marshal

func (m *ConfigStatus) Marshal() (dAtA []byte, err error)

func (*ConfigStatus) MarshalTo

func (m *ConfigStatus) MarshalTo(dAtA []byte) (int, error)

func (*ConfigStatus) MarshalToSizedBuffer

func (m *ConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigStatus) ProtoMessage

func (*ConfigStatus) ProtoMessage()

func (*ConfigStatus) Reset

func (m *ConfigStatus) Reset()

func (*ConfigStatus) Size

func (m *ConfigStatus) Size() (n int)

func (*ConfigStatus) String

func (this *ConfigStatus) String() string

func (ConfigStatus) SwaggerDoc

func (ConfigStatus) SwaggerDoc() map[string]string

func (*ConfigStatus) Unmarshal

func (m *ConfigStatus) Unmarshal(dAtA []byte) error

func (*ConfigStatus) XXX_DiscardUnknown

func (m *ConfigStatus) XXX_DiscardUnknown()

func (*ConfigStatus) XXX_Marshal

func (m *ConfigStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigStatus) XXX_Merge

func (m *ConfigStatus) XXX_Merge(src proto.Message)

func (*ConfigStatus) XXX_Size

func (m *ConfigStatus) XXX_Size() int

func (*ConfigStatus) XXX_Unmarshal

func (m *ConfigStatus) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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