github.com/tototoman/operator-sdk@v0.8.2/test/test-framework/pkg/apis/cache/v1alpha1/memcached_types.go (about)

     1  // Copyright 2018 The Operator-SDK Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package v1alpha1
    16  
    17  import (
    18  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    19  )
    20  
    21  // EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
    22  // NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
    23  
    24  type MemcachedSpec struct {
    25  	// Size is the size of the memcached deployment
    26  	Size int32 `json:"size"`
    27  }
    28  type MemcachedStatus struct {
    29  	// Nodes are the names of the memcached pods
    30  	Nodes []string `json:"nodes"`
    31  }
    32  
    33  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    34  
    35  // Memcached is the Schema for the memcacheds API
    36  // +k8s:openapi-gen=true
    37  // +kubebuilder:subresource:status
    38  type Memcached struct {
    39  	metav1.TypeMeta   `json:",inline"`
    40  	metav1.ObjectMeta `json:"metadata,omitempty"`
    41  
    42  	Spec   MemcachedSpec   `json:"spec,omitempty"`
    43  	Status MemcachedStatus `json:"status,omitempty"`
    44  }
    45  
    46  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    47  
    48  // MemcachedList contains a list of Memcached
    49  type MemcachedList struct {
    50  	metav1.TypeMeta `json:",inline"`
    51  	metav1.ListMeta `json:"metadata,omitempty"`
    52  	Items           []Memcached `json:"items"`
    53  }
    54  
    55  func init() {
    56  	SchemeBuilder.Register(&Memcached{}, &MemcachedList{})
    57  }