Documentation ¶
Overview ¶
Package object contains utilities for creating and comparing API objects.
Index ¶
- Variables
- func ApplyExistingChannelAttributes(src, dst *messagingv1alpha1.Channel)
- func ApplyExistingDeploymentAttributes(src, dst *appsv1.Deployment)
- func ApplyExistingPeerAuthenticationAttributes(src, dst *securityv1beta1.PeerAuthentication)
- func ApplyExistingServiceAttributes(src, dst *corev1.Service)
- func NewChannel(ns, name string, opts ...ObjectOption) *messagingv1alpha1.Channel
- func NewDeployment(ns, name string, opts ...ObjectOption) *appsv1.Deployment
- func NewPeerAuthentication(ns, name string, opts ...ObjectOption) *securityv1beta1.PeerAuthentication
- func NewService(ns, name string, opts ...ObjectOption) *corev1.Service
- type ObjectOption
- func WithControllerRef(or *metav1.OwnerReference) ObjectOption
- func WithEnvVar(name, val string) ObjectOption
- func WithImage(img string) ObjectOption
- func WithLabel(key, val string) ObjectOption
- func WithMatchLabelsSelector(key, value string) ObjectOption
- func WithName(name string) ObjectOption
- func WithPermissiveMode(port uint32) ObjectOption
- func WithPodLabel(key, val string) ObjectOption
- func WithPort(port int32, name string) ObjectOption
- func WithProbe(path string, port int) ObjectOption
- func WithReplicas(replicas int) ObjectOption
- func WithSelector(key, value string) ObjectOption
- func WithSelectorSpec(labels map[string]string) ObjectOption
- func WithServicePort(name string, port int, containerPort int) ObjectOption
Constants ¶
This section is empty.
Variables ¶
var Semantic = conversion.EqualitiesOrDie(
channelEqual,
peerAuthenticationEqual,
deploymentEqual,
serviceEqual,
)
Semantic can do semantic deep equality checks for API objects. Fields which are not relevant for the reconciliation logic are intentionally omitted.
Functions ¶
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 ¶
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.
Types ¶
type ObjectOption ¶
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