manager

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: UPL-1.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoTimeStampsDiffer

func DoTimeStampsDiffer(cpTimeUpdated *common.SDKTime, operatorTimeUpdated *metav1.Time) bool

Types

type AccessPolicyDetails

type AccessPolicyDetails struct {
	Dependencies *meshConversions.AccessPolicyDependencies
	SdkAp        *sdk.AccessPolicy
	BuildSdkAp   *sdk.AccessPolicy
}

type BaseValidator

type BaseValidator struct {
	Client            client.Client
	Reader            client.Reader
	Decoder           *admission.Decoder
	ValidationManager CustomValidationManager
	Log               loggerutil.OSOKLogger
	Metrics           *metrics.Metrics
	Recorder          record.EventRecorder
}

client - uses cache client, and has read/write both operations reader - uses direct client, but only allows read operations

func (*BaseValidator) Handle

func (*BaseValidator) InjectDecoder

func (c *BaseValidator) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the Decoder. BaseValidator implements admission.DecoderInjector. A Decoder will be automatically injected.

type CustomResourceHandler

type CustomResourceHandler interface {
	Resource
	Finalizer
	Status
	Verify
	Dependencies
	SdkOperations
}

type CustomResourceValidator

type CustomResourceValidator interface {
	ValidateOnCreate(context context.Context, object client.Object) (bool, string)
	ValidateOnUpdate(context context.Context, object client.Object, oldObject client.Object) (bool, string)
	GetStatus(object client.Object) (*servicemeshapi.ServiceMeshStatus, error)
	ResolveRef(object client.Object) (bool, string)
	ValidateObject(object client.Object) error
	GetEntityType() client.Object
}

type CustomValidationManager

type CustomValidationManager interface {
	ValidateCreateRequest(ctx context.Context, object client.Object) admission.Response
	ValidateUpdateRequest(ctx context.Context, object client.Object, oldObject client.Object) admission.Response
	ValidateDeleteRequest(ctx context.Context, object client.Object) admission.Response
	GetObject() client.Object
}

type Dependencies

type Dependencies interface {
	ResolveDependencies(ctx context.Context, object client.Object, details *ResourceDetails) error
}

type Finalizer

type Finalizer interface {
	GetFinalizer() string
	Finalize(ctx context.Context, object client.Object) error
}

type IngressGatewayDetails

type IngressGatewayDetails struct {
	MeshId     *api.OCID
	SdkIg      *sdk.IngressGateway
	BuildSdkIg *sdk.IngressGateway
}

type IngressGatewayRouteTableDetails

type IngressGatewayRouteTableDetails struct {
	SdkIgrt      *sdk.IngressGatewayRouteTable
	BuildSdkIgrt *sdk.IngressGatewayRouteTable
	Dependencies *meshConversions.IGRTDependencies
}

type MeshDetails

type MeshDetails struct {
	SdkMesh      *sdk.Mesh
	BuildSdkMesh *sdk.Mesh
}

type Resource

type Resource interface {
	GetResource(ctx context.Context, object client.Object, details *ResourceDetails) error
	CreateResource(ctx context.Context, object client.Object, details *ResourceDetails) (bool, error)
	UpdateResource(ctx context.Context, object client.Object, details *ResourceDetails) error
	DeleteResource(ctx context.Context, object client.Object) error
	ChangeCompartment(ctx context.Context, object client.Object, details *ResourceDetails) error
}

type ResourceDetails

type ResourceDetails struct {
	MeshDetails   MeshDetails
	VsDetails     VirtualServiceDetails
	VdDetails     VirtualDeploymentDetails
	VsrtDetails   VirtualServiceRouteTableDetails
	ApDetails     AccessPolicyDetails
	IgDetails     IngressGatewayDetails
	IgrtDetails   IngressGatewayRouteTableDetails
	OpcRetryToken *string
}

type SdkOperations

type SdkOperations interface {
	BuildSdk(object client.Object, details *ResourceDetails) error
	HasCompartmentIdChanged(object client.Object, details *ResourceDetails) (bool, error)
	GetLifecycleState(details *ResourceDetails) string
	GetMessage(details *ResourceDetails) string
	HasSdk(details *ResourceDetails) bool
}

type ServiceMeshServiceManager

type ServiceMeshServiceManager struct {
	// contains filtered or unexported fields
}

