apis

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 9, 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
	// +kubebuilder:resource:path=foos
	// +kubebuilder:categories=foo,bar,baz
	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 Categories = "// +kubebuilder:categories="

Categories annotates a type as belonging to a comma-delimited list of categories

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

ExclusiveMaximum annotates a numeric go struct field for CRD validation

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

ExclusiveMinimum annotates a numeric go struct field for CRD validation

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

Maximum annotates a numeric go struct field for CRD validation

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

Minimum annotates a numeric go struct field for CRD validation

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

Pattern annotates a string go struct field for CRD validation with a regular expression it must match

View Source
const Resource = "// +kubebuilder: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