v1alpha1

package
v0.0.0-...-b3f0fa4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. +groupName=ocicommon.oracle.com

Index

Constants

View Source
const (
	AnyStringValidationRegex          = ".+"
	AvailabilityDomainValidationRegex = "^[a-zA-Z0-9]+\\:[a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9]$"
	CidrValidationRegex               = "" /* 136-byte string literal not displayed */
	DomainValidationRegex             = "^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\\.[a-zA-Z]{2,}$"
	HostnameValidationRegex           = "^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])$"
	Ipv4ValidationRegex               = "^$|^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})(\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})){3}$"
	LoadBalancerProtocolRegex         = "^HTTP$|^HTTP2$|^TCP$"
	NoOrAnyStringValidationRegex      = "^$|.+"

	ValidationTypeArray   = "array"
	ValidationTypeBoolean = "boolean"
	ValidationTypeInteger = "integer"
	ValidationTypeString  = "string"
)

Regex constants used for object fields validation to ensure proper types and values Defined as constants because they are used multiple times in difference OCI resource types

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder()
	AddToScheme   = SchemeBuilder.AddToScheme
)

Register scheme and api resources

View Source
var MetaDataValidation = apiextv1beta1.JSONSchemaProps{
	Required: []string{"name"},
	Properties: map[string]apiextv1beta1.JSONSchemaProps{
		"name": {
			Type:    ValidationTypeString,
			Pattern: HostnameValidationRegex,
		},
		"namespace": {
			Type:    ValidationTypeString,
			Pattern: HostnameValidationRegex,
		},
	},
}

MetaDataValidation is variable used to construct the schema validation property for the CRDs

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: "ocicommon.oracle.com", Version: "v1alpha1"}

SchemeGroupVersion is the group version used to register these objects.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	DependsOn map[string]DependsOn `json:"dependson,omitempty"`
}

Dependency is an array of explicit DependsOn relations between objects

func (*Dependency) DeepCopy

func (in *Dependency) DeepCopy() *Dependency

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

func (*Dependency) DeepCopyInto

func (in *Dependency) DeepCopyInto(out *Dependency)

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

func (*Dependency) GetDependsOn

func (d *Dependency) GetDependsOn() map[string]DependsOn

GetDependsOn is getter for DependsOn

type DependsOn

type DependsOn struct {
	LabelSelector map[string]string `json:"labelselector,omitempty"`
	FieldSelector map[string]string `json:"fieldselector,omitempty"`
}

DependsOn is user-defined explicit relationship between objects using selectors

func (*DependsOn) DeepCopy

func (in *DependsOn) DeepCopy() *DependsOn

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

func (*DependsOn) DeepCopyInto

func (in *DependsOn) DeepCopyInto(out *DependsOn)

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

type ObjectInterface

type ObjectInterface interface {
	AddDependent(kind string, obj runtime.Object) error
	RemoveDependent(kind string, obj runtime.Object) error
	IsDependentRegistered(kind string, obj runtime.Object) (bool, error)
	GetResourcePlural() string
	GetResourceID() string
	IsResource() bool
	GetGroupVersionResource() schema.GroupVersionResource
	GetResourceState() ResourceState
}

ObjectInterface is an interface for resource objects that supports dependencies

type ResourceState

type ResourceState string

ResourceState stores state for any OCI resource

const (
	// ResourceStatePending is used when the resource is pending reconcilation
	ResourceStatePending ResourceState = "Pending"
	// ResourceStateCreated is used when the resource is created in OCI
	ResourceStateCreated ResourceState = "Created"
	// ResourceStateProcessed is used when the reconcilation completes
	ResourceStateProcessed ResourceState = "Processed"
	// ResourceStateError indicates if the resource reconcilation encountered an error
	ResourceStateError ResourceState = "Error"
)

type ResourceStatus

type ResourceStatus struct {
	State        ResourceState       `json:"state,omitempty"`
	ResetCounter int                 `json:"resetcounter,omitempty"`
	Message      string              `json:"message,omitempty"`
	Dependents   map[string][]string `json:"dependents,omitempty"`
}

ResourceStatus is a generic struct to store status information about any OCI resource

func (*ResourceStatus) AddDependent

func (s *ResourceStatus) AddDependent(kind string, obj runtime.Object) error

AddDependent adds a dependent to the resource status

func (*ResourceStatus) DeepCopy

func (in *ResourceStatus) DeepCopy() *ResourceStatus

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

func (*ResourceStatus) DeepCopyInto

func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)

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

func (*ResourceStatus) HandleError

func (s *ResourceStatus) HandleError(e error) error

HandleError updates the object with errors

func (*ResourceStatus) IsDependentRegistered

func (s *ResourceStatus) IsDependentRegistered(kind string, obj runtime.Object) (bool, error)

IsDependentRegistered checks if a dependent exists in the resource status

func (*ResourceStatus) RemoveDependent

func (s *ResourceStatus) RemoveDependent(kind string, obj runtime.Object) error

RemoveDependent removes a dependant from the resource status

Jump to

Keyboard shortcuts

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