Skip to content

Fit example guestbook-operator to walkthrough document #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
Expand All @@ -15,54 +15,49 @@ spec:
plural: guestbooks
singular: guestbook
scope: Namespaced
validation:
openAPIV3Schema:
description: Guestbook is the Schema for the guestbooks API
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
spec:
description: GuestbookSpec defines the desired state of Guestbook
properties:
channel:
description: 'Channel specifies a channel that can be used to resolve
a specific addon, eg: stable It will be ignored if Version is specified'
type: string
patches:
items:
type: object
type: array
version:
description: Version specifies the exact addon version to be deployed,
eg 1.2.3 It should not be specified if Channel is specified
type: string
type: object
status:
description: GuestbookStatus defines the observed state of Guestbook
properties:
errors:
items:
type: string
type: array
healthy:
type: boolean
required:
- healthy
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: Guestbook is the Schema for the guestbooks API
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
spec:
description: GuestbookSpec defines the desired state of Guestbook
properties:
channel:
description: 'Channel specifies a channel that can be used to resolve a specific addon, eg: stable It will be ignored if Version is specified'
type: string
patches:
items:
type: object
type: array
version:
description: Version specifies the exact addon version to be deployed, eg 1.2.3 It should not be specified if Channel is specified
type: string
type: object
status:
description: GuestbookStatus defines the observed state of Guestbook
properties:
errors:
items:
type: string
type: array
healthy:
type: boolean
phase:
type: string
required:
- healthy
type: object
type: object
served: true
storage: true
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ kind: Guestbook
metadata:
name: guestbook-sample
spec:
# Add fields here
foo: bar
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func (r *GuestbookReconciler) setupReconciler(mgr ctrl.Manager) error {
declarative.WithOwner(declarative.SourceAsOwner),
declarative.WithLabels(r.watchLabels),
declarative.WithStatus(status.NewBasic(mgr.GetClient())),
declarative.WithPreserveNamespace(),
declarative.WithApplyPrune(),
declarative.WithObjectTransform(addon.ApplyPatches),

Expand Down