Documentation ¶
Index ¶
- Variables
- func NewAnnotationMatchCondition(annotation string, value string) types.Condition
- func NewKubernetesStatusCondition(conditionType string, status bool) types.Condition
- func NewLabelMatchCondition(label string, value string) types.Condition
- func ProvisioningStatusComponentOutput(componentKey string, value interface{}) types.Condition
- type KubeExpectation
- func AbsentInstance(name, namespace string, opts ...Option) (*KubeExpectation, error)
- func AbsentPod(name, namespace string, opts ...Option) (*KubeExpectation, error)
- func AbsentResource(name, namespace string, gvk schema.GroupVersionKind, opts ...Option) (*KubeExpectation, error)
- func AbsentSolution(name, namespace string, opts ...Option) (*KubeExpectation, error)
- func AbsentTarget(name, namespace string, opts ...Option) (*KubeExpectation, error)
- func Instance(name, namespace string, opts ...Option) (*KubeExpectation, error)
- func Must(resource *KubeExpectation, err error) *KubeExpectation
- func Pod(name, namespace string, opts ...Option) (*KubeExpectation, error)
- func Resource(pattern, namespace string, gvk schema.GroupVersionKind, opts ...Option) (*KubeExpectation, error)
- func Solution(name, namespace string, opts ...Option) (*KubeExpectation, error)
- func Target(name, namespace string, opts ...Option) (*KubeExpectation, error)
- type Option
- func IsAbsent() Option
- func WithCondition(condition types.Condition) Option
- func WithDescription(description string) Option
- func WithDiscoveryClientBuilder(builder func() (discovery.DiscoveryInterface, error)) Option
- func WithDynamicClientBuilder(builder func() (dynamic.Interface, error)) Option
- func WithListCondition(condition types.Condition) Option
- func WithLogger(logger func(format string, args ...interface{})) Option
- func WithTick(tick time.Duration) Option
Constants ¶
This section is empty.
Variables ¶
var ( PodReadyCondition types.Condition = conditions.All( NewKubernetesStatusCondition("Ready", true), NewKubernetesStatusCondition("Initialized", true), NewKubernetesStatusCondition("ContainersReady", true), ) // can be used for pods and certificates DeploymentCompleteCondition types.Condition = conditions.All( NewKubernetesStatusCondition("Available", true), NewKubernetesStatusCondition("Progressing", true), ) // can be used for deployments and statefulsets // AioManagerLabelCondition is a condition that checks if the resource is managed by the aio orc api AioManagerLabelCondition types.Condition = NewLabelMatchCondition("iotoperations.azure.com/managed-by", "symphony-api") // ProvisioningSucceededCondition is a condition that checks if the resource has succeeded provisioning ProvisioningSucceededCondition types.Condition = jq.Equality(".status.provisioningStatus.status", "Succeeded", statusDescription) // ProvisioningFailedCondition is a condition that checks if the resource has failed provisioning ProvisioningFailedCondition types.Condition = jq.Equality(".status.provisioningStatus.status", "Failed", statusDescription) // OperationIdMatchCondition is a condition that checks if the resource has the operation id annotation and // ensures that it matches the operationId in the status of the resource OperationIdMatchCondition types.Condition = jq.MustNew( fmt.Sprintf(`.metadata.annotations["%s"]`, "management.azure.com/operationId"), jq.WithCustomMatcher(operationJqMatcher), jq.WithDescription("Operation Id"), ) )
Functions ¶
func NewAnnotationMatchCondition ¶
NewAnnotationMatchCondition returns a condition that checks if the resource has the annotation and value
func NewKubernetesStatusCondition ¶
NewKubernetesStatusCondition returns a condition that checks the status of a kubernetes resource's condition
func NewLabelMatchCondition ¶
NewLabelMatchCondition returns a condition that checks if the resource has the label and value
Types ¶
type KubeExpectation ¶
type KubeExpectation struct {
// contains filtered or unexported fields
}
func AbsentInstance ¶
func AbsentInstance(name, namespace string, opts ...Option) (*KubeExpectation, error)
AbsentInstance returns an expectation that the instance(s) is/are absent from the cluster
func AbsentPod ¶
func AbsentPod(name, namespace string, opts ...Option) (*KubeExpectation, error)
AbsentPod returns an expectation that the pod(s) is/are absent from the cluster
func AbsentResource ¶
func AbsentResource(name, namespace string, gvk schema.GroupVersionKind, opts ...Option) (*KubeExpectation, error)
AbsentResource returns an expectation for the resources is/are absent from the cluster
func AbsentSolution ¶
func AbsentSolution(name, namespace string, opts ...Option) (*KubeExpectation, error)
AbsentSolution returns an expectation that the solution(s) is/are absent from the cluster
func AbsentTarget ¶
func AbsentTarget(name, namespace string, opts ...Option) (*KubeExpectation, error)
AbsentTarget returns an expectation that the target(s) is/are absent from the cluster
func Instance ¶
func Instance(name, namespace string, opts ...Option) (*KubeExpectation, error)
Instance returns an expectation for a instance(s) in the cluster
func Must ¶
func Must(resource *KubeExpectation, err error) *KubeExpectation
Must returns a resource expectation or panics if there is an error
func Pod ¶
func Pod(name, namespace string, opts ...Option) (*KubeExpectation, error)
Pod returns an expectation expectation for a pod(s) in the cluster
func Resource ¶
func Resource(pattern, namespace string, gvk schema.GroupVersionKind, opts ...Option) (*KubeExpectation, error)
func Solution ¶
func Solution(name, namespace string, opts ...Option) (*KubeExpectation, error)
Solution returns an expectation for a solution(s) in the cluster
func Target ¶
func Target(name, namespace string, opts ...Option) (*KubeExpectation, error)
Target returns an expectation for a target(s) in the cluster
func (*KubeExpectation) AsGomegaSubject ¶
func (e *KubeExpectation) AsGomegaSubject() func(context.Context) (interface{}, error)
func (*KubeExpectation) Description ¶
func (re *KubeExpectation) Description() string
func (*KubeExpectation) Id ¶
func (re *KubeExpectation) Id() string
func (*KubeExpectation) ToGomegaMatcher ¶
func (e *KubeExpectation) ToGomegaMatcher() gomega.GomegaMatcher
type Option ¶
type Option func(*KubeExpectation)
func WithCondition ¶
WithCondition specifies the conditions that the resource should satisfy.
func WithDescription ¶
func WithDiscoveryClientBuilder ¶
func WithDiscoveryClientBuilder(builder func() (discovery.DiscoveryInterface, error)) Option
func WithListCondition ¶
WithListCondition specifies the conditions that the list of matched resources should satisfy.
func WithLogger ¶
WithLogger specifies the logger to be used.