object

package
v0.0.0-...-a52e8f6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package object contains utilities for creating and comparing API objects.

Index

Constants

This section is empty.

Variables

View Source
var Semantic = conversion.EqualitiesOrDie(
	channelEqual,
	ksvcEqual,
)

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 ApplyExistingServiceAttributes

func ApplyExistingServiceAttributes(src, dst *servingv1alpha1.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 NewService

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

NewService creates a Service object.

Types

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 WithMinScale

func WithMinScale(replicas int) ObjectOption

WithMinScale specifies the minimum number of Pods this Service should have at any given time.

func WithPodLabel

func WithPodLabel(key, val string) ObjectOption

WithPodLabel sets a label on a Service's template

func WithPort

func WithPort(port int32) ObjectOption

WithPort sets the container port of a Service.

func WithProbe

func WithProbe(path string) ObjectOption

WithProbe sets the HTTP readiness probe of a container.

Jump to

Keyboard shortcuts

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