Package object contains utilities for creating and comparing API objects.



This section is empty.


View Source
var Semantic = conversion.EqualitiesOrDie(

Semantic can do semantic deep equality checks for API objects. Fields which are not relevant for the reconciliation logic are intentionally omitted.


func ApplyExistingChannelAttributes

func ApplyExistingChannelAttributes(src, dst *messagingv1alpha1.Channel)

ApplyExistingChannelAttributes copies some important attributes from a given source Channel to a destination Channel.

func ApplyExistingDeploymentAttributes

func ApplyExistingDeploymentAttributes(src, dst *appsv1.Deployment)

ApplyExistingDeploymentAttributes copies some important annotations from a given source Service to a destination Service.

func ApplyExistingPeerAuthenticationAttributes

func ApplyExistingPeerAuthenticationAttributes(src, dst *securityv1beta1.PeerAuthentication)

ApplyExistingPeerAuthenticationAttributes copies some important attributes from a given source Policy to a destination Policy.

func ApplyExistingServiceAttributes

func ApplyExistingServiceAttributes(src, dst *corev1.Service)

ApplyExistingServiceAttributes copies some important attributes from a given source Service to a destination Service.

func NewChannel

func NewChannel(ns, name string, opts ...ObjectOption) *messagingv1alpha1.Channel

NewChannel creates a Channel object.

func NewDeployment

func NewDeployment(ns, name string, opts ...ObjectOption) *appsv1.Deployment

NewDeployment creates a Service object.

func NewPeerAuthentication

func NewPeerAuthentication(ns, name string, opts ...ObjectOption) *securityv1beta1.PeerAuthentication

func NewService

func NewService(ns, name string, opts ...ObjectOption) *corev1.Service

NewService creates a Service object.


type ObjectOption

type ObjectOption func(metav1.Object)

ObjectOption is a functional option for API objects builders.

func WithControllerRef

func WithControllerRef(or *metav1.OwnerReference) ObjectOption

WithControllerRef sets the controller reference of an API object.

func WithEnvVar

func WithEnvVar(name, val string) ObjectOption

WithEnvVar sets the value of a container env var.

func WithImage

func WithImage(img string) ObjectOption

WithImage sets the container image of a Service.

func WithLabel

func WithLabel(key, val string) ObjectOption

WithLabel sets the value of an API object's label.

func WithMatchLabelsSelector

func WithMatchLabelsSelector(key, value string) ObjectOption

WithMatchLabelsSelector sets the selector of a Deployment

func WithName

func WithName(name string) ObjectOption

WithName sets the container name of a Deployment

func WithPermissiveMode

func WithPermissiveMode(port uint32) ObjectOption

WithPermissiveMode sets the mTLS mode of the PeerAuthentication to Permissive for the given port

func WithPodLabel

func WithPodLabel(key, val string) ObjectOption

WithPodLabel sets a label on a Service's template

func WithPort

func WithPort(port int32, name string) ObjectOption

WithPort sets the container port of a Service.

func WithProbe

func WithProbe(path string, port int) ObjectOption

WithProbe sets the HTTP readiness probe of a container.

func WithReplicas

func WithReplicas(replicas int) ObjectOption

WithImage sets the container image of a Service.

func WithSelector

func WithSelector(key, value string) ObjectOption

func WithSelectorSpec

func WithSelectorSpec(labels map[string]string) ObjectOption

WithSelectorSpec selects a workload based on labels

func WithServicePort

func WithServicePort(name string, port int, containerPort int) ObjectOption