kubesphere.io/api@v0.0.0-20231107125330-c9a03957060c/devops/v1alpha1/s2ibinary_types.go (about)

     1  /*
     2  Copyright 2020 The KubeSphere Authors.
     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 v1alpha1
    18  
    19  import (
    20  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    21  )
    22  
    23  const (
    24  	ResourceKindS2iBinary     = "S2iBinary"
    25  	ResourceSingularS2iBinary = "s2ibinary"
    26  	ResourcePluralS2iBinary   = "s2ibinaries"
    27  )
    28  
    29  const (
    30  	StatusUploading    = "Uploading"
    31  	StatusReady        = "Ready"
    32  	StatusUploadFailed = "UploadFailed"
    33  )
    34  
    35  const (
    36  	S2iBinaryFinalizerName = "s2ibinary.finalizers.kubesphere.io"
    37  	S2iBinaryLabelKey      = "s2ibinary-name.kubesphere.io"
    38  )
    39  
    40  // EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
    41  // NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
    42  
    43  // S2iBinarySpec defines the desired state of S2iBinary
    44  type S2iBinarySpec struct {
    45  	//FileName is filename of binary
    46  	FileName string `json:"fileName,omitempty"`
    47  	//MD5 is Binary's MD5 Hash
    48  	MD5 string `json:"md5,omitempty"`
    49  	//Size is the file size of file
    50  	Size string `json:"size,omitempty"`
    51  	//DownloadURL in KubeSphere
    52  	DownloadURL string `json:"downloadURL,omitempty"`
    53  	// UploadTime is last upload time
    54  	UploadTimeStamp *metav1.Time `json:"uploadTimeStamp,omitempty"`
    55  }
    56  
    57  // S2iBinaryStatus defines the observed state of S2iBinary
    58  type S2iBinaryStatus struct {
    59  	//Phase is status of S2iBinary . Possible value is "Ready","UnableToDownload"
    60  	Phase string `json:"phase,omitempty"`
    61  }
    62  
    63  // +genclient
    64  // +kubebuilder:object:root=true
    65  
    66  // S2iBinary is the Schema for the s2ibinaries API
    67  // +k8s:openapi-gen=true
    68  // +kubebuilder:printcolumn:name="FileName",type="string",JSONPath=".spec.fileName"
    69  // +kubebuilder:printcolumn:name="MD5",type="string",JSONPath=".spec.md5"
    70  // +kubebuilder:printcolumn:name="Size",type="string",JSONPath=".spec.size"
    71  // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
    72  type S2iBinary struct {
    73  	metav1.TypeMeta   `json:",inline"`
    74  	metav1.ObjectMeta `json:"metadata,omitempty"`
    75  
    76  	Spec   S2iBinarySpec   `json:"spec,omitempty"`
    77  	Status S2iBinaryStatus `json:"status,omitempty"`
    78  }
    79  
    80  // +kubebuilder:object:root=true
    81  
    82  // S2iBinaryList contains a list of S2iBinary
    83  type S2iBinaryList struct {
    84  	metav1.TypeMeta `json:",inline"`
    85  	metav1.ListMeta `json:"metadata,omitempty"`
    86  	Items           []S2iBinary `json:"items"`
    87  }
    88  
    89  func init() {
    90  	SchemeBuilder.Register(&S2iBinary{}, &S2iBinaryList{})
    91  }