Skip to content

Commit

Permalink
apply example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefftree committed May 18, 2021
1 parent e10bf72 commit e59dc76
Show file tree
Hide file tree
Showing 9 changed files with 1,186 additions and 3 deletions.
49 changes: 49 additions & 0 deletions examples/applyconfig/api/v1/ac/zz_generated.applyconfigurations.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions examples/applyconfig/api/v1/applytest.kubebuilder.io_foos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: foos.applytest.kubebuilder.io
spec:
group: applytest.kubebuilder.io
names:
kind: Foo
listKind: FooList
plural: foos
singular: foo
scope: Namespaced
validation:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
nonNullableField:
type: string
nullableField:
type: string
required:
- metadata
- nonNullableField
type: object
version: v1
versions:
- name: v1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
20 changes: 20 additions & 0 deletions examples/applyconfig/api/v1/foo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//go:generate controller-gen object crd paths="." output:dir="."
// +groupName=applytest.kubebuilder.io
// +versionName=v1
//go:generate $GOPATH/src/sigs.k8s.io/controller-tools/controller-gen apply paths="./..."
//go:generate $GOPATH/src/sigs.k8s.io/controller-tools/controller-gen object paths="./..."
package v1

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

// +kubebuilder:object:generate=true
// +kubebuilder:object:root=true
// +kubebuilder:ac:root=true
type Foo struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
NonNullableField string `json:"nonNullableField"`
NullableField string `json:"nullableField,omitempty"`
}
34 changes: 34 additions & 0 deletions examples/applyconfig/api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions examples/applyconfig/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module sigs.k8s.io/controller-runtime/examples/applyconfig

go 1.15

require (
k8s.io/apimachinery v0.21.0
k8s.io/client-go v0.21.0
sigs.k8s.io/controller-runtime v0.8.1
)

replace sigs.k8s.io/controller-runtime => ../..
Loading

0 comments on commit e59dc76

Please sign in to comment.