github.com/sealerio/sealer@v0.11.1-0.20240507115618-f4f89c5853ae/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  	Type   string `json:"type,omitempty"`
    29  	Data   string `json:"data,omitempty"`
    30  	Action string `json:"action,omitempty"`
    31  	Scope  string `json:"scope,omitempty"`
    32  }
    33  
    34  // PluginStatus defines the observed state of Plugin
    35  type PluginStatus struct {
    36  	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
    37  	// Important: Run "make" to regenerate code after modifying this file
    38  }
    39  
    40  //+kubebuilder:object:root=true
    41  //+kubebuilder:subresource:status
    42  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    43  
    44  // Plugin is the Schema for the plugins API
    45  type Plugin struct {
    46  	metav1.TypeMeta   `json:",inline"`
    47  	metav1.ObjectMeta `json:"metadata,omitempty"`
    48  
    49  	Spec   PluginSpec   `json:"spec,omitempty"`
    50  	Status PluginStatus `json:"status,omitempty"`
    51  }
    52  
    53  //+kubebuilder:object:root=true
    54  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    55  
    56  // PluginList contains a list of Plugin
    57  type PluginList struct {
    58  	metav1.TypeMeta `json:",inline"`
    59  	metav1.ListMeta `json:"metadata,omitempty"`
    60  	Items           []Plugin `json:"items"`
    61  }
    62  
    63  func init() {
    64  	SchemeBuilder.Register(&Plugin{}, &PluginList{})
    65  }