kubesphere.io/api@v0.0.0-20231107125330-c9a03957060c/tenant/v1alpha1/workspace_types.go (about) 1 /* 2 Copyright 2019 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 ResourceKindWorkspace = "Workspace" 25 ResourceSingularWorkspace = "workspace" 26 ResourcePluralWorkspace = "workspaces" 27 WorkspaceLabel = "kubesphere.io/workspace" 28 ) 29 30 // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! 31 // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. 32 33 // WorkspaceSpec defines the desired state of Workspace 34 type WorkspaceSpec struct { 35 Manager string `json:"manager,omitempty"` 36 NetworkIsolation *bool `json:"networkIsolation,omitempty"` 37 } 38 39 // WorkspaceStatus defines the observed state of Workspace 40 type WorkspaceStatus struct { 41 // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 42 // Important: Run "make" to regenerate code after modifying this file 43 } 44 45 // +genclient 46 // +kubebuilder:object:root=true 47 // +genclient:nonNamespaced 48 49 // Workspace is the Schema for the workspaces API 50 // +k8s:openapi-gen=true 51 // +kubebuilder:resource:categories="tenant",scope="Cluster" 52 type Workspace struct { 53 metav1.TypeMeta `json:",inline"` 54 metav1.ObjectMeta `json:"metadata,omitempty"` 55 Spec WorkspaceSpec `json:"spec,omitempty"` 56 Status WorkspaceStatus `json:"status,omitempty"` 57 } 58 59 // +kubebuilder:object:root=true 60 // +genclient:nonNamespaced 61 62 // WorkspaceList contains a list of Workspace 63 type WorkspaceList struct { 64 metav1.TypeMeta `json:",inline"` 65 metav1.ListMeta `json:"metadata,omitempty"` 66 Items []Workspace `json:"items"` 67 } 68 69 func init() { 70 SchemeBuilder.Register(&Workspace{}, &WorkspaceList{}) 71 }