github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/types/api/v1/plugin_types.go (about)

     1  /*
     2  Copyright © 2021 Alibaba Group Holding Ltd.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package v1
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  )
    22  
    23  // EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
    24  // NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
    25  
    26  // PluginSpec defines the desired state of Plugin
    27  type PluginSpec struct {
    28  	/*
    29  		Plugin type, like
    30  		EtcdPlugin     = "ETCD"
    31  		LabelPlugin    = "LABEL"
    32  		ShellPlugin    = "SHELL"
    33  		HostNamePlugin = "HOSTNAME"
    34  	*/
    35  	Type   string `json:"type,omitempty"`
    36  	Data   string `json:"data,omitempty"`
    37  	Action string `json:"action,omitempty"`
    38  	On     string `json:"on,omitempty"`
    39  }
    40  
    41  // PluginStatus defines the observed state of Plugin
    42  type PluginStatus struct {
    43  	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
    44  	// Important: Run "make" to regenerate code after modifying this file
    45  }
    46  
    47  //+kubebuilder:object:root=true
    48  //+kubebuilder:subresource:status
    49  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    50  
    51  // Plugin is the Schema for the plugins API
    52  type Plugin struct {
    53  	metav1.TypeMeta   `json:",inline"`
    54  	metav1.ObjectMeta `json:"metadata,omitempty"`
    55  
    56  	Spec   PluginSpec   `json:"spec,omitempty"`
    57  	Status PluginStatus `json:"status,omitempty"`
    58  }
    59  
    60  //+kubebuilder:object:root=true
    61  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    62  
    63  // PluginList contains a list of Plugin
    64  type PluginList struct {
    65  	metav1.TypeMeta `json:",inline"`
    66  	metav1.ListMeta `json:"metadata,omitempty"`
    67  	Items           []Plugin `json:"items"`
    68  }
    69  
    70  func init() {
    71  	SchemeBuilder.Register(&Plugin{}, &PluginList{})
    72  }