apis

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

The apis package describes the comment directives that may be applied to apis / resources

Example
package main

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func main() {}

// FooSpec defines the desired state of Foo
type FooSpec struct {
	// +kubebuilder:validation:Maximum=10
	// +kubebuilder:validation:ExclusiveMinimum=3
	Count int `json:"count"`
}

// FooStatus defines the observed state of Foo
type FooStatus struct{}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// Foo
// +k8s:openapi-gen=true
// +resource:path=foos
type Foo struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   FooSpec   `json:"spec,omitempty"`
	Status FooStatus `json:"status,omitempty"`
}
Output:

Index

Examples

Constants

View Source
const ExclusiveMaximum = "// +kubebuilder:validation:ExclusiveMaximum="

ExclusiveMaximum annotates a go struct field for CRD validation

View Source
const ExclusiveMinimum = "// +kubebuilder:validation:ExclusiveMinimum="

ExclusiveMinimum annotates a go struct field for CRD validation

View Source
const Maximum = "// +kubebuilder:validation:Maximum="

Maximum annotates a go struct field for CRD validation

View Source
const Minimum = "// +kubebuilder:validation:Minimum="

Minimum annotates a go struct field for CRD validation

View Source
const Resource = "// +resource:path="

Resource annotates a type as a resource

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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