Skip to content

Instantly share code, notes, and snippets.

@odra
Created April 4, 2019 15:47
Show Gist options
  • Save odra/70e5061d677880a8dce618b1ecde52d3 to your computer and use it in GitHub Desktop.
Save odra/70e5061d677880a8dce618b1ecde52d3 to your computer and use it in GitHub Desktop.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// MemcachedSpec defines the desired state of Memcached
// +k8s:openapi-gen=true
type MemcachedSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html
Size int32 `json:"size"`
}
// MemcachedStatus defines the observed state of Memcached
// +k8s:openapi-gen=true
type MemcachedStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html
Nodes []string `json:"nodes"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Memcached is the Schema for the memcacheds API
// +k8s:openapi-gen=true
type Memcached struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec MemcachedSpec `json:"spec"`
Status MemcachedStatus `json:"status"`
}
func (in *Memcached) GetObjectKind() schema.ObjectKind {
panic("implement me")
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// MemcachedList contains a list of Memcached
type MemcachedList struct {
Nodes []string `json:"nodes"`
}
func (in *MemcachedList) GetObjectKind() schema.ObjectKind {
panic("implement me")
}
func init() {
SchemeBuilder.Register(&Memcached{}, &MemcachedList{})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment