github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/externalapis/preflight/v1beta2/hostpreflight_types.go (about)

     1  /*
     2  Copyright (C) 2022-2023 ApeCloud Co., 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 v1beta2
    18  
    19  import (
    20  	troubleshoot "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2"
    21  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    22  )
    23  
    24  // HostPreflightSpec defines the desired state of HostPreflight
    25  type HostPreflightSpec struct {
    26  	// hostPreflightSpec is defined by troubleshoot.sh and inherited by ApeCloud.
    27  	troubleshoot.HostPreflightSpec `json:",inline"`
    28  	// extendCollectors extends user defined hostCollectors by ApeCloud.
    29  	// +optional
    30  	ExtendCollectors []*ExtendHostCollect `json:"extendCollectors,omitempty"`
    31  	// extendAnalyzers extends user defined hostAnalyzers by ApeCloud.
    32  	// +optional
    33  	ExtendAnalyzers []*ExtendHostAnalyze `json:"extendAnalyzers,omitempty"`
    34  }
    35  
    36  // HostPreflightStatus defines the observed state of HostPreflight
    37  type HostPreflightStatus struct {
    38  	// hostPreflightStatus is defined by troubleshoot.sh and inherited by ApeCloud.
    39  	troubleshoot.HostPreflightStatus `json:",inline"`
    40  }
    41  
    42  // +kubebuilder:object:root=true
    43  // +kubebuilder:subresource:status
    44  // +kubebuilder:storageversion
    45  
    46  // HostPreflight is the Schema for the hostpreflights API
    47  type HostPreflight struct {
    48  	metav1.TypeMeta   `json:",inline"`
    49  	metav1.ObjectMeta `json:"metadata,omitempty"`
    50  
    51  	Spec   HostPreflightSpec   `json:"spec,omitempty"`
    52  	Status HostPreflightStatus `json:"status,omitempty"`
    53  }
    54  
    55  // +kubebuilder:object:root=true
    56  
    57  // HostPreflightList contains a list of HostPreflight
    58  type HostPreflightList struct {
    59  	metav1.TypeMeta `json:",inline"`
    60  	metav1.ListMeta `json:"metadata,omitempty"`
    61  	Items           []HostPreflight `json:"items"`
    62  }
    63  
    64  func init() {
    65  	SchemeBuilder.Register(&HostPreflight{}, &HostPreflightList{})
    66  }