func (*ServiceMeshServiceManager) CreateOrUpdate

func (*ServiceMeshServiceManager) Delete

func (*ServiceMeshServiceManager) GetCrdStatus

func (c *ServiceMeshServiceManager) GetCrdStatus(obj runtime.Object) (*api.OSOKStatus, error)

func (*ServiceMeshServiceManager) UpdateK8s

func (c *ServiceMeshServiceManager) UpdateK8s(ctx context.Context, obj client.Object, details *ResourceDetails, hasCompartmentChanged bool, hasResourceUpdatedInCp bool) (servicemanager.OSOKResponse, error)

func (*ServiceMeshServiceManager) UpdateOpcRetryToken

func (c *ServiceMeshServiceManager) UpdateOpcRetryToken(ctx context.Context, obj client.Object, opcRetryToken *string) error

func (*ServiceMeshServiceManager) UpdateServiceMeshActiveStatus

func (c *ServiceMeshServiceManager) UpdateServiceMeshActiveStatus(ctx context.Context, obj client.Object, err error)

func (*ServiceMeshServiceManager) UpdateServiceMeshCondition

func (c *ServiceMeshServiceManager) UpdateServiceMeshCondition(ctx context.Context, obj client.Object, status metav1.ConditionStatus, reason string, message string, meshConditionType servicemeshapi.ServiceMeshConditionType) error

UpdateServiceMeshCondition updates the status of the resource Called when there is an error from CP Additionally, also called when the state is not Active We haven't fully synced the spec, hence using the existing generation from the status for generation field

func (*ServiceMeshServiceManager) UpdateServiceMeshConfiguredStatus

func (c *ServiceMeshServiceManager) UpdateServiceMeshConfiguredStatus(ctx context.Context, obj client.Object, err error) error

func (*ServiceMeshServiceManager) UpdateServiceMeshDependenciesActiveStatus

func (c *ServiceMeshServiceManager) UpdateServiceMeshDependenciesActiveStatus(ctx context.Context, object client.Object, err error)

type ServiceMeshValidationManager

type ServiceMeshValidationManager struct {
	// contains filtered or unexported fields
}

func NewServiceMeshValidationManager

func NewServiceMeshValidationManager(validationManager CustomResourceValidator, log loggerutil.OSOKLogger) *ServiceMeshValidationManager

func (*ServiceMeshValidationManager) GetObject

func (*ServiceMeshValidationManager) ValidateCreateRequest

func (v *ServiceMeshValidationManager) ValidateCreateRequest(ctx context.Context, object client.Object) admission.Response

func (*ServiceMeshValidationManager) ValidateDeleteRequest

func (v *ServiceMeshValidationManager) ValidateDeleteRequest(ctx context.Context, object client.Object) admission.Response

func (*ServiceMeshValidationManager) ValidateUpdateRequest

func (v *ServiceMeshValidationManager) ValidateUpdateRequest(ctx context.Context, object client.Object, oldObject client.Object) admission.Response

type Status

type Status interface {
	GetServiceMeshStatus(object client.Object) (*servicemeshapi.ServiceMeshStatus, error)
	GetConditionStatus(details *ResourceDetails) metav1.ConditionStatus
	UpdateStatus(object client.Object, details *ResourceDetails) (bool, error)
	GetTimeUpdated(details *ResourceDetails) *common.SDKTime
}

type Verify

type Verify interface {
	VerifyEntityType(object runtime.Object) (client.Object, error)
	VerifyResourceStatus(details *ResourceDetails) (bool, error)
}

type VirtualDeploymentDetails

type VirtualDeploymentDetails struct {
	VsRef      *meshCommons.ResourceRef
	SdkVd      *sdk.VirtualDeployment
	BuildSdkVd *sdk.VirtualDeployment
}

type VirtualServiceDetails

type VirtualServiceDetails struct {
	MeshId     *api.OCID
	SdkVs      *sdk.VirtualService
	BuildSdkVs *sdk.VirtualService
}

type VirtualServiceRouteTableDetails

type VirtualServiceRouteTableDetails struct {
	SdkVsrt      *sdk.VirtualServiceRouteTable
	BuildSdkVsrt *sdk.VirtualServiceRouteTable
	Dependencies *meshConversions.VSRTDependencies
}

Jump to

Keyboard shortcuts

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