diff --git a/go.mod b/go.mod index 8410991..6b773e9 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 - github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 - github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 + github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 + github.com/loft-sh/agentapi/v4 v4.2.2-beta.0 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 @@ -61,7 +61,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect diff --git a/go.sum b/go.sum index 7e4f65b..aea4658 100644 --- a/go.sum +++ b/go.sum @@ -107,10 +107,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 h1:aqT1UeosCYB+3DEzfxW0evhcYHxhoBVAEWtkXLXFimI= -github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 h1:yoTwfLkurXmA7ENb8YWQePIVK42vZVSeV4unngNc8c8= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= +github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 h1:Sq6qEsKSiZHYTzWbnFvnWrzMBFIC3XxFoXtnHdJE9P8= +github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= +github.com/loft-sh/agentapi/v4 v4.2.2-beta.0 h1:5WNUioE4XMEelkmngHqWqWTLz9vonVJd64HJEi9zA8Q= +github.com/loft-sh/agentapi/v4 v4.2.2-beta.0/go.mod h1:np3oo4gi1fYJvhXAYLk+SY6bVy2iqsxoAf8ebZNMnXU= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -135,8 +135,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= diff --git a/pkg/apis/management/install/zz_generated.api.register.go b/pkg/apis/management/install/zz_generated.api.register.go index bbc8be2..0c6d75e 100644 --- a/pkg/apis/management/install/zz_generated.api.register.go +++ b/pkg/apis/management/install/zz_generated.api.register.go @@ -59,7 +59,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { &management.DevPodSshOptions{}, &management.DevPodWorkspaceInstanceState{}, &management.DevPodStopOptions{}, + &management.DevPodWorkspaceInstanceTroubleshoot{}, &management.DevPodUpOptions{}, + &management.DevPodWorkspacePreset{}, + &management.DevPodWorkspacePresetList{}, &management.DevPodWorkspaceTemplate{}, &management.DevPodWorkspaceTemplateList{}, &management.DirectClusterEndpointToken{}, @@ -136,6 +139,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &management.VirtualClusterInstance{}, &management.VirtualClusterInstanceList{}, &management.VirtualClusterAccessKey{}, + &management.VirtualClusterExternalDatabase{}, &management.VirtualClusterInstanceKubeConfig{}, &management.VirtualClusterInstanceLog{}, &management.VirtualClusterTemplate{}, diff --git a/pkg/apis/management/v1/cluster_types.go b/pkg/apis/management/v1/cluster_types.go index af31486..228c2f2 100644 --- a/pkg/apis/management/v1/cluster_types.go +++ b/pkg/apis/management/v1/cluster_types.go @@ -1,6 +1,7 @@ package v1 import ( + agentstoragev1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -16,7 +17,7 @@ import ( // Cluster holds the cluster information // +k8s:openapi-gen=true -// +resource:path=clusters,rest=ClusterREST +// +resource:path=clusters,rest=ClusterREST,statusRest=ClusterStatusREST // +subresource:request=ClusterMemberAccess,path=memberaccess,kind=ClusterMemberAccess,rest=ClusterMemberAccessREST // +subresource:request=ClusterReset,path=reset,kind=ClusterReset,rest=ClusterResetREST // +subresource:request=ClusterDomain,path=domain,kind=ClusterDomain,rest=ClusterDomainREST @@ -63,3 +64,11 @@ func (a *Cluster) GetAccess() []storagev1.Access { func (a *Cluster) SetAccess(access []storagev1.Access) { a.Spec.Access = access } + +func (a *Cluster) GetConditions() agentstoragev1.Conditions { + return a.Status.Conditions +} + +func (a *Cluster) SetConditions(conditions agentstoragev1.Conditions) { + a.Status.Conditions = conditions +} diff --git a/pkg/apis/management/v1/config_types.go b/pkg/apis/management/v1/config_types.go index b8da709..6b4a528 100644 --- a/pkg/apis/management/v1/config_types.go +++ b/pkg/apis/management/v1/config_types.go @@ -69,6 +69,13 @@ type ConfigStatus struct { // DisableLoftConfigEndpoint will disable setting config via the UI and config.management.loft.sh endpoint DisableConfigEndpoint bool `json:"disableConfigEndpoint,omitempty"` + + // Cloud holds the settings to be used exclusively in vCluster Cloud based + // environments and deployments. + Cloud *Cloud `json:"cloud,omitempty"` + + // CostControl holds the settings related to the Cost Control ROI dashboard and its metrics gathering infrastructure + CostControl *CostControl `json:"costControl,omitempty"` } // Audit holds the audit configuration options for loft. Changing any options will require a loft restart @@ -692,3 +699,76 @@ type AuthenticationOIDC struct { // +optional Type string `json:"type,omitempty"` } + +type Cloud struct { + // ReleaseChannel specifies the release channel for the cloud configuration. + // This can be used to determine which updates or versions are applied. + ReleaseChannel string `json:"releaseChannel,omitempty"` + + // MaintenanceWindow specifies the maintenance window for the cloud configuration. + // This is a structured representation of the time window during which maintenance can occur. + MaintenanceWindow MaintenanceWindow `json:"maintenanceWindow,omitempty"` +} + +type MaintenanceWindow struct { + // DayOfWeek specifies the day of the week for the maintenance window. + // It should be a string representing the day, e.g., "Monday", "Tuesday", etc. + DayOfWeek string `json:"dayOfWeek,omitempty"` + + // TimeWindow specifies the time window for the maintenance. + // It should be a string representing the time range in 24-hour format, in UTC, e.g., "02:00-03:00". + TimeWindow string `json:"timeWindow,omitempty"` +} + +type CostControl struct { + // Enabled specifies whether the ROI dashboard should be available in the UI, and if the metrics infrastructure + // that provides dashboard data is deployed + Enabled *bool `json:"enabled,omitempty"` + + // Global are settings for globally managed components + Global CostControlGlobalConfig `json:"global,omitempty"` + + // Cluster are settings for each cluster's managed components. These settings apply to all connected clusters + // unless overridden by modifying the Cluster's spec + Cluster CostControlClusterConfig `json:"cluster,omitempty"` + + // Settings specify price-related settings that are taken into account for the ROI dashboard calculations. + Settings *CostControlSettings `json:"settings,omitempty"` +} + +type CostControlGlobalConfig struct { + // Metrics these settings apply to metric infrastructure used to aggregate metrics across all connected clusters + Metrics *storagev1.Metrics `json:"metrics,omitempty"` +} + +type CostControlClusterConfig struct { + // Metrics are settings applied to metric infrastructure in each connected cluster. These can be overridden in + // individual clusters by modifying the Cluster's spec + Metrics *storagev1.Metrics `json:"metrics,omitempty"` + + // OpenCost are settings applied to OpenCost deployments in each connected cluster. These can be overridden in + // individual clusters by modifying the Cluster's spec + OpenCost *storagev1.OpenCost `json:"opencost,omitempty"` +} + +type CostControlSettings struct { + // PriceCurrency specifies the currency. + PriceCurrency string `json:"priceCurrency,omitempty"` + + // AvgCPUPricePerNode specifies the average CPU price per node. + AvgCPUPricePerNode *CostControlResourcePrice `json:"averageCPUPricePerNode,omitempty"` + + // AvgRAMPricePerNode specifies the average RAM price per node. + AvgRAMPricePerNode *CostControlResourcePrice `json:"averageRAMPricePerNode,omitempty"` + + // ControlPlanePricePerCluster specifies the price of one physical cluster. + ControlPlanePricePerCluster *CostControlResourcePrice `json:"controlPlanePricePerCluster,omitempty"` +} + +type CostControlResourcePrice struct { + // Price specifies the price. + Price float64 `json:"price,omitempty"` + + // TimePeriod specifies the time period for the price. + TimePeriod string `json:"timePeriod,omitempty"` +} diff --git a/pkg/apis/management/v1/devpodenvironmenttemplate_types.go b/pkg/apis/management/v1/devpodenvironmenttemplate_types.go index c61f336..b22464a 100644 --- a/pkg/apis/management/v1/devpodenvironmenttemplate_types.go +++ b/pkg/apis/management/v1/devpodenvironmenttemplate_types.go @@ -26,18 +26,17 @@ type DevPodEnvironmentTemplateSpec struct { storagev1.DevPodEnvironmentTemplateSpec `json:",inline"` } -// GitEnvironmentTemplate stores configuration of Git environment template source -type GitEnvironmentTemplate struct { - // Repository stores repository URL for Git environment spec source - Repository string `json:"repository"` - - // Revision stores revision to checkout in repository - // +optional - Revision string `json:"revision,omitempty"` - - // SubPath stores subpath within Repositor where environment spec is - // +optional - SubPath string `json:"subpath,omitempty"` +// DevPodEnvironmentTemplateStatus holds the status +type DevPodEnvironmentTemplateStatus struct{} + +func (a *DevPodEnvironmentTemplate) GetVersions() []storagev1.VersionAccessor { + var retVersions []storagev1.VersionAccessor + for _, v := range a.Spec.Versions { + b := v + retVersions = append(retVersions, &b) + } + + return retVersions } func (a *DevPodEnvironmentTemplate) GetOwner() *storagev1.UserOrTeam { @@ -55,6 +54,3 @@ func (a *DevPodEnvironmentTemplate) GetAccess() []storagev1.Access { func (a *DevPodEnvironmentTemplate) SetAccess(access []storagev1.Access) { a.Spec.Access = access } - -// DevPodEnvironmentTemplateStatus holds the status -type DevPodEnvironmentTemplateStatus struct{} diff --git a/pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go b/pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go new file mode 100644 index 0000000..33edb58 --- /dev/null +++ b/pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go @@ -0,0 +1,41 @@ +package v1 + +import ( + storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// +subresource-request +type DevPodWorkspaceInstanceTroubleshoot struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // State holds the workspaces state as given by 'devpod export' + // +optional + State string `json:"state,omitempty"` + + // Workspace holds the workspace's instance object data + // +optional + Workspace *DevPodWorkspaceInstance `json:"workspace,omitempty"` + + // Template holds the workspace instance's template used to create it. + // This is the raw template, not the rendered one. + // +optional + Template *storagev1.DevPodWorkspaceTemplate `json:"template,omitempty"` + + // Pods is a list of pod objects that are linked to the workspace. + // +optional + Pods []corev1.Pod `json:"pods,omitempty"` + + // PVCs is a list of PVC objects that are linked to the workspace. + // +optional + PVCs []corev1.PersistentVolumeClaim `json:"pvcs,omitempty"` + + // Errors is a list of errors that occurred while trying to collect + // informations for troubleshooting. + // +optional + Errors []string `json:"errors,omitempty"` +} diff --git a/pkg/apis/management/v1/devpodworkspaceinstance_types.go b/pkg/apis/management/v1/devpodworkspaceinstance_types.go index a77b549..08db551 100644 --- a/pkg/apis/management/v1/devpodworkspaceinstance_types.go +++ b/pkg/apis/management/v1/devpodworkspaceinstance_types.go @@ -11,6 +11,7 @@ import ( // +genclient:noStatus // +genclient:method=GetState,verb=get,subresource=state,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState // +genclient:method=SetState,verb=create,subresource=state,input=github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState +// +genclient:method=Troubleshoot,verb=get,subresource=troubleshoot,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DevPodWorkspaceInstance holds the DevPodWorkspaceInstance information @@ -22,6 +23,7 @@ import ( // +subresource:request=DevPodStopOptions,path=stop,kind=DevPodStopOptions,rest=DevPodStopOptionsREST // +subresource:request=DevPodStatusOptions,path=getstatus,kind=DevPodStatusOptions,rest=DevPodStatusOptionsREST // +subresource:request=DevPodWorkspaceInstanceState,path=state,kind=DevPodWorkspaceInstanceState,rest=DevPodWorkspaceInstanceStateREST +// +subresource:request=DevPodWorkspaceInstanceTroubleshoot,path=troubleshoot,kind=DevPodWorkspaceInstanceTroubleshoot,rest=DevPodWorkspaceInstanceTroubleshootREST type DevPodWorkspaceInstance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/v1/devpodworkspacepreset_types.go b/pkg/apis/management/v1/devpodworkspacepreset_types.go new file mode 100644 index 0000000..45b1f91 --- /dev/null +++ b/pkg/apis/management/v1/devpodworkspacepreset_types.go @@ -0,0 +1,51 @@ +package v1 + +import ( + storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DevPodWorkspacePreset +// +k8s:openapi-gen=true +// +resource:path=devpodworkspacepresets,rest=DevPodWorkspacePresetREST +type DevPodWorkspacePreset struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec DevPodWorkspacePresetSpec `json:"spec,omitempty"` + Status DevPodWorkspacePresetStatus `json:"status,omitempty"` +} + +// DevPodWorkspacePresetSpec holds the specification +type DevPodWorkspacePresetSpec struct { + storagev1.DevPodWorkspacePresetSpec `json:",inline"` +} + +// DevPodWorkspacePresetSource +// +k8s:openapi-gen=true +type DevPodWorkspacePresetSource struct { + storagev1.DevPodWorkspacePresetSource `json:",inline"` +} + +func (a *DevPodWorkspacePreset) GetOwner() *storagev1.UserOrTeam { + return a.Spec.Owner +} + +func (a *DevPodWorkspacePreset) SetOwner(userOrTeam *storagev1.UserOrTeam) { + a.Spec.Owner = userOrTeam +} + +func (a *DevPodWorkspacePreset) GetAccess() []storagev1.Access { + return a.Spec.Access +} + +func (a *DevPodWorkspacePreset) SetAccess(access []storagev1.Access) { + a.Spec.Access = access +} + +// DevPodWorkspacePresetStatus holds the status +type DevPodWorkspacePresetStatus struct{} diff --git a/pkg/apis/management/v1/project_templates_types.go b/pkg/apis/management/v1/project_templates_types.go index 5c89410..6ea1539 100644 --- a/pkg/apis/management/v1/project_templates_types.go +++ b/pkg/apis/management/v1/project_templates_types.go @@ -32,6 +32,9 @@ type ProjectTemplates struct { // DevPodEnvironmentTemplates holds all the allowed environment templates DevPodEnvironmentTemplates []DevPodEnvironmentTemplate `json:"devPodEnvironmentTemplates,omitempty"` + // DevPodWorkspacePresets holds all the allowed workspace presets + DevPodWorkspacePresets []DevPodWorkspacePreset `json:"devPodWorkspacePresets,omitempty"` + // DefaultDevPodEnvironmentTemplate DefaultDevPodEnvironmentTemplate string `json:"defaultDevPodEnvironmentTemplate,omitempty"` } diff --git a/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go b/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go new file mode 100644 index 0000000..1fd3701 --- /dev/null +++ b/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go @@ -0,0 +1,34 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualClusterExternalDatabase holds kube config request and response data for virtual clusters +// +subresource-request +type VirtualClusterExternalDatabase struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualClusterExternalDatabaseSpec `json:"spec,omitempty"` + Status VirtualClusterExternalDatabaseStatus `json:"status,omitempty"` +} + +type VirtualClusterExternalDatabaseSpec struct { + // Connector specifies the secret that should be used to connect to an external database server. The connection is + // used to manage a user and database for the vCluster. A data source endpoint constructed from the created user and + // database is returned on status. The secret specified by connector should contain the following fields: + // endpoint - the endpoint where the database server can be accessed + // user - the database username + // password - the password for the database username + // port - the port to be used in conjunction with the endpoint to connect to the databse server. This is commonly + // 3306 + // +optional + Connector string `json:"connector,omitempty"` +} + +type VirtualClusterExternalDatabaseStatus struct { + // DataSource holds a datasource endpoint constructed from the vCluster's designated user and database. The user and + // database are created from the given connector. + DataSource string `json:"dataSource,omitempty"` +} diff --git a/pkg/apis/management/v1/virtualclusterinstance_types.go b/pkg/apis/management/v1/virtualclusterinstance_types.go index 3dc28a2..c0b87f1 100644 --- a/pkg/apis/management/v1/virtualclusterinstance_types.go +++ b/pkg/apis/management/v1/virtualclusterinstance_types.go @@ -11,6 +11,7 @@ import ( // +genclient:noStatus // +genclient:method=GetKubeConfig,verb=create,subresource=kubeconfig,input=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig // +genclient:method=GetAccessKey,verb=get,subresource=accesskey,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKey +// +genclient:method=GetExternalDatabase,verb=create,subresource=externaldatabase,input=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // VirtualClusterInstance holds the VirtualClusterInstance information @@ -19,6 +20,7 @@ import ( // +subresource:request=VirtualClusterInstanceLog,path=log,kind=VirtualClusterInstanceLog,rest=VirtualClusterInstanceLogREST // +subresource:request=VirtualClusterInstanceKubeConfig,path=kubeconfig,kind=VirtualClusterInstanceKubeConfig,rest=VirtualClusterInstanceKubeConfigREST // +subresource:request=VirtualClusterAccessKey,path=accesskey,kind=VirtualClusterAccessKey,rest=VirtualClusterAccessKeyREST +// +subresource:request=VirtualClusterExternalDatabase,path=externaldatabase,kind=VirtualClusterExternalDatabase,rest=VirtualClusterExternalDatabaseREST type VirtualClusterInstance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/v1/zz_generated.api.register.go b/pkg/apis/management/v1/zz_generated.api.register.go index 631c4d1..4167021 100644 --- a/pkg/apis/management/v1/zz_generated.api.register.go +++ b/pkg/apis/management/v1/zz_generated.api.register.go @@ -50,7 +50,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { &DevPodSshOptions{}, &DevPodWorkspaceInstanceState{}, &DevPodStopOptions{}, + &DevPodWorkspaceInstanceTroubleshoot{}, &DevPodUpOptions{}, + &DevPodWorkspacePreset{}, + &DevPodWorkspacePresetList{}, &DevPodWorkspaceTemplate{}, &DevPodWorkspaceTemplateList{}, &DirectClusterEndpointToken{}, @@ -127,6 +130,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &VirtualClusterInstance{}, &VirtualClusterInstanceList{}, &VirtualClusterAccessKey{}, + &VirtualClusterExternalDatabase{}, &VirtualClusterInstanceKubeConfig{}, &VirtualClusterInstanceLog{}, &VirtualClusterTemplate{}, @@ -152,6 +156,11 @@ var ( nil, management.NewBackupApplyREST), management.ManagementClusterStorage, + builders.NewApiResourceWithStorage( + management.InternalClusterStatus, + func() runtime.Object { return &Cluster{} }, // Register versioned resource + func() runtime.Object { return &ClusterList{} }, // Register versioned resource list + management.NewClusterStatusREST), builders.NewApiResourceWithStorage( management.InternalClusterAccessKeyREST, func() runtime.Object { return &ClusterAccessKey{} }, // Register versioned resource @@ -223,11 +232,17 @@ var ( func() runtime.Object { return &DevPodStopOptions{} }, // Register versioned resource nil, management.NewDevPodStopOptionsREST), + builders.NewApiResourceWithStorage( + management.InternalDevPodWorkspaceInstanceTroubleshootREST, + func() runtime.Object { return &DevPodWorkspaceInstanceTroubleshoot{} }, // Register versioned resource + nil, + management.NewDevPodWorkspaceInstanceTroubleshootREST), builders.NewApiResourceWithStorage( management.InternalDevPodUpOptionsREST, func() runtime.Object { return &DevPodUpOptions{} }, // Register versioned resource nil, management.NewDevPodUpOptionsREST), + management.ManagementDevPodWorkspacePresetStorage, management.ManagementDevPodWorkspaceTemplateStorage, management.ManagementDirectClusterEndpointTokenStorage, management.ManagementEventStorage, @@ -371,6 +386,11 @@ var ( func() runtime.Object { return &VirtualClusterAccessKey{} }, // Register versioned resource nil, management.NewVirtualClusterAccessKeyREST), + builders.NewApiResourceWithStorage( + management.InternalVirtualClusterExternalDatabaseREST, + func() runtime.Object { return &VirtualClusterExternalDatabase{} }, // Register versioned resource + nil, + management.NewVirtualClusterExternalDatabaseREST), builders.NewApiResourceWithStorage( management.InternalVirtualClusterInstanceKubeConfigREST, func() runtime.Object { return &VirtualClusterInstanceKubeConfig{} }, // Register versioned resource @@ -623,6 +643,14 @@ type DevPodStopOptionsList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DevPodWorkspaceInstanceTroubleshootList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DevPodWorkspaceInstanceTroubleshoot `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type DevPodUpOptionsList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -631,6 +659,14 @@ type DevPodUpOptionsList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DevPodWorkspacePresetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DevPodWorkspacePreset `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type DevPodWorkspaceTemplateList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -1015,6 +1051,14 @@ type VirtualClusterAccessKeyList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type VirtualClusterExternalDatabaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualClusterExternalDatabase `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type VirtualClusterInstanceKubeConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/v1/zz_generated.conversion.go b/pkg/apis/management/v1/zz_generated.conversion.go index 2812850..e5f3f90 100644 --- a/pkg/apis/management/v1/zz_generated.conversion.go +++ b/pkg/apis/management/v1/zz_generated.conversion.go @@ -16,6 +16,7 @@ import ( management "github.com/loft-sh/api/v4/pkg/apis/management" storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" uiv1 "github.com/loft-sh/api/v4/pkg/apis/ui/v1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" @@ -399,6 +400,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*Cloud)(nil), (*management.Cloud)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_Cloud_To_management_Cloud(a.(*Cloud), b.(*management.Cloud), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.Cloud)(nil), (*Cloud)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_Cloud_To_v1_Cloud(a.(*management.Cloud), b.(*Cloud), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*management.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_Cluster_To_management_Cluster(a.(*Cluster), b.(*management.Cluster), scope) }); err != nil { @@ -809,6 +820,56 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*CostControl)(nil), (*management.CostControl)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_CostControl_To_management_CostControl(a.(*CostControl), b.(*management.CostControl), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.CostControl)(nil), (*CostControl)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_CostControl_To_v1_CostControl(a.(*management.CostControl), b.(*CostControl), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CostControlClusterConfig)(nil), (*management.CostControlClusterConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_CostControlClusterConfig_To_management_CostControlClusterConfig(a.(*CostControlClusterConfig), b.(*management.CostControlClusterConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.CostControlClusterConfig)(nil), (*CostControlClusterConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_CostControlClusterConfig_To_v1_CostControlClusterConfig(a.(*management.CostControlClusterConfig), b.(*CostControlClusterConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CostControlGlobalConfig)(nil), (*management.CostControlGlobalConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_CostControlGlobalConfig_To_management_CostControlGlobalConfig(a.(*CostControlGlobalConfig), b.(*management.CostControlGlobalConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.CostControlGlobalConfig)(nil), (*CostControlGlobalConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_CostControlGlobalConfig_To_v1_CostControlGlobalConfig(a.(*management.CostControlGlobalConfig), b.(*CostControlGlobalConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CostControlResourcePrice)(nil), (*management.CostControlResourcePrice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_CostControlResourcePrice_To_management_CostControlResourcePrice(a.(*CostControlResourcePrice), b.(*management.CostControlResourcePrice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.CostControlResourcePrice)(nil), (*CostControlResourcePrice)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_CostControlResourcePrice_To_v1_CostControlResourcePrice(a.(*management.CostControlResourcePrice), b.(*CostControlResourcePrice), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CostControlSettings)(nil), (*management.CostControlSettings)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_CostControlSettings_To_management_CostControlSettings(a.(*CostControlSettings), b.(*management.CostControlSettings), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.CostControlSettings)(nil), (*CostControlSettings)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_CostControlSettings_To_v1_CostControlSettings(a.(*management.CostControlSettings), b.(*CostControlSettings), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*DevPodDeleteOptions)(nil), (*management.DevPodDeleteOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_DevPodDeleteOptions_To_management_DevPodDeleteOptions(a.(*DevPodDeleteOptions), b.(*management.DevPodDeleteOptions), scope) }); err != nil { @@ -1009,6 +1070,66 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*DevPodWorkspaceInstanceTroubleshoot)(nil), (*management.DevPodWorkspaceInstanceTroubleshoot)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_DevPodWorkspaceInstanceTroubleshoot_To_management_DevPodWorkspaceInstanceTroubleshoot(a.(*DevPodWorkspaceInstanceTroubleshoot), b.(*management.DevPodWorkspaceInstanceTroubleshoot), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.DevPodWorkspaceInstanceTroubleshoot)(nil), (*DevPodWorkspaceInstanceTroubleshoot)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_DevPodWorkspaceInstanceTroubleshoot_To_v1_DevPodWorkspaceInstanceTroubleshoot(a.(*management.DevPodWorkspaceInstanceTroubleshoot), b.(*DevPodWorkspaceInstanceTroubleshoot), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*DevPodWorkspaceInstanceTroubleshootList)(nil), (*management.DevPodWorkspaceInstanceTroubleshootList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_DevPodWorkspaceInstanceTroubleshootList_To_management_DevPodWorkspaceInstanceTroubleshootList(a.(*DevPodWorkspaceInstanceTroubleshootList), b.(*management.DevPodWorkspaceInstanceTroubleshootList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.DevPodWorkspaceInstanceTroubleshootList)(nil), (*DevPodWorkspaceInstanceTroubleshootList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_DevPodWorkspaceInstanceTroubleshootList_To_v1_DevPodWorkspaceInstanceTroubleshootList(a.(*management.DevPodWorkspaceInstanceTroubleshootList), b.(*DevPodWorkspaceInstanceTroubleshootList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*DevPodWorkspacePreset)(nil), (*management.DevPodWorkspacePreset)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_DevPodWorkspacePreset_To_management_DevPodWorkspacePreset(a.(*DevPodWorkspacePreset), b.(*management.DevPodWorkspacePreset), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.DevPodWorkspacePreset)(nil), (*DevPodWorkspacePreset)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_DevPodWorkspacePreset_To_v1_DevPodWorkspacePreset(a.(*management.DevPodWorkspacePreset), b.(*DevPodWorkspacePreset), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*DevPodWorkspacePresetList)(nil), (*management.DevPodWorkspacePresetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_DevPodWorkspacePresetList_To_management_DevPodWorkspacePresetList(a.(*DevPodWorkspacePresetList), b.(*management.DevPodWorkspacePresetList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.DevPodWorkspacePresetList)(nil), (*DevPodWorkspacePresetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_DevPodWorkspacePresetList_To_v1_DevPodWorkspacePresetList(a.(*management.DevPodWorkspacePresetList), b.(*DevPodWorkspacePresetList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*DevPodWorkspacePresetSpec)(nil), (*management.DevPodWorkspacePresetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_DevPodWorkspacePresetSpec_To_management_DevPodWorkspacePresetSpec(a.(*DevPodWorkspacePresetSpec), b.(*management.DevPodWorkspacePresetSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.DevPodWorkspacePresetSpec)(nil), (*DevPodWorkspacePresetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_DevPodWorkspacePresetSpec_To_v1_DevPodWorkspacePresetSpec(a.(*management.DevPodWorkspacePresetSpec), b.(*DevPodWorkspacePresetSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*DevPodWorkspacePresetStatus)(nil), (*management.DevPodWorkspacePresetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_DevPodWorkspacePresetStatus_To_management_DevPodWorkspacePresetStatus(a.(*DevPodWorkspacePresetStatus), b.(*management.DevPodWorkspacePresetStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.DevPodWorkspacePresetStatus)(nil), (*DevPodWorkspacePresetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_DevPodWorkspacePresetStatus_To_v1_DevPodWorkspacePresetStatus(a.(*management.DevPodWorkspacePresetStatus), b.(*DevPodWorkspacePresetStatus), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*DevPodWorkspaceTemplate)(nil), (*management.DevPodWorkspaceTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_DevPodWorkspaceTemplate_To_management_DevPodWorkspaceTemplate(a.(*DevPodWorkspaceTemplate), b.(*management.DevPodWorkspaceTemplate), scope) }); err != nil { @@ -1419,6 +1540,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*MaintenanceWindow)(nil), (*management.MaintenanceWindow)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_MaintenanceWindow_To_management_MaintenanceWindow(a.(*MaintenanceWindow), b.(*management.MaintenanceWindow), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.MaintenanceWindow)(nil), (*MaintenanceWindow)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_MaintenanceWindow_To_v1_MaintenanceWindow(a.(*management.MaintenanceWindow), b.(*MaintenanceWindow), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*OIDC)(nil), (*management.OIDC)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_OIDC_To_management_OIDC(a.(*OIDC), b.(*management.OIDC), scope) }); err != nil { @@ -2659,6 +2790,46 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabase)(nil), (*management.VirtualClusterExternalDatabase)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(a.(*VirtualClusterExternalDatabase), b.(*management.VirtualClusterExternalDatabase), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabase)(nil), (*VirtualClusterExternalDatabase)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(a.(*management.VirtualClusterExternalDatabase), b.(*VirtualClusterExternalDatabase), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseList)(nil), (*management.VirtualClusterExternalDatabaseList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(a.(*VirtualClusterExternalDatabaseList), b.(*management.VirtualClusterExternalDatabaseList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseList)(nil), (*VirtualClusterExternalDatabaseList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(a.(*management.VirtualClusterExternalDatabaseList), b.(*VirtualClusterExternalDatabaseList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseSpec)(nil), (*management.VirtualClusterExternalDatabaseSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(a.(*VirtualClusterExternalDatabaseSpec), b.(*management.VirtualClusterExternalDatabaseSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseSpec)(nil), (*VirtualClusterExternalDatabaseSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(a.(*management.VirtualClusterExternalDatabaseSpec), b.(*VirtualClusterExternalDatabaseSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseStatus)(nil), (*management.VirtualClusterExternalDatabaseStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(a.(*VirtualClusterExternalDatabaseStatus), b.(*management.VirtualClusterExternalDatabaseStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseStatus)(nil), (*VirtualClusterExternalDatabaseStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(a.(*management.VirtualClusterExternalDatabaseStatus), b.(*VirtualClusterExternalDatabaseStatus), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*VirtualClusterInstance)(nil), (*management.VirtualClusterInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_VirtualClusterInstance_To_management_VirtualClusterInstance(a.(*VirtualClusterInstance), b.(*management.VirtualClusterInstance), scope) }); err != nil { @@ -3880,6 +4051,32 @@ func Convert_management_BackupStatus_To_v1_BackupStatus(in *management.BackupSta return autoConvert_management_BackupStatus_To_v1_BackupStatus(in, out, s) } +func autoConvert_v1_Cloud_To_management_Cloud(in *Cloud, out *management.Cloud, s conversion.Scope) error { + out.ReleaseChannel = in.ReleaseChannel + if err := Convert_v1_MaintenanceWindow_To_management_MaintenanceWindow(&in.MaintenanceWindow, &out.MaintenanceWindow, s); err != nil { + return err + } + return nil +} + +// Convert_v1_Cloud_To_management_Cloud is an autogenerated conversion function. +func Convert_v1_Cloud_To_management_Cloud(in *Cloud, out *management.Cloud, s conversion.Scope) error { + return autoConvert_v1_Cloud_To_management_Cloud(in, out, s) +} + +func autoConvert_management_Cloud_To_v1_Cloud(in *management.Cloud, out *Cloud, s conversion.Scope) error { + out.ReleaseChannel = in.ReleaseChannel + if err := Convert_management_MaintenanceWindow_To_v1_MaintenanceWindow(&in.MaintenanceWindow, &out.MaintenanceWindow, s); err != nil { + return err + } + return nil +} + +// Convert_management_Cloud_To_v1_Cloud is an autogenerated conversion function. +func Convert_management_Cloud_To_v1_Cloud(in *management.Cloud, out *Cloud, s conversion.Scope) error { + return autoConvert_management_Cloud_To_v1_Cloud(in, out, s) +} + func autoConvert_v1_Cluster_To_management_Cluster(in *Cluster, out *management.Cluster, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1_ClusterSpec_To_management_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { @@ -4717,6 +4914,8 @@ func autoConvert_v1_ConfigStatus_To_management_ConfigStatus(in *ConfigStatus, ou out.UISettings = (*uiv1.UISettingsConfig)(unsafe.Pointer(in.UISettings)) out.VaultIntegration = (*storagev1.VaultIntegrationSpec)(unsafe.Pointer(in.VaultIntegration)) out.DisableConfigEndpoint = in.DisableConfigEndpoint + out.Cloud = (*management.Cloud)(unsafe.Pointer(in.Cloud)) + out.CostControl = (*management.CostControl)(unsafe.Pointer(in.CostControl)) return nil } @@ -4738,6 +4937,8 @@ func autoConvert_management_ConfigStatus_To_v1_ConfigStatus(in *management.Confi out.UISettings = (*uiv1.UISettingsConfig)(unsafe.Pointer(in.UISettings)) out.VaultIntegration = (*storagev1.VaultIntegrationSpec)(unsafe.Pointer(in.VaultIntegration)) out.DisableConfigEndpoint = in.DisableConfigEndpoint + out.Cloud = (*Cloud)(unsafe.Pointer(in.Cloud)) + out.CostControl = (*CostControl)(unsafe.Pointer(in.CostControl)) return nil } @@ -4904,6 +5105,130 @@ func Convert_management_ConvertVirtualClusterConfigStatus_To_v1_ConvertVirtualCl return autoConvert_management_ConvertVirtualClusterConfigStatus_To_v1_ConvertVirtualClusterConfigStatus(in, out, s) } +func autoConvert_v1_CostControl_To_management_CostControl(in *CostControl, out *management.CostControl, s conversion.Scope) error { + out.Enabled = (*bool)(unsafe.Pointer(in.Enabled)) + if err := Convert_v1_CostControlGlobalConfig_To_management_CostControlGlobalConfig(&in.Global, &out.Global, s); err != nil { + return err + } + if err := Convert_v1_CostControlClusterConfig_To_management_CostControlClusterConfig(&in.Cluster, &out.Cluster, s); err != nil { + return err + } + out.Settings = (*management.CostControlSettings)(unsafe.Pointer(in.Settings)) + return nil +} + +// Convert_v1_CostControl_To_management_CostControl is an autogenerated conversion function. +func Convert_v1_CostControl_To_management_CostControl(in *CostControl, out *management.CostControl, s conversion.Scope) error { + return autoConvert_v1_CostControl_To_management_CostControl(in, out, s) +} + +func autoConvert_management_CostControl_To_v1_CostControl(in *management.CostControl, out *CostControl, s conversion.Scope) error { + out.Enabled = (*bool)(unsafe.Pointer(in.Enabled)) + if err := Convert_management_CostControlGlobalConfig_To_v1_CostControlGlobalConfig(&in.Global, &out.Global, s); err != nil { + return err + } + if err := Convert_management_CostControlClusterConfig_To_v1_CostControlClusterConfig(&in.Cluster, &out.Cluster, s); err != nil { + return err + } + out.Settings = (*CostControlSettings)(unsafe.Pointer(in.Settings)) + return nil +} + +// Convert_management_CostControl_To_v1_CostControl is an autogenerated conversion function. +func Convert_management_CostControl_To_v1_CostControl(in *management.CostControl, out *CostControl, s conversion.Scope) error { + return autoConvert_management_CostControl_To_v1_CostControl(in, out, s) +} + +func autoConvert_v1_CostControlClusterConfig_To_management_CostControlClusterConfig(in *CostControlClusterConfig, out *management.CostControlClusterConfig, s conversion.Scope) error { + out.Metrics = (*storagev1.Metrics)(unsafe.Pointer(in.Metrics)) + out.OpenCost = (*storagev1.OpenCost)(unsafe.Pointer(in.OpenCost)) + return nil +} + +// Convert_v1_CostControlClusterConfig_To_management_CostControlClusterConfig is an autogenerated conversion function. +func Convert_v1_CostControlClusterConfig_To_management_CostControlClusterConfig(in *CostControlClusterConfig, out *management.CostControlClusterConfig, s conversion.Scope) error { + return autoConvert_v1_CostControlClusterConfig_To_management_CostControlClusterConfig(in, out, s) +} + +func autoConvert_management_CostControlClusterConfig_To_v1_CostControlClusterConfig(in *management.CostControlClusterConfig, out *CostControlClusterConfig, s conversion.Scope) error { + out.Metrics = (*storagev1.Metrics)(unsafe.Pointer(in.Metrics)) + out.OpenCost = (*storagev1.OpenCost)(unsafe.Pointer(in.OpenCost)) + return nil +} + +// Convert_management_CostControlClusterConfig_To_v1_CostControlClusterConfig is an autogenerated conversion function. +func Convert_management_CostControlClusterConfig_To_v1_CostControlClusterConfig(in *management.CostControlClusterConfig, out *CostControlClusterConfig, s conversion.Scope) error { + return autoConvert_management_CostControlClusterConfig_To_v1_CostControlClusterConfig(in, out, s) +} + +func autoConvert_v1_CostControlGlobalConfig_To_management_CostControlGlobalConfig(in *CostControlGlobalConfig, out *management.CostControlGlobalConfig, s conversion.Scope) error { + out.Metrics = (*storagev1.Metrics)(unsafe.Pointer(in.Metrics)) + return nil +} + +// Convert_v1_CostControlGlobalConfig_To_management_CostControlGlobalConfig is an autogenerated conversion function. +func Convert_v1_CostControlGlobalConfig_To_management_CostControlGlobalConfig(in *CostControlGlobalConfig, out *management.CostControlGlobalConfig, s conversion.Scope) error { + return autoConvert_v1_CostControlGlobalConfig_To_management_CostControlGlobalConfig(in, out, s) +} + +func autoConvert_management_CostControlGlobalConfig_To_v1_CostControlGlobalConfig(in *management.CostControlGlobalConfig, out *CostControlGlobalConfig, s conversion.Scope) error { + out.Metrics = (*storagev1.Metrics)(unsafe.Pointer(in.Metrics)) + return nil +} + +// Convert_management_CostControlGlobalConfig_To_v1_CostControlGlobalConfig is an autogenerated conversion function. +func Convert_management_CostControlGlobalConfig_To_v1_CostControlGlobalConfig(in *management.CostControlGlobalConfig, out *CostControlGlobalConfig, s conversion.Scope) error { + return autoConvert_management_CostControlGlobalConfig_To_v1_CostControlGlobalConfig(in, out, s) +} + +func autoConvert_v1_CostControlResourcePrice_To_management_CostControlResourcePrice(in *CostControlResourcePrice, out *management.CostControlResourcePrice, s conversion.Scope) error { + out.Price = in.Price + out.TimePeriod = in.TimePeriod + return nil +} + +// Convert_v1_CostControlResourcePrice_To_management_CostControlResourcePrice is an autogenerated conversion function. +func Convert_v1_CostControlResourcePrice_To_management_CostControlResourcePrice(in *CostControlResourcePrice, out *management.CostControlResourcePrice, s conversion.Scope) error { + return autoConvert_v1_CostControlResourcePrice_To_management_CostControlResourcePrice(in, out, s) +} + +func autoConvert_management_CostControlResourcePrice_To_v1_CostControlResourcePrice(in *management.CostControlResourcePrice, out *CostControlResourcePrice, s conversion.Scope) error { + out.Price = in.Price + out.TimePeriod = in.TimePeriod + return nil +} + +// Convert_management_CostControlResourcePrice_To_v1_CostControlResourcePrice is an autogenerated conversion function. +func Convert_management_CostControlResourcePrice_To_v1_CostControlResourcePrice(in *management.CostControlResourcePrice, out *CostControlResourcePrice, s conversion.Scope) error { + return autoConvert_management_CostControlResourcePrice_To_v1_CostControlResourcePrice(in, out, s) +} + +func autoConvert_v1_CostControlSettings_To_management_CostControlSettings(in *CostControlSettings, out *management.CostControlSettings, s conversion.Scope) error { + out.PriceCurrency = in.PriceCurrency + out.AvgCPUPricePerNode = (*management.CostControlResourcePrice)(unsafe.Pointer(in.AvgCPUPricePerNode)) + out.AvgRAMPricePerNode = (*management.CostControlResourcePrice)(unsafe.Pointer(in.AvgRAMPricePerNode)) + out.ControlPlanePricePerCluster = (*management.CostControlResourcePrice)(unsafe.Pointer(in.ControlPlanePricePerCluster)) + return nil +} + +// Convert_v1_CostControlSettings_To_management_CostControlSettings is an autogenerated conversion function. +func Convert_v1_CostControlSettings_To_management_CostControlSettings(in *CostControlSettings, out *management.CostControlSettings, s conversion.Scope) error { + return autoConvert_v1_CostControlSettings_To_management_CostControlSettings(in, out, s) +} + +func autoConvert_management_CostControlSettings_To_v1_CostControlSettings(in *management.CostControlSettings, out *CostControlSettings, s conversion.Scope) error { + out.PriceCurrency = in.PriceCurrency + out.AvgCPUPricePerNode = (*CostControlResourcePrice)(unsafe.Pointer(in.AvgCPUPricePerNode)) + out.AvgRAMPricePerNode = (*CostControlResourcePrice)(unsafe.Pointer(in.AvgRAMPricePerNode)) + out.ControlPlanePricePerCluster = (*CostControlResourcePrice)(unsafe.Pointer(in.ControlPlanePricePerCluster)) + return nil +} + +// Convert_management_CostControlSettings_To_v1_CostControlSettings is an autogenerated conversion function. +func Convert_management_CostControlSettings_To_v1_CostControlSettings(in *management.CostControlSettings, out *CostControlSettings, s conversion.Scope) error { + return autoConvert_management_CostControlSettings_To_v1_CostControlSettings(in, out, s) +} + func autoConvert_v1_DevPodDeleteOptions_To_management_DevPodDeleteOptions(in *DevPodDeleteOptions, out *management.DevPodDeleteOptions, s conversion.Scope) error { out.Options = in.Options return nil @@ -5463,6 +5788,152 @@ func Convert_management_DevPodWorkspaceInstanceStatus_To_v1_DevPodWorkspaceInsta return autoConvert_management_DevPodWorkspaceInstanceStatus_To_v1_DevPodWorkspaceInstanceStatus(in, out, s) } +func autoConvert_v1_DevPodWorkspaceInstanceTroubleshoot_To_management_DevPodWorkspaceInstanceTroubleshoot(in *DevPodWorkspaceInstanceTroubleshoot, out *management.DevPodWorkspaceInstanceTroubleshoot, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + out.State = in.State + out.Workspace = (*management.DevPodWorkspaceInstance)(unsafe.Pointer(in.Workspace)) + out.Template = (*storagev1.DevPodWorkspaceTemplate)(unsafe.Pointer(in.Template)) + out.Pods = *(*[]corev1.Pod)(unsafe.Pointer(&in.Pods)) + out.PVCs = *(*[]corev1.PersistentVolumeClaim)(unsafe.Pointer(&in.PVCs)) + out.Errors = *(*[]string)(unsafe.Pointer(&in.Errors)) + return nil +} + +// Convert_v1_DevPodWorkspaceInstanceTroubleshoot_To_management_DevPodWorkspaceInstanceTroubleshoot is an autogenerated conversion function. +func Convert_v1_DevPodWorkspaceInstanceTroubleshoot_To_management_DevPodWorkspaceInstanceTroubleshoot(in *DevPodWorkspaceInstanceTroubleshoot, out *management.DevPodWorkspaceInstanceTroubleshoot, s conversion.Scope) error { + return autoConvert_v1_DevPodWorkspaceInstanceTroubleshoot_To_management_DevPodWorkspaceInstanceTroubleshoot(in, out, s) +} + +func autoConvert_management_DevPodWorkspaceInstanceTroubleshoot_To_v1_DevPodWorkspaceInstanceTroubleshoot(in *management.DevPodWorkspaceInstanceTroubleshoot, out *DevPodWorkspaceInstanceTroubleshoot, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + out.State = in.State + out.Workspace = (*DevPodWorkspaceInstance)(unsafe.Pointer(in.Workspace)) + out.Template = (*storagev1.DevPodWorkspaceTemplate)(unsafe.Pointer(in.Template)) + out.Pods = *(*[]corev1.Pod)(unsafe.Pointer(&in.Pods)) + out.PVCs = *(*[]corev1.PersistentVolumeClaim)(unsafe.Pointer(&in.PVCs)) + out.Errors = *(*[]string)(unsafe.Pointer(&in.Errors)) + return nil +} + +// Convert_management_DevPodWorkspaceInstanceTroubleshoot_To_v1_DevPodWorkspaceInstanceTroubleshoot is an autogenerated conversion function. +func Convert_management_DevPodWorkspaceInstanceTroubleshoot_To_v1_DevPodWorkspaceInstanceTroubleshoot(in *management.DevPodWorkspaceInstanceTroubleshoot, out *DevPodWorkspaceInstanceTroubleshoot, s conversion.Scope) error { + return autoConvert_management_DevPodWorkspaceInstanceTroubleshoot_To_v1_DevPodWorkspaceInstanceTroubleshoot(in, out, s) +} + +func autoConvert_v1_DevPodWorkspaceInstanceTroubleshootList_To_management_DevPodWorkspaceInstanceTroubleshootList(in *DevPodWorkspaceInstanceTroubleshootList, out *management.DevPodWorkspaceInstanceTroubleshootList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]management.DevPodWorkspaceInstanceTroubleshoot)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1_DevPodWorkspaceInstanceTroubleshootList_To_management_DevPodWorkspaceInstanceTroubleshootList is an autogenerated conversion function. +func Convert_v1_DevPodWorkspaceInstanceTroubleshootList_To_management_DevPodWorkspaceInstanceTroubleshootList(in *DevPodWorkspaceInstanceTroubleshootList, out *management.DevPodWorkspaceInstanceTroubleshootList, s conversion.Scope) error { + return autoConvert_v1_DevPodWorkspaceInstanceTroubleshootList_To_management_DevPodWorkspaceInstanceTroubleshootList(in, out, s) +} + +func autoConvert_management_DevPodWorkspaceInstanceTroubleshootList_To_v1_DevPodWorkspaceInstanceTroubleshootList(in *management.DevPodWorkspaceInstanceTroubleshootList, out *DevPodWorkspaceInstanceTroubleshootList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]DevPodWorkspaceInstanceTroubleshoot)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_management_DevPodWorkspaceInstanceTroubleshootList_To_v1_DevPodWorkspaceInstanceTroubleshootList is an autogenerated conversion function. +func Convert_management_DevPodWorkspaceInstanceTroubleshootList_To_v1_DevPodWorkspaceInstanceTroubleshootList(in *management.DevPodWorkspaceInstanceTroubleshootList, out *DevPodWorkspaceInstanceTroubleshootList, s conversion.Scope) error { + return autoConvert_management_DevPodWorkspaceInstanceTroubleshootList_To_v1_DevPodWorkspaceInstanceTroubleshootList(in, out, s) +} + +func autoConvert_v1_DevPodWorkspacePreset_To_management_DevPodWorkspacePreset(in *DevPodWorkspacePreset, out *management.DevPodWorkspacePreset, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1_DevPodWorkspacePresetSpec_To_management_DevPodWorkspacePresetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1_DevPodWorkspacePresetStatus_To_management_DevPodWorkspacePresetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1_DevPodWorkspacePreset_To_management_DevPodWorkspacePreset is an autogenerated conversion function. +func Convert_v1_DevPodWorkspacePreset_To_management_DevPodWorkspacePreset(in *DevPodWorkspacePreset, out *management.DevPodWorkspacePreset, s conversion.Scope) error { + return autoConvert_v1_DevPodWorkspacePreset_To_management_DevPodWorkspacePreset(in, out, s) +} + +func autoConvert_management_DevPodWorkspacePreset_To_v1_DevPodWorkspacePreset(in *management.DevPodWorkspacePreset, out *DevPodWorkspacePreset, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_management_DevPodWorkspacePresetSpec_To_v1_DevPodWorkspacePresetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_management_DevPodWorkspacePresetStatus_To_v1_DevPodWorkspacePresetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_management_DevPodWorkspacePreset_To_v1_DevPodWorkspacePreset is an autogenerated conversion function. +func Convert_management_DevPodWorkspacePreset_To_v1_DevPodWorkspacePreset(in *management.DevPodWorkspacePreset, out *DevPodWorkspacePreset, s conversion.Scope) error { + return autoConvert_management_DevPodWorkspacePreset_To_v1_DevPodWorkspacePreset(in, out, s) +} + +func autoConvert_v1_DevPodWorkspacePresetList_To_management_DevPodWorkspacePresetList(in *DevPodWorkspacePresetList, out *management.DevPodWorkspacePresetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]management.DevPodWorkspacePreset)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1_DevPodWorkspacePresetList_To_management_DevPodWorkspacePresetList is an autogenerated conversion function. +func Convert_v1_DevPodWorkspacePresetList_To_management_DevPodWorkspacePresetList(in *DevPodWorkspacePresetList, out *management.DevPodWorkspacePresetList, s conversion.Scope) error { + return autoConvert_v1_DevPodWorkspacePresetList_To_management_DevPodWorkspacePresetList(in, out, s) +} + +func autoConvert_management_DevPodWorkspacePresetList_To_v1_DevPodWorkspacePresetList(in *management.DevPodWorkspacePresetList, out *DevPodWorkspacePresetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]DevPodWorkspacePreset)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_management_DevPodWorkspacePresetList_To_v1_DevPodWorkspacePresetList is an autogenerated conversion function. +func Convert_management_DevPodWorkspacePresetList_To_v1_DevPodWorkspacePresetList(in *management.DevPodWorkspacePresetList, out *DevPodWorkspacePresetList, s conversion.Scope) error { + return autoConvert_management_DevPodWorkspacePresetList_To_v1_DevPodWorkspacePresetList(in, out, s) +} + +func autoConvert_v1_DevPodWorkspacePresetSpec_To_management_DevPodWorkspacePresetSpec(in *DevPodWorkspacePresetSpec, out *management.DevPodWorkspacePresetSpec, s conversion.Scope) error { + out.DevPodWorkspacePresetSpec = in.DevPodWorkspacePresetSpec + return nil +} + +// Convert_v1_DevPodWorkspacePresetSpec_To_management_DevPodWorkspacePresetSpec is an autogenerated conversion function. +func Convert_v1_DevPodWorkspacePresetSpec_To_management_DevPodWorkspacePresetSpec(in *DevPodWorkspacePresetSpec, out *management.DevPodWorkspacePresetSpec, s conversion.Scope) error { + return autoConvert_v1_DevPodWorkspacePresetSpec_To_management_DevPodWorkspacePresetSpec(in, out, s) +} + +func autoConvert_management_DevPodWorkspacePresetSpec_To_v1_DevPodWorkspacePresetSpec(in *management.DevPodWorkspacePresetSpec, out *DevPodWorkspacePresetSpec, s conversion.Scope) error { + out.DevPodWorkspacePresetSpec = in.DevPodWorkspacePresetSpec + return nil +} + +// Convert_management_DevPodWorkspacePresetSpec_To_v1_DevPodWorkspacePresetSpec is an autogenerated conversion function. +func Convert_management_DevPodWorkspacePresetSpec_To_v1_DevPodWorkspacePresetSpec(in *management.DevPodWorkspacePresetSpec, out *DevPodWorkspacePresetSpec, s conversion.Scope) error { + return autoConvert_management_DevPodWorkspacePresetSpec_To_v1_DevPodWorkspacePresetSpec(in, out, s) +} + +func autoConvert_v1_DevPodWorkspacePresetStatus_To_management_DevPodWorkspacePresetStatus(in *DevPodWorkspacePresetStatus, out *management.DevPodWorkspacePresetStatus, s conversion.Scope) error { + return nil +} + +// Convert_v1_DevPodWorkspacePresetStatus_To_management_DevPodWorkspacePresetStatus is an autogenerated conversion function. +func Convert_v1_DevPodWorkspacePresetStatus_To_management_DevPodWorkspacePresetStatus(in *DevPodWorkspacePresetStatus, out *management.DevPodWorkspacePresetStatus, s conversion.Scope) error { + return autoConvert_v1_DevPodWorkspacePresetStatus_To_management_DevPodWorkspacePresetStatus(in, out, s) +} + +func autoConvert_management_DevPodWorkspacePresetStatus_To_v1_DevPodWorkspacePresetStatus(in *management.DevPodWorkspacePresetStatus, out *DevPodWorkspacePresetStatus, s conversion.Scope) error { + return nil +} + +// Convert_management_DevPodWorkspacePresetStatus_To_v1_DevPodWorkspacePresetStatus is an autogenerated conversion function. +func Convert_management_DevPodWorkspacePresetStatus_To_v1_DevPodWorkspacePresetStatus(in *management.DevPodWorkspacePresetStatus, out *DevPodWorkspacePresetStatus, s conversion.Scope) error { + return autoConvert_management_DevPodWorkspacePresetStatus_To_v1_DevPodWorkspacePresetStatus(in, out, s) +} + func autoConvert_v1_DevPodWorkspaceTemplate_To_management_DevPodWorkspaceTemplate(in *DevPodWorkspaceTemplate, out *management.DevPodWorkspaceTemplate, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1_DevPodWorkspaceTemplateSpec_To_management_DevPodWorkspaceTemplateSpec(&in.Spec, &out.Spec, s); err != nil { @@ -6449,6 +6920,28 @@ func Convert_management_LoftUpgradeStatus_To_v1_LoftUpgradeStatus(in *management return autoConvert_management_LoftUpgradeStatus_To_v1_LoftUpgradeStatus(in, out, s) } +func autoConvert_v1_MaintenanceWindow_To_management_MaintenanceWindow(in *MaintenanceWindow, out *management.MaintenanceWindow, s conversion.Scope) error { + out.DayOfWeek = in.DayOfWeek + out.TimeWindow = in.TimeWindow + return nil +} + +// Convert_v1_MaintenanceWindow_To_management_MaintenanceWindow is an autogenerated conversion function. +func Convert_v1_MaintenanceWindow_To_management_MaintenanceWindow(in *MaintenanceWindow, out *management.MaintenanceWindow, s conversion.Scope) error { + return autoConvert_v1_MaintenanceWindow_To_management_MaintenanceWindow(in, out, s) +} + +func autoConvert_management_MaintenanceWindow_To_v1_MaintenanceWindow(in *management.MaintenanceWindow, out *MaintenanceWindow, s conversion.Scope) error { + out.DayOfWeek = in.DayOfWeek + out.TimeWindow = in.TimeWindow + return nil +} + +// Convert_management_MaintenanceWindow_To_v1_MaintenanceWindow is an autogenerated conversion function. +func Convert_management_MaintenanceWindow_To_v1_MaintenanceWindow(in *management.MaintenanceWindow, out *MaintenanceWindow, s conversion.Scope) error { + return autoConvert_management_MaintenanceWindow_To_v1_MaintenanceWindow(in, out, s) +} + func autoConvert_v1_OIDC_To_management_OIDC(in *OIDC, out *management.OIDC, s conversion.Scope) error { out.Enabled = in.Enabled out.WildcardRedirect = in.WildcardRedirect @@ -7410,6 +7903,7 @@ func autoConvert_v1_ProjectTemplates_To_management_ProjectTemplates(in *ProjectT out.DefaultDevPodWorkspaceTemplate = in.DefaultDevPodWorkspaceTemplate out.DevPodWorkspaceTemplates = *(*[]management.DevPodWorkspaceTemplate)(unsafe.Pointer(&in.DevPodWorkspaceTemplates)) out.DevPodEnvironmentTemplates = *(*[]management.DevPodEnvironmentTemplate)(unsafe.Pointer(&in.DevPodEnvironmentTemplates)) + out.DevPodWorkspacePresets = *(*[]management.DevPodWorkspacePreset)(unsafe.Pointer(&in.DevPodWorkspacePresets)) out.DefaultDevPodEnvironmentTemplate = in.DefaultDevPodEnvironmentTemplate return nil } @@ -7428,6 +7922,7 @@ func autoConvert_management_ProjectTemplates_To_v1_ProjectTemplates(in *manageme out.DefaultDevPodWorkspaceTemplate = in.DefaultDevPodWorkspaceTemplate out.DevPodWorkspaceTemplates = *(*[]DevPodWorkspaceTemplate)(unsafe.Pointer(&in.DevPodWorkspaceTemplates)) out.DevPodEnvironmentTemplates = *(*[]DevPodEnvironmentTemplate)(unsafe.Pointer(&in.DevPodEnvironmentTemplates)) + out.DevPodWorkspacePresets = *(*[]DevPodWorkspacePreset)(unsafe.Pointer(&in.DevPodWorkspacePresets)) out.DefaultDevPodEnvironmentTemplate = in.DefaultDevPodEnvironmentTemplate return nil } @@ -9532,6 +10027,100 @@ func Convert_management_VirtualClusterAccessKeyList_To_v1_VirtualClusterAccessKe return autoConvert_management_VirtualClusterAccessKeyList_To_v1_VirtualClusterAccessKeyList(in, out, s) } +func autoConvert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in *VirtualClusterExternalDatabase, out *management.VirtualClusterExternalDatabase, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in *VirtualClusterExternalDatabase, out *management.VirtualClusterExternalDatabase, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in *management.VirtualClusterExternalDatabase, out *VirtualClusterExternalDatabase, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in *management.VirtualClusterExternalDatabase, out *VirtualClusterExternalDatabase, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in *VirtualClusterExternalDatabaseList, out *management.VirtualClusterExternalDatabaseList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]management.VirtualClusterExternalDatabase)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in *VirtualClusterExternalDatabaseList, out *management.VirtualClusterExternalDatabaseList, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in *management.VirtualClusterExternalDatabaseList, out *VirtualClusterExternalDatabaseList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualClusterExternalDatabase)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in *management.VirtualClusterExternalDatabaseList, out *VirtualClusterExternalDatabaseList, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in *VirtualClusterExternalDatabaseSpec, out *management.VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + out.Connector = in.Connector + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in *VirtualClusterExternalDatabaseSpec, out *management.VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in *management.VirtualClusterExternalDatabaseSpec, out *VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + out.Connector = in.Connector + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in *management.VirtualClusterExternalDatabaseSpec, out *VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in *VirtualClusterExternalDatabaseStatus, out *management.VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + out.DataSource = in.DataSource + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in *VirtualClusterExternalDatabaseStatus, out *management.VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in *management.VirtualClusterExternalDatabaseStatus, out *VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + out.DataSource = in.DataSource + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in *management.VirtualClusterExternalDatabaseStatus, out *VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in, out, s) +} + func autoConvert_v1_VirtualClusterInstance_To_management_VirtualClusterInstance(in *VirtualClusterInstance, out *management.VirtualClusterInstance, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1_VirtualClusterInstanceSpec_To_management_VirtualClusterInstanceSpec(&in.Spec, &out.Spec, s); err != nil { diff --git a/pkg/apis/management/v1/zz_generated.deepcopy.go b/pkg/apis/management/v1/zz_generated.deepcopy.go index 0dbb4fb..dbcf7a9 100644 --- a/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -12,6 +12,7 @@ import ( auditv1 "github.com/loft-sh/api/v4/pkg/apis/audit/v1" storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" uiv1 "github.com/loft-sh/api/v4/pkg/apis/ui/v1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -995,13 +996,30 @@ func (in *BackupStatus) DeepCopy() *BackupStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cloud) DeepCopyInto(out *Cloud) { + *out = *in + out.MaintenanceWindow = in.MaintenanceWindow + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cloud. +func (in *Cloud) DeepCopy() *Cloud { + if in == nil { + return nil + } + out := new(Cloud) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) return } @@ -1817,7 +1835,7 @@ func (in *ClusterSpec) DeepCopy() *ClusterSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { *out = *in - out.ClusterStatus = in.ClusterStatus + in.ClusterStatus.DeepCopyInto(&out.ClusterStatus) return } @@ -2011,6 +2029,16 @@ func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus) { *out = new(storagev1.VaultIntegrationSpec) (*in).DeepCopyInto(*out) } + if in.Cloud != nil { + in, out := &in.Cloud, &out.Cloud + *out = new(Cloud) + **out = **in + } + if in.CostControl != nil { + in, out := &in.CostControl, &out.CostControl + *out = new(CostControl) + (*in).DeepCopyInto(*out) + } return } @@ -2187,6 +2215,128 @@ func (in *ConvertVirtualClusterConfigStatus) DeepCopy() *ConvertVirtualClusterCo return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControl) DeepCopyInto(out *CostControl) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + in.Global.DeepCopyInto(&out.Global) + in.Cluster.DeepCopyInto(&out.Cluster) + if in.Settings != nil { + in, out := &in.Settings, &out.Settings + *out = new(CostControlSettings) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControl. +func (in *CostControl) DeepCopy() *CostControl { + if in == nil { + return nil + } + out := new(CostControl) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControlClusterConfig) DeepCopyInto(out *CostControlClusterConfig) { + *out = *in + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = new(storagev1.Metrics) + (*in).DeepCopyInto(*out) + } + if in.OpenCost != nil { + in, out := &in.OpenCost, &out.OpenCost + *out = new(storagev1.OpenCost) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControlClusterConfig. +func (in *CostControlClusterConfig) DeepCopy() *CostControlClusterConfig { + if in == nil { + return nil + } + out := new(CostControlClusterConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControlGlobalConfig) DeepCopyInto(out *CostControlGlobalConfig) { + *out = *in + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = new(storagev1.Metrics) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControlGlobalConfig. +func (in *CostControlGlobalConfig) DeepCopy() *CostControlGlobalConfig { + if in == nil { + return nil + } + out := new(CostControlGlobalConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControlResourcePrice) DeepCopyInto(out *CostControlResourcePrice) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControlResourcePrice. +func (in *CostControlResourcePrice) DeepCopy() *CostControlResourcePrice { + if in == nil { + return nil + } + out := new(CostControlResourcePrice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControlSettings) DeepCopyInto(out *CostControlSettings) { + *out = *in + if in.AvgCPUPricePerNode != nil { + in, out := &in.AvgCPUPricePerNode, &out.AvgCPUPricePerNode + *out = new(CostControlResourcePrice) + **out = **in + } + if in.AvgRAMPricePerNode != nil { + in, out := &in.AvgRAMPricePerNode, &out.AvgRAMPricePerNode + *out = new(CostControlResourcePrice) + **out = **in + } + if in.ControlPlanePricePerCluster != nil { + in, out := &in.ControlPlanePricePerCluster, &out.ControlPlanePricePerCluster + *out = new(CostControlResourcePrice) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControlSettings. +func (in *CostControlSettings) DeepCopy() *CostControlSettings { + if in == nil { + return nil + } + out := new(CostControlSettings) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevPodDeleteOptions) DeepCopyInto(out *DevPodDeleteOptions) { *out = *in @@ -2720,6 +2870,205 @@ func (in *DevPodWorkspaceInstanceStatus) DeepCopy() *DevPodWorkspaceInstanceStat return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspaceInstanceTroubleshoot) DeepCopyInto(out *DevPodWorkspaceInstanceTroubleshoot) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Workspace != nil { + in, out := &in.Workspace, &out.Workspace + *out = new(DevPodWorkspaceInstance) + (*in).DeepCopyInto(*out) + } + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(storagev1.DevPodWorkspaceTemplate) + (*in).DeepCopyInto(*out) + } + if in.Pods != nil { + in, out := &in.Pods, &out.Pods + *out = make([]corev1.Pod, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PVCs != nil { + in, out := &in.PVCs, &out.PVCs + *out = make([]corev1.PersistentVolumeClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Errors != nil { + in, out := &in.Errors, &out.Errors + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspaceInstanceTroubleshoot. +func (in *DevPodWorkspaceInstanceTroubleshoot) DeepCopy() *DevPodWorkspaceInstanceTroubleshoot { + if in == nil { + return nil + } + out := new(DevPodWorkspaceInstanceTroubleshoot) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspaceInstanceTroubleshoot) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspaceInstanceTroubleshootList) DeepCopyInto(out *DevPodWorkspaceInstanceTroubleshootList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DevPodWorkspaceInstanceTroubleshoot, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspaceInstanceTroubleshootList. +func (in *DevPodWorkspaceInstanceTroubleshootList) DeepCopy() *DevPodWorkspaceInstanceTroubleshootList { + if in == nil { + return nil + } + out := new(DevPodWorkspaceInstanceTroubleshootList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspaceInstanceTroubleshootList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePreset) DeepCopyInto(out *DevPodWorkspacePreset) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePreset. +func (in *DevPodWorkspacePreset) DeepCopy() *DevPodWorkspacePreset { + if in == nil { + return nil + } + out := new(DevPodWorkspacePreset) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspacePreset) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetList) DeepCopyInto(out *DevPodWorkspacePresetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DevPodWorkspacePreset, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetList. +func (in *DevPodWorkspacePresetList) DeepCopy() *DevPodWorkspacePresetList { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspacePresetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetSource) DeepCopyInto(out *DevPodWorkspacePresetSource) { + *out = *in + out.DevPodWorkspacePresetSource = in.DevPodWorkspacePresetSource + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetSource. +func (in *DevPodWorkspacePresetSource) DeepCopy() *DevPodWorkspacePresetSource { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetSpec) DeepCopyInto(out *DevPodWorkspacePresetSpec) { + *out = *in + in.DevPodWorkspacePresetSpec.DeepCopyInto(&out.DevPodWorkspacePresetSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetSpec. +func (in *DevPodWorkspacePresetSpec) DeepCopy() *DevPodWorkspacePresetSpec { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetStatus) DeepCopyInto(out *DevPodWorkspacePresetStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetStatus. +func (in *DevPodWorkspacePresetStatus) DeepCopy() *DevPodWorkspacePresetStatus { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevPodWorkspaceTemplate) DeepCopyInto(out *DevPodWorkspaceTemplate) { *out = *in @@ -3101,22 +3450,6 @@ func (in *FeatureStatus) DeepCopy() *FeatureStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitEnvironmentTemplate) DeepCopyInto(out *GitEnvironmentTemplate) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitEnvironmentTemplate. -func (in *GitEnvironmentTemplate) DeepCopy() *GitEnvironmentTemplate { - if in == nil { - return nil - } - out := new(GitEnvironmentTemplate) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GroupResources) DeepCopyInto(out *GroupResources) { *out = *in @@ -3730,6 +4063,22 @@ func (in *LoftUpgradeStatus) DeepCopy() *LoftUpgradeStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceWindow) DeepCopyInto(out *MaintenanceWindow) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceWindow. +func (in *MaintenanceWindow) DeepCopy() *MaintenanceWindow { + if in == nil { + return nil + } + out := new(MaintenanceWindow) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OIDC) DeepCopyInto(out *OIDC) { *out = *in @@ -4836,6 +5185,13 @@ func (in *ProjectTemplates) DeepCopyInto(out *ProjectTemplates) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.DevPodWorkspacePresets != nil { + in, out := &in.DevPodWorkspacePresets, &out.DevPodWorkspacePresets + *out = make([]DevPodWorkspacePreset, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -7106,6 +7462,99 @@ func (in *VirtualClusterAccessKeyList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabase) DeepCopyInto(out *VirtualClusterExternalDatabase) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabase. +func (in *VirtualClusterExternalDatabase) DeepCopy() *VirtualClusterExternalDatabase { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabase) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseList) DeepCopyInto(out *VirtualClusterExternalDatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualClusterExternalDatabase, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseList. +func (in *VirtualClusterExternalDatabaseList) DeepCopy() *VirtualClusterExternalDatabaseList { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabaseList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopyInto(out *VirtualClusterExternalDatabaseSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseSpec. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopy() *VirtualClusterExternalDatabaseSpec { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopyInto(out *VirtualClusterExternalDatabaseStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseStatus. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopy() *VirtualClusterExternalDatabaseStatus { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualClusterInstance) DeepCopyInto(out *VirtualClusterInstance) { *out = *in diff --git a/pkg/apis/management/v1/zz_generated.defaults.go b/pkg/apis/management/v1/zz_generated.defaults.go index d7e4331..dcd0a96 100644 --- a/pkg/apis/management/v1/zz_generated.defaults.go +++ b/pkg/apis/management/v1/zz_generated.defaults.go @@ -14,6 +14,12 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&DevPodWorkspaceInstanceTroubleshoot{}, func(obj interface{}) { + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(obj.(*DevPodWorkspaceInstanceTroubleshoot)) + }) + scheme.AddTypeDefaultingFunc(&DevPodWorkspaceInstanceTroubleshootList{}, func(obj interface{}) { + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshootList(obj.(*DevPodWorkspaceInstanceTroubleshootList)) + }) scheme.AddTypeDefaultingFunc(&ProjectClusters{}, func(obj interface{}) { SetObjectDefaults_ProjectClusters(obj.(*ProjectClusters)) }) scheme.AddTypeDefaultingFunc(&ProjectClustersList{}, func(obj interface{}) { SetObjectDefaults_ProjectClustersList(obj.(*ProjectClustersList)) }) scheme.AddTypeDefaultingFunc(&ProjectRunners{}, func(obj interface{}) { SetObjectDefaults_ProjectRunners(obj.(*ProjectRunners)) }) @@ -23,6 +29,163 @@ func RegisterDefaults(scheme *runtime.Scheme) error { return nil } +func SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(in *DevPodWorkspaceInstanceTroubleshoot) { + for i := range in.Pods { + a := &in.Pods[i] + for j := range a.Spec.Volumes { + b := &a.Spec.Volumes[j] + if b.VolumeSource.ISCSI != nil { + if b.VolumeSource.ISCSI.ISCSIInterface == "" { + b.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if b.VolumeSource.RBD != nil { + if b.VolumeSource.RBD.RBDPool == "" { + b.VolumeSource.RBD.RBDPool = "rbd" + } + if b.VolumeSource.RBD.RadosUser == "" { + b.VolumeSource.RBD.RadosUser = "admin" + } + if b.VolumeSource.RBD.Keyring == "" { + b.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if b.VolumeSource.AzureDisk != nil { + if b.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + b.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if b.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + b.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if b.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + b.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if b.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + b.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if b.VolumeSource.ScaleIO != nil { + if b.VolumeSource.ScaleIO.StorageMode == "" { + b.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if b.VolumeSource.ScaleIO.FSType == "" { + b.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + for j := range a.Spec.InitContainers { + b := &a.Spec.InitContainers[j] + for k := range b.Ports { + c := &b.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.LivenessProbe != nil { + if b.LivenessProbe.ProbeHandler.GRPC != nil { + if b.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.ReadinessProbe != nil { + if b.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.StartupProbe != nil { + if b.StartupProbe.ProbeHandler.GRPC != nil { + if b.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for j := range a.Spec.Containers { + b := &a.Spec.Containers[j] + for k := range b.Ports { + c := &b.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.LivenessProbe != nil { + if b.LivenessProbe.ProbeHandler.GRPC != nil { + if b.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.ReadinessProbe != nil { + if b.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.StartupProbe != nil { + if b.StartupProbe.ProbeHandler.GRPC != nil { + if b.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for j := range a.Spec.EphemeralContainers { + b := &a.Spec.EphemeralContainers[j] + for k := range b.EphemeralContainerCommon.Ports { + c := &b.EphemeralContainerCommon.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.EphemeralContainerCommon.LivenessProbe != nil { + if b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.EphemeralContainerCommon.ReadinessProbe != nil { + if b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.EphemeralContainerCommon.StartupProbe != nil { + if b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + } +} + +func SetObjectDefaults_DevPodWorkspaceInstanceTroubleshootList(in *DevPodWorkspaceInstanceTroubleshootList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(a) + } +} + func SetObjectDefaults_ProjectClusters(in *ProjectClusters) { for i := range in.Runners { a := &in.Runners[i] diff --git a/pkg/apis/management/zz_generated.api.register.go b/pkg/apis/management/zz_generated.api.register.go index 15c51fd..0489151 100644 --- a/pkg/apis/management/zz_generated.api.register.go +++ b/pkg/apis/management/zz_generated.api.register.go @@ -15,6 +15,7 @@ import ( "github.com/loft-sh/api/v4/pkg/managerfactory" "github.com/loft-sh/apiserver/pkg/builders" authorizationv1 "k8s.io/api/authorization/v1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -76,7 +77,11 @@ var ( NewClusterREST = func(getter generic.RESTOptionsGetter) rest.Storage { return NewClusterRESTFunc(Factory) } - NewClusterRESTFunc NewRESTFunc + NewClusterRESTFunc NewRESTFunc + NewClusterStatusREST = func(getter generic.RESTOptionsGetter) rest.Storage { + return NewClusterStatusRESTFunc(Factory) + } + NewClusterStatusRESTFunc NewRESTFunc ManagementClusterAccessStorage = builders.NewApiResourceWithStorage( // Resource status endpoint InternalClusterAccess, func() runtime.Object { return &ClusterAccess{} }, // Register versioned resource @@ -136,7 +141,17 @@ var ( NewDevPodWorkspaceInstanceREST = func(getter generic.RESTOptionsGetter) rest.Storage { return NewDevPodWorkspaceInstanceRESTFunc(Factory) } - NewDevPodWorkspaceInstanceRESTFunc NewRESTFunc + NewDevPodWorkspaceInstanceRESTFunc NewRESTFunc + ManagementDevPodWorkspacePresetStorage = builders.NewApiResourceWithStorage( // Resource status endpoint + InternalDevPodWorkspacePreset, + func() runtime.Object { return &DevPodWorkspacePreset{} }, // Register versioned resource + func() runtime.Object { return &DevPodWorkspacePresetList{} }, // Register versioned resource list + NewDevPodWorkspacePresetREST, + ) + NewDevPodWorkspacePresetREST = func(getter generic.RESTOptionsGetter) rest.Storage { + return NewDevPodWorkspacePresetRESTFunc(Factory) + } + NewDevPodWorkspacePresetRESTFunc NewRESTFunc ManagementDevPodWorkspaceTemplateStorage = builders.NewApiResourceWithStorage( // Resource status endpoint InternalDevPodWorkspaceTemplate, func() runtime.Object { return &DevPodWorkspaceTemplate{} }, // Register versioned resource @@ -690,15 +705,35 @@ var ( NewDevPodStopOptionsREST = func(getter generic.RESTOptionsGetter) rest.Storage { return NewDevPodStopOptionsRESTFunc(Factory) } - NewDevPodStopOptionsRESTFunc NewRESTFunc - InternalDevPodUpOptionsREST = builders.NewInternalSubresource( + NewDevPodStopOptionsRESTFunc NewRESTFunc + InternalDevPodWorkspaceInstanceTroubleshootREST = builders.NewInternalSubresource( + "devpodworkspaceinstances", "DevPodWorkspaceInstanceTroubleshoot", "troubleshoot", + func() runtime.Object { return &DevPodWorkspaceInstanceTroubleshoot{} }, + ) + NewDevPodWorkspaceInstanceTroubleshootREST = func(getter generic.RESTOptionsGetter) rest.Storage { + return NewDevPodWorkspaceInstanceTroubleshootRESTFunc(Factory) + } + NewDevPodWorkspaceInstanceTroubleshootRESTFunc NewRESTFunc + InternalDevPodUpOptionsREST = builders.NewInternalSubresource( "devpodworkspaceinstances", "DevPodUpOptions", "up", func() runtime.Object { return &DevPodUpOptions{} }, ) NewDevPodUpOptionsREST = func(getter generic.RESTOptionsGetter) rest.Storage { return NewDevPodUpOptionsRESTFunc(Factory) } - NewDevPodUpOptionsRESTFunc NewRESTFunc + NewDevPodUpOptionsRESTFunc NewRESTFunc + InternalDevPodWorkspacePreset = builders.NewInternalResource( + "devpodworkspacepresets", + "DevPodWorkspacePreset", + func() runtime.Object { return &DevPodWorkspacePreset{} }, + func() runtime.Object { return &DevPodWorkspacePresetList{} }, + ) + InternalDevPodWorkspacePresetStatus = builders.NewInternalResourceStatus( + "devpodworkspacepresets", + "DevPodWorkspacePresetStatus", + func() runtime.Object { return &DevPodWorkspacePreset{} }, + func() runtime.Object { return &DevPodWorkspacePresetList{} }, + ) InternalDevPodWorkspaceTemplate = builders.NewInternalResource( "devpodworkspacetemplates", "DevPodWorkspaceTemplate", @@ -1194,7 +1229,15 @@ var ( NewVirtualClusterAccessKeyREST = func(getter generic.RESTOptionsGetter) rest.Storage { return NewVirtualClusterAccessKeyRESTFunc(Factory) } - NewVirtualClusterAccessKeyRESTFunc NewRESTFunc + NewVirtualClusterAccessKeyRESTFunc NewRESTFunc + InternalVirtualClusterExternalDatabaseREST = builders.NewInternalSubresource( + "virtualclusterinstances", "VirtualClusterExternalDatabase", "externaldatabase", + func() runtime.Object { return &VirtualClusterExternalDatabase{} }, + ) + NewVirtualClusterExternalDatabaseREST = func(getter generic.RESTOptionsGetter) rest.Storage { + return NewVirtualClusterExternalDatabaseRESTFunc(Factory) + } + NewVirtualClusterExternalDatabaseRESTFunc NewRESTFunc InternalVirtualClusterInstanceKubeConfigREST = builders.NewInternalSubresource( "virtualclusterinstances", "VirtualClusterInstanceKubeConfig", "kubeconfig", func() runtime.Object { return &VirtualClusterInstanceKubeConfig{} }, @@ -1262,7 +1305,10 @@ var ( InternalDevPodSshOptionsREST, InternalDevPodWorkspaceInstanceStateREST, InternalDevPodStopOptionsREST, + InternalDevPodWorkspaceInstanceTroubleshootREST, InternalDevPodUpOptionsREST, + InternalDevPodWorkspacePreset, + InternalDevPodWorkspacePresetStatus, InternalDevPodWorkspaceTemplate, InternalDevPodWorkspaceTemplateStatus, InternalDirectClusterEndpointToken, @@ -1339,6 +1385,7 @@ var ( InternalVirtualClusterInstance, InternalVirtualClusterInstanceStatus, InternalVirtualClusterAccessKeyREST, + InternalVirtualClusterExternalDatabaseREST, InternalVirtualClusterInstanceKubeConfigREST, InternalVirtualClusterInstanceLogREST, InternalVirtualClusterTemplate, @@ -1623,6 +1670,11 @@ type BackupStatus struct { RawBackup string `json:"rawBackup,omitempty"` } +type Cloud struct { + ReleaseChannel string `json:"releaseChannel,omitempty"` + MaintenanceWindow MaintenanceWindow `json:"maintenanceWindow,omitempty"` +} + // +genclient // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -1806,6 +1858,8 @@ type ConfigStatus struct { UISettings *uiv1.UISettingsConfig `json:"uiSettings,omitempty"` VaultIntegration *storagev1.VaultIntegrationSpec `json:"vault,omitempty"` DisableConfigEndpoint bool `json:"disableConfigEndpoint,omitempty"` + Cloud *Cloud `json:"cloud,omitempty"` + CostControl *CostControl `json:"costControl,omitempty"` } type Connector struct { @@ -1845,6 +1899,34 @@ type ConvertVirtualClusterConfigStatus struct { Converted bool `json:"converted"` } +type CostControl struct { + Enabled *bool `json:"enabled,omitempty"` + Global CostControlGlobalConfig `json:"global,omitempty"` + Cluster CostControlClusterConfig `json:"cluster,omitempty"` + Settings *CostControlSettings `json:"settings,omitempty"` +} + +type CostControlClusterConfig struct { + Metrics *storagev1.Metrics `json:"metrics,omitempty"` + OpenCost *storagev1.OpenCost `json:"opencost,omitempty"` +} + +type CostControlGlobalConfig struct { + Metrics *storagev1.Metrics `json:"metrics,omitempty"` +} + +type CostControlResourcePrice struct { + Price float64 `json:"price,omitempty"` + TimePeriod string `json:"timePeriod,omitempty"` +} + +type CostControlSettings struct { + PriceCurrency string `json:"priceCurrency,omitempty"` + AvgCPUPricePerNode *CostControlResourcePrice `json:"averageCPUPricePerNode,omitempty"` + AvgRAMPricePerNode *CostControlResourcePrice `json:"averageRAMPricePerNode,omitempty"` + ControlPlanePricePerCluster *CostControlResourcePrice `json:"controlPlanePricePerCluster,omitempty"` +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type DevPodDeleteOptions struct { @@ -1929,6 +2011,37 @@ type DevPodWorkspaceInstanceStatus struct { SleepModeConfig *clusterv1.SleepModeConfig `json:"sleepModeConfig,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type DevPodWorkspaceInstanceTroubleshoot struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + State string `json:"state,omitempty"` + Workspace *DevPodWorkspaceInstance `json:"workspace,omitempty"` + Template *storagev1.DevPodWorkspaceTemplate `json:"template,omitempty"` + Pods []corev1.Pod `json:"pods,omitempty"` + PVCs []corev1.PersistentVolumeClaim `json:"pvcs,omitempty"` + Errors []string `json:"errors,omitempty"` +} + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type DevPodWorkspacePreset struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec DevPodWorkspacePresetSpec `json:"spec,omitempty"` + Status DevPodWorkspacePresetStatus `json:"status,omitempty"` +} + +type DevPodWorkspacePresetSpec struct { + storagev1.DevPodWorkspacePresetSpec `json:",inline"` +} + +type DevPodWorkspacePresetStatus struct { +} + // +genclient // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -2056,7 +2169,7 @@ type KioskStatus struct { } // +genclient -// +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type License struct { @@ -2132,6 +2245,11 @@ type LoftUpgradeSpec struct { type LoftUpgradeStatus struct { } +type MaintenanceWindow struct { + DayOfWeek string `json:"dayOfWeek,omitempty"` + TimeWindow string `json:"timeWindow,omitempty"` +} + type OIDC struct { Enabled bool `json:"enabled,omitempty"` WildcardRedirect bool `json:"wildcardRedirect,omitempty"` @@ -2338,6 +2456,7 @@ type ProjectTemplates struct { DefaultDevPodWorkspaceTemplate string `json:"defaultDevPodWorkspaceTemplate,omitempty"` DevPodWorkspaceTemplates []DevPodWorkspaceTemplate `json:"devPodWorkspaceTemplates,omitempty"` DevPodEnvironmentTemplates []DevPodEnvironmentTemplate `json:"devPodEnvironmentTemplates,omitempty"` + DevPodWorkspacePresets []DevPodWorkspacePreset `json:"devPodWorkspacePresets,omitempty"` DefaultDevPodEnvironmentTemplate string `json:"defaultDevPodEnvironmentTemplate,omitempty"` } @@ -2729,6 +2848,23 @@ type VirtualClusterAccessKey struct { AccessKey string `json:"accessKey,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type VirtualClusterExternalDatabase struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec VirtualClusterExternalDatabaseSpec `json:"spec,omitempty"` + Status VirtualClusterExternalDatabaseStatus `json:"status,omitempty"` +} + +type VirtualClusterExternalDatabaseSpec struct { + Connector string `json:"connector,omitempty"` +} + +type VirtualClusterExternalDatabaseStatus struct { + DataSource string `json:"dataSource,omitempty"` +} + // +genclient // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -4128,6 +4264,14 @@ type DevPodStopOptionsList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type DevPodWorkspaceInstanceTroubleshootList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DevPodWorkspaceInstanceTroubleshoot `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type DevPodUpOptionsList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -4233,6 +4377,125 @@ func (s *storageDevPodWorkspaceInstance) DeleteDevPodWorkspaceInstance(ctx conte return sync, err } +// DevPodWorkspacePreset Functions and Structs +// +// +k8s:deepcopy-gen=false +type DevPodWorkspacePresetStrategy struct { + builders.DefaultStorageStrategy +} + +// +k8s:deepcopy-gen=false +type DevPodWorkspacePresetStatusStrategy struct { + builders.DefaultStatusStorageStrategy +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type DevPodWorkspacePresetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DevPodWorkspacePreset `json:"items"` +} + +func (DevPodWorkspacePreset) NewStatus() interface{} { + return DevPodWorkspacePresetStatus{} +} + +func (pc *DevPodWorkspacePreset) GetStatus() interface{} { + return pc.Status +} + +func (pc *DevPodWorkspacePreset) SetStatus(s interface{}) { + pc.Status = s.(DevPodWorkspacePresetStatus) +} + +func (pc *DevPodWorkspacePreset) GetSpec() interface{} { + return pc.Spec +} + +func (pc *DevPodWorkspacePreset) SetSpec(s interface{}) { + pc.Spec = s.(DevPodWorkspacePresetSpec) +} + +func (pc *DevPodWorkspacePreset) GetObjectMeta() *metav1.ObjectMeta { + return &pc.ObjectMeta +} + +func (pc *DevPodWorkspacePreset) SetGeneration(generation int64) { + pc.ObjectMeta.Generation = generation +} + +func (pc DevPodWorkspacePreset) GetGeneration() int64 { + return pc.ObjectMeta.Generation +} + +// Registry is an interface for things that know how to store DevPodWorkspacePreset. +// +k8s:deepcopy-gen=false +type DevPodWorkspacePresetRegistry interface { + ListDevPodWorkspacePresets(ctx context.Context, options *internalversion.ListOptions) (*DevPodWorkspacePresetList, error) + GetDevPodWorkspacePreset(ctx context.Context, id string, options *metav1.GetOptions) (*DevPodWorkspacePreset, error) + CreateDevPodWorkspacePreset(ctx context.Context, id *DevPodWorkspacePreset) (*DevPodWorkspacePreset, error) + UpdateDevPodWorkspacePreset(ctx context.Context, id *DevPodWorkspacePreset) (*DevPodWorkspacePreset, error) + DeleteDevPodWorkspacePreset(ctx context.Context, id string) (bool, error) +} + +// NewRegistry returns a new Registry interface for the given Storage. Any mismatched types will panic. +func NewDevPodWorkspacePresetRegistry(sp builders.StandardStorageProvider) DevPodWorkspacePresetRegistry { + return &storageDevPodWorkspacePreset{sp} +} + +// Implement Registry +// storage puts strong typing around storage calls +// +k8s:deepcopy-gen=false +type storageDevPodWorkspacePreset struct { + builders.StandardStorageProvider +} + +func (s *storageDevPodWorkspacePreset) ListDevPodWorkspacePresets(ctx context.Context, options *internalversion.ListOptions) (*DevPodWorkspacePresetList, error) { + if options != nil && options.FieldSelector != nil && !options.FieldSelector.Empty() { + return nil, fmt.Errorf("field selector not supported yet") + } + st := s.GetStandardStorage() + obj, err := st.List(ctx, options) + if err != nil { + return nil, err + } + return obj.(*DevPodWorkspacePresetList), err +} + +func (s *storageDevPodWorkspacePreset) GetDevPodWorkspacePreset(ctx context.Context, id string, options *metav1.GetOptions) (*DevPodWorkspacePreset, error) { + st := s.GetStandardStorage() + obj, err := st.Get(ctx, id, options) + if err != nil { + return nil, err + } + return obj.(*DevPodWorkspacePreset), nil +} + +func (s *storageDevPodWorkspacePreset) CreateDevPodWorkspacePreset(ctx context.Context, object *DevPodWorkspacePreset) (*DevPodWorkspacePreset, error) { + st := s.GetStandardStorage() + obj, err := st.Create(ctx, object, nil, &metav1.CreateOptions{}) + if err != nil { + return nil, err + } + return obj.(*DevPodWorkspacePreset), nil +} + +func (s *storageDevPodWorkspacePreset) UpdateDevPodWorkspacePreset(ctx context.Context, object *DevPodWorkspacePreset) (*DevPodWorkspacePreset, error) { + st := s.GetStandardStorage() + obj, _, err := st.Update(ctx, object.Name, rest.DefaultUpdatedObjectInfo(object), nil, nil, false, &metav1.UpdateOptions{}) + if err != nil { + return nil, err + } + return obj.(*DevPodWorkspacePreset), nil +} + +func (s *storageDevPodWorkspacePreset) DeleteDevPodWorkspacePreset(ctx context.Context, id string) (bool, error) { + st := s.GetStandardStorage() + _, sync, err := st.Delete(ctx, id, nil, &metav1.DeleteOptions{}) + return sync, err +} + // DevPodWorkspaceTemplate Functions and Structs // // +k8s:deepcopy-gen=false @@ -7628,6 +7891,14 @@ type VirtualClusterAccessKeyList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type VirtualClusterExternalDatabaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualClusterExternalDatabase `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type VirtualClusterInstanceKubeConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/zz_generated.deepcopy.go b/pkg/apis/management/zz_generated.deepcopy.go index a6d83fc..2df2d32 100644 --- a/pkg/apis/management/zz_generated.deepcopy.go +++ b/pkg/apis/management/zz_generated.deepcopy.go @@ -12,6 +12,7 @@ import ( v1 "github.com/loft-sh/api/v4/pkg/apis/audit/v1" storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" uiv1 "github.com/loft-sh/api/v4/pkg/apis/ui/v1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -970,13 +971,30 @@ func (in *BackupStatus) DeepCopy() *BackupStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cloud) DeepCopyInto(out *Cloud) { + *out = *in + out.MaintenanceWindow = in.MaintenanceWindow + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cloud. +func (in *Cloud) DeepCopy() *Cloud { + if in == nil { + return nil + } + out := new(Cloud) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) return } @@ -1792,7 +1810,7 @@ func (in *ClusterSpec) DeepCopy() *ClusterSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { *out = *in - out.ClusterStatus = in.ClusterStatus + in.ClusterStatus.DeepCopyInto(&out.ClusterStatus) return } @@ -1986,6 +2004,16 @@ func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus) { *out = new(storagev1.VaultIntegrationSpec) (*in).DeepCopyInto(*out) } + if in.Cloud != nil { + in, out := &in.Cloud, &out.Cloud + *out = new(Cloud) + **out = **in + } + if in.CostControl != nil { + in, out := &in.CostControl, &out.CostControl + *out = new(CostControl) + (*in).DeepCopyInto(*out) + } return } @@ -2162,6 +2190,128 @@ func (in *ConvertVirtualClusterConfigStatus) DeepCopy() *ConvertVirtualClusterCo return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControl) DeepCopyInto(out *CostControl) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + in.Global.DeepCopyInto(&out.Global) + in.Cluster.DeepCopyInto(&out.Cluster) + if in.Settings != nil { + in, out := &in.Settings, &out.Settings + *out = new(CostControlSettings) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControl. +func (in *CostControl) DeepCopy() *CostControl { + if in == nil { + return nil + } + out := new(CostControl) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControlClusterConfig) DeepCopyInto(out *CostControlClusterConfig) { + *out = *in + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = new(storagev1.Metrics) + (*in).DeepCopyInto(*out) + } + if in.OpenCost != nil { + in, out := &in.OpenCost, &out.OpenCost + *out = new(storagev1.OpenCost) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControlClusterConfig. +func (in *CostControlClusterConfig) DeepCopy() *CostControlClusterConfig { + if in == nil { + return nil + } + out := new(CostControlClusterConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControlGlobalConfig) DeepCopyInto(out *CostControlGlobalConfig) { + *out = *in + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = new(storagev1.Metrics) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControlGlobalConfig. +func (in *CostControlGlobalConfig) DeepCopy() *CostControlGlobalConfig { + if in == nil { + return nil + } + out := new(CostControlGlobalConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControlResourcePrice) DeepCopyInto(out *CostControlResourcePrice) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControlResourcePrice. +func (in *CostControlResourcePrice) DeepCopy() *CostControlResourcePrice { + if in == nil { + return nil + } + out := new(CostControlResourcePrice) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CostControlSettings) DeepCopyInto(out *CostControlSettings) { + *out = *in + if in.AvgCPUPricePerNode != nil { + in, out := &in.AvgCPUPricePerNode, &out.AvgCPUPricePerNode + *out = new(CostControlResourcePrice) + **out = **in + } + if in.AvgRAMPricePerNode != nil { + in, out := &in.AvgRAMPricePerNode, &out.AvgRAMPricePerNode + *out = new(CostControlResourcePrice) + **out = **in + } + if in.ControlPlanePricePerCluster != nil { + in, out := &in.ControlPlanePricePerCluster, &out.ControlPlanePricePerCluster + *out = new(CostControlResourcePrice) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CostControlSettings. +func (in *CostControlSettings) DeepCopy() *CostControlSettings { + if in == nil { + return nil + } + out := new(CostControlSettings) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevPodDeleteOptions) DeepCopyInto(out *DevPodDeleteOptions) { *out = *in @@ -2695,6 +2845,188 @@ func (in *DevPodWorkspaceInstanceStatus) DeepCopy() *DevPodWorkspaceInstanceStat return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspaceInstanceTroubleshoot) DeepCopyInto(out *DevPodWorkspaceInstanceTroubleshoot) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Workspace != nil { + in, out := &in.Workspace, &out.Workspace + *out = new(DevPodWorkspaceInstance) + (*in).DeepCopyInto(*out) + } + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(storagev1.DevPodWorkspaceTemplate) + (*in).DeepCopyInto(*out) + } + if in.Pods != nil { + in, out := &in.Pods, &out.Pods + *out = make([]corev1.Pod, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PVCs != nil { + in, out := &in.PVCs, &out.PVCs + *out = make([]corev1.PersistentVolumeClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Errors != nil { + in, out := &in.Errors, &out.Errors + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspaceInstanceTroubleshoot. +func (in *DevPodWorkspaceInstanceTroubleshoot) DeepCopy() *DevPodWorkspaceInstanceTroubleshoot { + if in == nil { + return nil + } + out := new(DevPodWorkspaceInstanceTroubleshoot) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspaceInstanceTroubleshoot) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspaceInstanceTroubleshootList) DeepCopyInto(out *DevPodWorkspaceInstanceTroubleshootList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DevPodWorkspaceInstanceTroubleshoot, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspaceInstanceTroubleshootList. +func (in *DevPodWorkspaceInstanceTroubleshootList) DeepCopy() *DevPodWorkspaceInstanceTroubleshootList { + if in == nil { + return nil + } + out := new(DevPodWorkspaceInstanceTroubleshootList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspaceInstanceTroubleshootList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePreset) DeepCopyInto(out *DevPodWorkspacePreset) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePreset. +func (in *DevPodWorkspacePreset) DeepCopy() *DevPodWorkspacePreset { + if in == nil { + return nil + } + out := new(DevPodWorkspacePreset) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspacePreset) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetList) DeepCopyInto(out *DevPodWorkspacePresetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DevPodWorkspacePreset, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetList. +func (in *DevPodWorkspacePresetList) DeepCopy() *DevPodWorkspacePresetList { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspacePresetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetSpec) DeepCopyInto(out *DevPodWorkspacePresetSpec) { + *out = *in + in.DevPodWorkspacePresetSpec.DeepCopyInto(&out.DevPodWorkspacePresetSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetSpec. +func (in *DevPodWorkspacePresetSpec) DeepCopy() *DevPodWorkspacePresetSpec { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetStatus) DeepCopyInto(out *DevPodWorkspacePresetStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetStatus. +func (in *DevPodWorkspacePresetStatus) DeepCopy() *DevPodWorkspacePresetStatus { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevPodWorkspaceTemplate) DeepCopyInto(out *DevPodWorkspaceTemplate) { *out = *in @@ -3689,6 +4021,22 @@ func (in *LoftUpgradeStatus) DeepCopy() *LoftUpgradeStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceWindow) DeepCopyInto(out *MaintenanceWindow) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceWindow. +func (in *MaintenanceWindow) DeepCopy() *MaintenanceWindow { + if in == nil { + return nil + } + out := new(MaintenanceWindow) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OIDC) DeepCopyInto(out *OIDC) { *out = *in @@ -4795,6 +5143,13 @@ func (in *ProjectTemplates) DeepCopyInto(out *ProjectTemplates) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.DevPodWorkspacePresets != nil { + in, out := &in.DevPodWorkspacePresets, &out.DevPodWorkspacePresets + *out = make([]DevPodWorkspacePreset, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -7049,6 +7404,99 @@ func (in *VirtualClusterAccessKeyList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabase) DeepCopyInto(out *VirtualClusterExternalDatabase) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabase. +func (in *VirtualClusterExternalDatabase) DeepCopy() *VirtualClusterExternalDatabase { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabase) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseList) DeepCopyInto(out *VirtualClusterExternalDatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualClusterExternalDatabase, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseList. +func (in *VirtualClusterExternalDatabaseList) DeepCopy() *VirtualClusterExternalDatabaseList { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabaseList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopyInto(out *VirtualClusterExternalDatabaseSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseSpec. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopy() *VirtualClusterExternalDatabaseSpec { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopyInto(out *VirtualClusterExternalDatabaseStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseStatus. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopy() *VirtualClusterExternalDatabaseStatus { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualClusterInstance) DeepCopyInto(out *VirtualClusterInstance) { *out = *in diff --git a/pkg/apis/management/zz_generated.defaults.go b/pkg/apis/management/zz_generated.defaults.go index 619605f..228a30c 100644 --- a/pkg/apis/management/zz_generated.defaults.go +++ b/pkg/apis/management/zz_generated.defaults.go @@ -14,6 +14,12 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&DevPodWorkspaceInstanceTroubleshoot{}, func(obj interface{}) { + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(obj.(*DevPodWorkspaceInstanceTroubleshoot)) + }) + scheme.AddTypeDefaultingFunc(&DevPodWorkspaceInstanceTroubleshootList{}, func(obj interface{}) { + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshootList(obj.(*DevPodWorkspaceInstanceTroubleshootList)) + }) scheme.AddTypeDefaultingFunc(&ProjectClusters{}, func(obj interface{}) { SetObjectDefaults_ProjectClusters(obj.(*ProjectClusters)) }) scheme.AddTypeDefaultingFunc(&ProjectClustersList{}, func(obj interface{}) { SetObjectDefaults_ProjectClustersList(obj.(*ProjectClustersList)) }) scheme.AddTypeDefaultingFunc(&ProjectRunners{}, func(obj interface{}) { SetObjectDefaults_ProjectRunners(obj.(*ProjectRunners)) }) @@ -23,6 +29,163 @@ func RegisterDefaults(scheme *runtime.Scheme) error { return nil } +func SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(in *DevPodWorkspaceInstanceTroubleshoot) { + for i := range in.Pods { + a := &in.Pods[i] + for j := range a.Spec.Volumes { + b := &a.Spec.Volumes[j] + if b.VolumeSource.ISCSI != nil { + if b.VolumeSource.ISCSI.ISCSIInterface == "" { + b.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if b.VolumeSource.RBD != nil { + if b.VolumeSource.RBD.RBDPool == "" { + b.VolumeSource.RBD.RBDPool = "rbd" + } + if b.VolumeSource.RBD.RadosUser == "" { + b.VolumeSource.RBD.RadosUser = "admin" + } + if b.VolumeSource.RBD.Keyring == "" { + b.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if b.VolumeSource.AzureDisk != nil { + if b.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + b.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if b.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + b.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if b.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + b.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if b.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + b.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if b.VolumeSource.ScaleIO != nil { + if b.VolumeSource.ScaleIO.StorageMode == "" { + b.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if b.VolumeSource.ScaleIO.FSType == "" { + b.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + for j := range a.Spec.InitContainers { + b := &a.Spec.InitContainers[j] + for k := range b.Ports { + c := &b.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.LivenessProbe != nil { + if b.LivenessProbe.ProbeHandler.GRPC != nil { + if b.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.ReadinessProbe != nil { + if b.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.StartupProbe != nil { + if b.StartupProbe.ProbeHandler.GRPC != nil { + if b.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for j := range a.Spec.Containers { + b := &a.Spec.Containers[j] + for k := range b.Ports { + c := &b.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.LivenessProbe != nil { + if b.LivenessProbe.ProbeHandler.GRPC != nil { + if b.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.ReadinessProbe != nil { + if b.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.StartupProbe != nil { + if b.StartupProbe.ProbeHandler.GRPC != nil { + if b.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for j := range a.Spec.EphemeralContainers { + b := &a.Spec.EphemeralContainers[j] + for k := range b.EphemeralContainerCommon.Ports { + c := &b.EphemeralContainerCommon.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.EphemeralContainerCommon.LivenessProbe != nil { + if b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.EphemeralContainerCommon.ReadinessProbe != nil { + if b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.EphemeralContainerCommon.StartupProbe != nil { + if b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + } +} + +func SetObjectDefaults_DevPodWorkspaceInstanceTroubleshootList(in *DevPodWorkspaceInstanceTroubleshootList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(a) + } +} + func SetObjectDefaults_ProjectClusters(in *ProjectClusters) { for i := range in.Runners { a := &in.Runners[i] diff --git a/pkg/apis/storage/v1/cluster_types.go b/pkg/apis/storage/v1/cluster_types.go index e814511..520207a 100644 --- a/pkg/apis/storage/v1/cluster_types.go +++ b/pkg/apis/storage/v1/cluster_types.go @@ -2,9 +2,29 @@ package v1 import ( clusterv1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1" + agentstoragev1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +const ( + MetricsFederationServiceNamespaceAnnotation = "loft.sh/metrics-federation-service-namespace" + MetricsFederationServiceNameAnnotation = "loft.sh/metrics-federation-service-name" + MetricsFederationServicePortAnnotation = "loft.sh/metrics-federation-service-port" + + PrometheusLastAppliedHashAnnotation = "loft.sh/prometheus-last-applied-hash" + PrometheusDeployed agentstoragev1.ConditionType = "PrometheusDeployed" + PrometheusAvailable agentstoragev1.ConditionType = "PrometheusAvailable" + + GlobalPrometheusLastAppliedHashAnnotation = "loft.sh/global-prometheus-last-applied-hash" + GlobalPrometheusDeployed agentstoragev1.ConditionType = "GlobalPrometheusDeployed" + GlobalPrometheusAvailable agentstoragev1.ConditionType = "GlobalPrometheusAvailable" + + OpenCostLastAppliedHashAnnotation = "loft.sh/opencost-last-applied-hash" + OpenCostDeployed agentstoragev1.ConditionType = "OpenCostDeployed" + OpenCostAvailable agentstoragev1.ConditionType = "OpenCostAvailable" +) + // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -35,6 +55,14 @@ func (a *Cluster) SetAccess(access []Access) { a.Spec.Access = access } +func (a *Cluster) GetConditions() agentstoragev1.Conditions { + return a.Status.Conditions +} + +func (a *Cluster) SetConditions(conditions agentstoragev1.Conditions) { + a.Status.Conditions = conditions +} + // ClusterSpec holds the cluster specification type ClusterSpec struct { // If specified this name is displayed in the UI instead of the metadata name @@ -72,6 +100,12 @@ type ClusterSpec struct { // Access holds the access rights for users and teams // +optional Access []Access `json:"access,omitempty"` + + // Metrics holds the cluster's metrics backend configuration + Metrics *Metrics `json:"metrics,omitempty"` + + // OpenCost holds the cluster's OpenCost backend configuration + OpenCost *OpenCost `json:"opencost,omitempty"` } type AllowedClusterAccountTemplate struct { @@ -90,6 +124,10 @@ type ClusterStatus struct { // +optional Message string `json:"message,omitempty"` + + // Conditions holds several conditions the cluster might be in + // +optional + Conditions agentstoragev1.Conditions `json:"conditions,omitempty"` } // ClusterStatusPhase describes the phase of a cluster @@ -173,3 +211,34 @@ type Chart struct { // +optional Password string `json:"password,omitempty"` } +type Metrics struct { + // Replicas is the number of desired replicas. + Replicas *int32 `json:"replicas,omitempty"` + + // Resources are compute resource required by the metrics backend + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` + + // Retention is the metrics data retention period. Default is 1y + Retention string `json:"retention,omitempty"` + + // Storage contains settings related to the metrics backend's persistent volume configuration + Storage `json:"storage,omitempty"` +} + +type Storage struct { + // StorageClass the storage class to use when provisioning the metrics backend's persistent volume + // If set to "-" or "" dynamic provisioning is disabled + // If set to undefined or null (the default), the cluster's default storage class is used for provisioning + StorageClass *string `json:"storageClass,omitempty"` + + // Size the size of the metrics backend's persistent volume + Size string `json:"size,omitempty"` +} + +type OpenCost struct { + // Replicas is the number of desired replicas. + Replicas *int32 `json:"replicas,omitempty"` + + // Resources are compute resource required by the OpenCost backend + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` +} diff --git a/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go b/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go index c2737ba..ed66c96 100644 --- a/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go +++ b/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go @@ -15,7 +15,26 @@ type DevPodEnvironmentTemplate struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec DevPodEnvironmentTemplateSpec `json:"spec,omitempty"` + Spec DevPodEnvironmentTemplateSpec `json:"spec,omitempty"` + Status DevPodEnvironmentTemplateStatus `json:"status,omitempty"` +} + +// DevPodEnvironmentTemplateStatus holds the status +type DevPodEnvironmentTemplateStatus struct { +} + +func (a *DevPodEnvironmentTemplate) GetVersions() []VersionAccessor { + var retVersions []VersionAccessor + for _, v := range a.Spec.Versions { + b := v + retVersions = append(retVersions, &b) + } + + return retVersions +} + +func (a *DevPodEnvironmentTemplateVersion) GetVersion() string { + return a.Version } func (a *DevPodEnvironmentTemplate) GetOwner() *UserOrTeam { @@ -39,9 +58,9 @@ type DevPodEnvironmentTemplateSpec struct { // +optional DisplayName string `json:"displayName,omitempty"` - // Git holds configuration for git environment spec source + // Description describes the environment template // +optional - Git GitEnvironmentTemplate `json:"git,omitempty"` + Description string `json:"description,omitempty"` // Owner holds the owner of this object // +optional @@ -51,11 +70,25 @@ type DevPodEnvironmentTemplateSpec struct { // +optional Access []Access `json:"access,omitempty"` + // Template is the inline template to use for DevPod environments + // +optional + Template *DevPodEnvironmentTemplateDefinition `json:"template,omitempty"` + // Versions are different versions of the template that can be referenced as well // +optional Versions []DevPodEnvironmentTemplateVersion `json:"versions,omitempty"` } +type DevPodEnvironmentTemplateDefinition struct { + // Git holds configuration for git environment spec source + // +optional + Git *GitEnvironmentTemplate `json:"git,omitempty"` + + // Inline holds an inline devcontainer.json definition + // +optional + Inline string `json:"inline,omitempty"` +} + // GitEnvironmentTemplate stores configuration of Git environment template source type GitEnvironmentTemplate struct { // Repository stores repository URL for Git environment spec source @@ -75,9 +108,9 @@ type GitEnvironmentTemplate struct { } type DevPodEnvironmentTemplateVersion struct { - // Git holds the GitEnvironmentTemplate + // Template holds the environment template definition // +optional - Git GitEnvironmentTemplate `json:"git,omitempty"` + Template DevPodEnvironmentTemplateDefinition `json:"template,omitempty"` // Version is the version. Needs to be in X.X.X format. // +optional diff --git a/pkg/apis/storage/v1/devpodworkspaceinstance_types.go b/pkg/apis/storage/v1/devpodworkspaceinstance_types.go index 51e8fed..c6e86c3 100644 --- a/pkg/apis/storage/v1/devpodworkspaceinstance_types.go +++ b/pkg/apis/storage/v1/devpodworkspaceinstance_types.go @@ -17,6 +17,10 @@ var ( // DevPodWorkspaceUIDLabel holds the actual workspace uid of the devpod workspace DevPodWorkspaceUIDLabel = "loft.sh/workspace-uid" + // DevPodKubernetesProviderWorkspaceUIDLabel holds the actual workspace uid of the devpod workspace on resources + // created by the DevPod Kubernetes provider. + DevPodKubernetesProviderWorkspaceUIDLabel = "devpod.sh/workspace-uid" + // DevPodWorkspacePictureAnnotation holds the workspace picture url of the devpod workspace DevPodWorkspacePictureAnnotation = "loft.sh/workspace-picture" @@ -86,13 +90,17 @@ type DevPodWorkspaceInstanceSpec struct { // +optional Owner *UserOrTeam `json:"owner,omitempty"` + // PresetRef holds the DevPodWorkspacePreset template reference + // +optional + PresetRef *PresetRef `json:"presetRef,omitempty"` + // TemplateRef holds the DevPod machine template reference // +optional TemplateRef *TemplateRef `json:"templateRef,omitempty"` // EnvironmentRef is the reference to DevPodEnvironmentTemplate that should be used // +optional - EnvironmentRef EnvironmentRef `json:"environmentRef,omitempty"` + EnvironmentRef *EnvironmentRef `json:"environmentRef,omitempty"` // Template is the inline template to use for DevPod machine creation. This is mutually // exclusive with templateRef. @@ -118,6 +126,18 @@ type DevPodWorkspaceInstanceSpec struct { PreventWakeUpOnConnection bool `json:"preventWakeUpOnConnection,omitempty"` } +type PresetRef struct { + // Name is the name of DevPodWorkspacePreset + Name string `json:"name"` + + // Version holds the preset version to use. Version is expected to + // be in semantic versioning format. Alternatively, you can also exchange + // major, minor or patch with an 'x' to tell Loft to automatically select + // the latest major, minor or patch version. + // +optional + Version string `json:"version,omitempty"` +} + type RunnerRef struct { // Runner is the connected runner the workspace will be created in // +optional @@ -127,6 +147,10 @@ type RunnerRef struct { type EnvironmentRef struct { // Name is the name of DevPodEnvironmentTemplate this references Name string `json:"name"` + + // Version is the version of DevPodEnvironmentTemplate this references + // +optional + Version string `json:"version,omitempty"` } type DevPodWorkspaceInstanceStatus struct { diff --git a/pkg/apis/storage/v1/devpodworkspacepreset_types.go b/pkg/apis/storage/v1/devpodworkspacepreset_types.go new file mode 100644 index 0000000..4fff5fa --- /dev/null +++ b/pkg/apis/storage/v1/devpodworkspacepreset_types.go @@ -0,0 +1,121 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DevPodWorkspacePreset +// +k8s:openapi-gen=true +type DevPodWorkspacePreset struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec DevPodWorkspacePresetSpec `json:"spec,omitempty"` + Status DevPodWorkspacePresetStatus `json:"status,omitempty"` +} + +func (a *DevPodWorkspacePreset) GetOwner() *UserOrTeam { + return a.Spec.Owner +} + +func (a *DevPodWorkspacePreset) SetOwner(userOrTeam *UserOrTeam) { + a.Spec.Owner = userOrTeam +} + +func (a *DevPodWorkspacePreset) GetAccess() []Access { + return a.Spec.Access +} + +func (a *DevPodWorkspacePreset) SetAccess(access []Access) { + a.Spec.Access = access +} + +type DevPodWorkspacePresetSpec struct { + // DisplayName is the name that should be displayed in the UI + // +optional + DisplayName string `json:"displayName,omitempty"` + + // Source stores inline path of project source + Source *DevPodWorkspacePresetSource `json:"source"` + + // InfrastructureRef stores reference to DevPodWorkspaceTemplate to use + InfrastructureRef *TemplateRef `json:"infrastructureRef"` + + // EnvironmentRef stores reference to DevPodEnvironmentTemplate + // +optional + EnvironmentRef *EnvironmentRef `json:"environmentRef,omitempty"` + + // UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment + // +optional + UseProjectGitCredentials bool `json:"useProjectGitCredentials,omitempty"` + + // Owner holds the owner of this object + // +optional + Owner *UserOrTeam `json:"owner,omitempty"` + + // Access to the DevPod machine instance object itself + // +optional + Access []Access `json:"access,omitempty"` + + // Versions are different versions of the template that can be referenced as well + // +optional + Versions []DevPodWorkspacePresetVersion `json:"versions,omitempty"` +} + +type DevPodWorkspacePresetSource struct { + // Git stores path to git repo to use as workspace source + // +optional + Git string `json:"git,omitempty"` + + // Image stores container image to use as workspace source + // +optional + Image string `json:"image,omitempty"` +} + +type DevPodWorkspacePresetVersion struct { + // Version is the version. Needs to be in X.X.X format. + // +optional + Version string `json:"version,omitempty"` + + // Source stores inline path of project source + // +optional + Source *DevPodWorkspacePresetSource `json:"source,omitempty"` + + // InfrastructureRef stores reference to DevPodWorkspaceTemplate to use + // +optional + InfrastructureRef *TemplateRef `json:"infrastructureRef,omitempty"` + + // EnvironmentRef stores reference to DevPodEnvironmentTemplate + // +optional + EnvironmentRef *EnvironmentRef `json:"environmentRef,omitempty"` + + // UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment + // +optional + UseProjectGitCredentials bool `json:"useProjectGitCredentials,omitempty"` +} + +// DevPodWorkspacePresetStatus holds the status +type DevPodWorkspacePresetStatus struct { +} + +type WorkspaceRef struct { + // Name is the name of DevPodWorkspaceTemplate this references + Name string `json:"name"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// DevPodWorkspacePresetList contains a list of DevPodWorkspacePreset objects +type DevPodWorkspacePresetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DevPodWorkspacePreset `json:"items"` +} + +func init() { + SchemeBuilder.Register(&DevPodWorkspacePreset{}, &DevPodWorkspacePresetList{}) +} diff --git a/pkg/apis/storage/v1/project_types.go b/pkg/apis/storage/v1/project_types.go index 2fec41e..1cca19b 100644 --- a/pkg/apis/storage/v1/project_types.go +++ b/pkg/apis/storage/v1/project_types.go @@ -106,6 +106,10 @@ type ProjectSpec struct { // +optional RequireTemplate RequireTemplate `json:"requireTemplate,omitempty"` + // RequirePreset configures if a preset is required for instance creation. + // +optional + RequirePreset RequirePreset `json:"requirePreset,omitempty"` + // Members are the users and teams that are part of this project // +optional Members []Member `json:"members,omitempty"` @@ -142,6 +146,13 @@ type RequireTemplate struct { Disabled bool `json:"disabled,omitempty"` } +type RequirePreset struct { + // If true, all users within the project will not be allowed to create a new instance without a preset. + // By default, all users are allowed to create a new instance without a preset. + // +optional + Enabled bool `json:"disabled,omitempty"` +} + type NamespacePattern struct { // Space holds the namespace pattern to use for space instances // +optional @@ -165,6 +176,7 @@ var ( SpaceTemplateKind = "SpaceTemplate" VirtualClusterTemplateKind = "VirtualClusterTemplate" DevPodWorkspaceTemplateKind = "DevPodWorkspaceTemplate" + DevPodWorkspacePresetKind = "DevPodWorkspacePreset" ) type AllowedTemplate struct { diff --git a/pkg/apis/storage/v1/zz_generated.deepcopy.go b/pkg/apis/storage/v1/zz_generated.deepcopy.go index 7de9add..f6c13ca 100644 --- a/pkg/apis/storage/v1/zz_generated.deepcopy.go +++ b/pkg/apis/storage/v1/zz_generated.deepcopy.go @@ -943,7 +943,7 @@ func (in *Cluster) DeepCopyInto(out *Cluster) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) return } @@ -1302,6 +1302,16 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = new(Metrics) + (*in).DeepCopyInto(*out) + } + if in.OpenCost != nil { + in, out := &in.OpenCost, &out.OpenCost + *out = new(OpenCost) + (*in).DeepCopyInto(*out) + } return } @@ -1318,6 +1328,13 @@ func (in *ClusterSpec) DeepCopy() *ClusterSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(storagev1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -1447,6 +1464,7 @@ func (in *DevPodEnvironmentTemplate) DeepCopyInto(out *DevPodEnvironmentTemplate out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status return } @@ -1468,6 +1486,27 @@ func (in *DevPodEnvironmentTemplate) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodEnvironmentTemplateDefinition) DeepCopyInto(out *DevPodEnvironmentTemplateDefinition) { + *out = *in + if in.Git != nil { + in, out := &in.Git, &out.Git + *out = new(GitEnvironmentTemplate) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodEnvironmentTemplateDefinition. +func (in *DevPodEnvironmentTemplateDefinition) DeepCopy() *DevPodEnvironmentTemplateDefinition { + if in == nil { + return nil + } + out := new(DevPodEnvironmentTemplateDefinition) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevPodEnvironmentTemplateList) DeepCopyInto(out *DevPodEnvironmentTemplateList) { *out = *in @@ -1504,7 +1543,6 @@ func (in *DevPodEnvironmentTemplateList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevPodEnvironmentTemplateSpec) DeepCopyInto(out *DevPodEnvironmentTemplateSpec) { *out = *in - out.Git = in.Git if in.Owner != nil { in, out := &in.Owner, &out.Owner *out = new(UserOrTeam) @@ -1517,10 +1555,17 @@ func (in *DevPodEnvironmentTemplateSpec) DeepCopyInto(out *DevPodEnvironmentTemp (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(DevPodEnvironmentTemplateDefinition) + (*in).DeepCopyInto(*out) + } if in.Versions != nil { in, out := &in.Versions, &out.Versions *out = make([]DevPodEnvironmentTemplateVersion, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } return } @@ -1535,10 +1580,26 @@ func (in *DevPodEnvironmentTemplateSpec) DeepCopy() *DevPodEnvironmentTemplateSp return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodEnvironmentTemplateStatus) DeepCopyInto(out *DevPodEnvironmentTemplateStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodEnvironmentTemplateStatus. +func (in *DevPodEnvironmentTemplateStatus) DeepCopy() *DevPodEnvironmentTemplateStatus { + if in == nil { + return nil + } + out := new(DevPodEnvironmentTemplateStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevPodEnvironmentTemplateVersion) DeepCopyInto(out *DevPodEnvironmentTemplateVersion) { *out = *in - out.Git = in.Git + in.Template.DeepCopyInto(&out.Template) return } @@ -1710,12 +1771,21 @@ func (in *DevPodWorkspaceInstanceSpec) DeepCopyInto(out *DevPodWorkspaceInstance *out = new(UserOrTeam) **out = **in } + if in.PresetRef != nil { + in, out := &in.PresetRef, &out.PresetRef + *out = new(PresetRef) + **out = **in + } if in.TemplateRef != nil { in, out := &in.TemplateRef, &out.TemplateRef *out = new(TemplateRef) **out = **in } - out.EnvironmentRef = in.EnvironmentRef + if in.EnvironmentRef != nil { + in, out := &in.EnvironmentRef, &out.EnvironmentRef + *out = new(EnvironmentRef) + **out = **in + } if in.Template != nil { in, out := &in.Template, &out.Template *out = new(DevPodWorkspaceTemplateDefinition) @@ -1792,6 +1862,180 @@ func (in *DevPodWorkspaceInstanceTemplateDefinition) DeepCopy() *DevPodWorkspace return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePreset) DeepCopyInto(out *DevPodWorkspacePreset) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePreset. +func (in *DevPodWorkspacePreset) DeepCopy() *DevPodWorkspacePreset { + if in == nil { + return nil + } + out := new(DevPodWorkspacePreset) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspacePreset) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetList) DeepCopyInto(out *DevPodWorkspacePresetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DevPodWorkspacePreset, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetList. +func (in *DevPodWorkspacePresetList) DeepCopy() *DevPodWorkspacePresetList { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DevPodWorkspacePresetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetSource) DeepCopyInto(out *DevPodWorkspacePresetSource) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetSource. +func (in *DevPodWorkspacePresetSource) DeepCopy() *DevPodWorkspacePresetSource { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetSpec) DeepCopyInto(out *DevPodWorkspacePresetSpec) { + *out = *in + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(DevPodWorkspacePresetSource) + **out = **in + } + if in.InfrastructureRef != nil { + in, out := &in.InfrastructureRef, &out.InfrastructureRef + *out = new(TemplateRef) + **out = **in + } + if in.EnvironmentRef != nil { + in, out := &in.EnvironmentRef, &out.EnvironmentRef + *out = new(EnvironmentRef) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(UserOrTeam) + **out = **in + } + if in.Access != nil { + in, out := &in.Access, &out.Access + *out = make([]Access, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Versions != nil { + in, out := &in.Versions, &out.Versions + *out = make([]DevPodWorkspacePresetVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetSpec. +func (in *DevPodWorkspacePresetSpec) DeepCopy() *DevPodWorkspacePresetSpec { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetStatus) DeepCopyInto(out *DevPodWorkspacePresetStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetStatus. +func (in *DevPodWorkspacePresetStatus) DeepCopy() *DevPodWorkspacePresetStatus { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevPodWorkspacePresetVersion) DeepCopyInto(out *DevPodWorkspacePresetVersion) { + *out = *in + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(DevPodWorkspacePresetSource) + **out = **in + } + if in.InfrastructureRef != nil { + in, out := &in.InfrastructureRef, &out.InfrastructureRef + *out = new(TemplateRef) + **out = **in + } + if in.EnvironmentRef != nil { + in, out := &in.EnvironmentRef, &out.EnvironmentRef + *out = new(EnvironmentRef) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevPodWorkspacePresetVersion. +func (in *DevPodWorkspacePresetVersion) DeepCopy() *DevPodWorkspacePresetVersion { + if in == nil { + return nil + } + out := new(DevPodWorkspacePresetVersion) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevPodWorkspaceProvider) DeepCopyInto(out *DevPodWorkspaceProvider) { *out = *in @@ -2450,6 +2694,33 @@ func (in *Member) DeepCopy() *Member { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Metrics) DeepCopyInto(out *Metrics) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = new(corev1.ResourceRequirements) + (*in).DeepCopyInto(*out) + } + in.Storage.DeepCopyInto(&out.Storage) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metrics. +func (in *Metrics) DeepCopy() *Metrics { + if in == nil { + return nil + } + out := new(Metrics) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamespacePattern) DeepCopyInto(out *NamespacePattern) { *out = *in @@ -2600,6 +2871,32 @@ func (in *ObjectsStatus) DeepCopy() *ObjectsStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenCost) DeepCopyInto(out *OpenCost) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = new(corev1.ResourceRequirements) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenCost. +func (in *OpenCost) DeepCopy() *OpenCost { + if in == nil { + return nil + } + out := new(OpenCost) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PodSelector) DeepCopyInto(out *PodSelector) { *out = *in @@ -2622,6 +2919,22 @@ func (in *PodSelector) DeepCopy() *PodSelector { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PresetRef) DeepCopyInto(out *PresetRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PresetRef. +func (in *PresetRef) DeepCopy() *PresetRef { + if in == nil { + return nil + } + out := new(PresetRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Project) DeepCopyInto(out *Project) { *out = *in @@ -2708,6 +3021,7 @@ func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) { copy(*out, *in) } out.RequireTemplate = in.RequireTemplate + out.RequirePreset = in.RequirePreset if in.Members != nil { in, out := &in.Members, &out.Members *out = make([]Member, len(*in)) @@ -3018,6 +3332,22 @@ func (in *RancherProjectRef) DeepCopy() *RancherProjectRef { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequirePreset) DeepCopyInto(out *RequirePreset) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequirePreset. +func (in *RequirePreset) DeepCopy() *RequirePreset { + if in == nil { + return nil + } + out := new(RequirePreset) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RequireTemplate) DeepCopyInto(out *RequireTemplate) { *out = *in @@ -3872,6 +4202,27 @@ func (in *SpaceTemplateVersion) DeepCopy() *SpaceTemplateVersion { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Storage) DeepCopyInto(out *Storage) { + *out = *in + if in.StorageClass != nil { + in, out := &in.StorageClass, &out.StorageClass + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Storage. +func (in *Storage) DeepCopy() *Storage { + if in == nil { + return nil + } + out := new(Storage) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StreamContainer) DeepCopyInto(out *StreamContainer) { *out = *in @@ -5132,6 +5483,22 @@ func (in *VirtualClusterTemplateVersion) DeepCopy() *VirtualClusterTemplateVersi return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceRef) DeepCopyInto(out *WorkspaceRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceRef. +func (in *WorkspaceRef) DeepCopy() *WorkspaceRef { + if in == nil { + return nil + } + out := new(WorkspaceRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WorkspaceStatusResult) DeepCopyInto(out *WorkspaceStatusResult) { *out = *in diff --git a/pkg/apis/ui/v1/ui_types.go b/pkg/apis/ui/v1/ui_types.go index b5cd94b..91c2f8b 100644 --- a/pkg/apis/ui/v1/ui_types.go +++ b/pkg/apis/ui/v1/ui_types.go @@ -34,11 +34,16 @@ type UISettingsSpec struct { // +optional Offline bool `json:"offline,omitempty"` - // HasHelmRelease indicates whether loft has been installed via Helm + // HasHelmRelease indicates whether the vCluster Platform instance + // has been installed via Helm HasHelmRelease bool `json:"hasHelmRelease,omitempty"` // DefaultVClusterVersion is the default version of vClusters DefaultVClusterVersion string `json:"defaultVClusterVersion,omitempty"` + + // LoftHosted indicates whether the vCluster Platform instance + // is hosted and operated by Loft Labs Inc. + LoftHosted bool `json:"loftHosted,omitempty"` } type UISettingsConfig struct { diff --git a/pkg/apis/zz_generated.api.register.go b/pkg/apis/zz_generated.api.register.go index 3e4477a..00ba513 100644 --- a/pkg/apis/zz_generated.api.register.go +++ b/pkg/apis/zz_generated.api.register.go @@ -49,6 +49,7 @@ func GetManagementAPIBuilder() *builders.APIGroupBuilder { "Config", "ConvertVirtualClusterConfig", "DevPodEnvironmentTemplate", + "DevPodWorkspacePreset", "DevPodWorkspaceTemplate", "DirectClusterEndpointToken", "Event", diff --git a/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go b/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go index 4a1d6d9..23f8a7e 100644 --- a/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go @@ -31,6 +31,7 @@ type DevPodWorkspaceInstanceInterface interface { Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceInstance, err error) GetState(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (*v1.DevPodWorkspaceInstanceState, error) SetState(ctx context.Context, devPodWorkspaceInstanceName string, devPodWorkspaceInstanceState *v1.DevPodWorkspaceInstanceState, opts metav1.CreateOptions) (*v1.DevPodWorkspaceInstanceState, error) + Troubleshoot(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (*v1.DevPodWorkspaceInstanceTroubleshoot, error) DevPodWorkspaceInstanceExpansion } @@ -81,3 +82,17 @@ func (c *devPodWorkspaceInstances) SetState(ctx context.Context, devPodWorkspace Into(result) return } + +// Troubleshoot takes name of the devPodWorkspaceInstance, and returns the corresponding v1.DevPodWorkspaceInstanceTroubleshoot object, and an error if there is any. +func (c *devPodWorkspaceInstances) Troubleshoot(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstanceTroubleshoot, err error) { + result = &v1.DevPodWorkspaceInstanceTroubleshoot{} + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). + Resource("devpodworkspaceinstances"). + Name(devPodWorkspaceInstanceName). + SubResource("troubleshoot"). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/management/v1/devpodworkspacepreset.go b/pkg/clientset/versioned/typed/management/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..9877f62 --- /dev/null +++ b/pkg/clientset/versioned/typed/management/v1/devpodworkspacepreset.go @@ -0,0 +1,53 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + + v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" + scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// DevPodWorkspacePresetsGetter has a method to return a DevPodWorkspacePresetInterface. +// A group's client should implement this interface. +type DevPodWorkspacePresetsGetter interface { + DevPodWorkspacePresets() DevPodWorkspacePresetInterface +} + +// DevPodWorkspacePresetInterface has methods to work with DevPodWorkspacePreset resources. +type DevPodWorkspacePresetInterface interface { + Create(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.CreateOptions) (*v1.DevPodWorkspacePreset, error) + Update(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (*v1.DevPodWorkspacePreset, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (*v1.DevPodWorkspacePreset, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DevPodWorkspacePreset, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DevPodWorkspacePresetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspacePreset, err error) + DevPodWorkspacePresetExpansion +} + +// devPodWorkspacePresets implements DevPodWorkspacePresetInterface +type devPodWorkspacePresets struct { + *gentype.ClientWithList[*v1.DevPodWorkspacePreset, *v1.DevPodWorkspacePresetList] +} + +// newDevPodWorkspacePresets returns a DevPodWorkspacePresets +func newDevPodWorkspacePresets(c *ManagementV1Client) *devPodWorkspacePresets { + return &devPodWorkspacePresets{ + gentype.NewClientWithList[*v1.DevPodWorkspacePreset, *v1.DevPodWorkspacePresetList]( + "devpodworkspacepresets", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DevPodWorkspacePreset { return &v1.DevPodWorkspacePreset{} }, + func() *v1.DevPodWorkspacePresetList { return &v1.DevPodWorkspacePresetList{} }), + } +} diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go index 759bff6..78b9596 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go @@ -140,3 +140,15 @@ func (c *FakeDevPodWorkspaceInstances) SetState(ctx context.Context, devPodWorks } return obj.(*v1.DevPodWorkspaceInstanceState), err } + +// Troubleshoot takes name of the devPodWorkspaceInstance, and returns the corresponding devPodWorkspaceInstanceTroubleshoot object, and an error if there is any. +func (c *FakeDevPodWorkspaceInstances) Troubleshoot(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstanceTroubleshoot, err error) { + emptyResult := &v1.DevPodWorkspaceInstanceTroubleshoot{} + obj, err := c.Fake. + Invokes(testing.NewGetSubresourceActionWithOptions(devpodworkspaceinstancesResource, c.ns, "troubleshoot", devPodWorkspaceInstanceName, options), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspaceInstanceTroubleshoot), err +} diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacepreset.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacepreset.go new file mode 100644 index 0000000..6929b12 --- /dev/null +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacepreset.go @@ -0,0 +1,122 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDevPodWorkspacePresets implements DevPodWorkspacePresetInterface +type FakeDevPodWorkspacePresets struct { + Fake *FakeManagementV1 +} + +var devpodworkspacepresetsResource = v1.SchemeGroupVersion.WithResource("devpodworkspacepresets") + +var devpodworkspacepresetsKind = v1.SchemeGroupVersion.WithKind("DevPodWorkspacePreset") + +// Get takes name of the devPodWorkspacePreset, and returns the corresponding devPodWorkspacePreset object, and an error if there is any. +func (c *FakeDevPodWorkspacePresets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(devpodworkspacepresetsResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// List takes label and field selectors, and returns the list of DevPodWorkspacePresets that match those selectors. +func (c *FakeDevPodWorkspacePresets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspacePresetList, err error) { + emptyResult := &v1.DevPodWorkspacePresetList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(devpodworkspacepresetsResource, devpodworkspacepresetsKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.DevPodWorkspacePresetList{ListMeta: obj.(*v1.DevPodWorkspacePresetList).ListMeta} + for _, item := range obj.(*v1.DevPodWorkspacePresetList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested devPodWorkspacePresets. +func (c *FakeDevPodWorkspacePresets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchActionWithOptions(devpodworkspacepresetsResource, opts)) +} + +// Create takes the representation of a devPodWorkspacePreset and creates it. Returns the server's representation of the devPodWorkspacePreset, and an error, if there is any. +func (c *FakeDevPodWorkspacePresets) Create(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.CreateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(devpodworkspacepresetsResource, devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// Update takes the representation of a devPodWorkspacePreset and updates it. Returns the server's representation of the devPodWorkspacePreset, and an error, if there is any. +func (c *FakeDevPodWorkspacePresets) Update(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(devpodworkspacepresetsResource, devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeDevPodWorkspacePresets) UpdateStatus(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(devpodworkspacepresetsResource, "status", devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// Delete takes name of the devPodWorkspacePreset and deletes it. Returns an error if one occurs. +func (c *FakeDevPodWorkspacePresets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(devpodworkspacepresetsResource, name, opts), &v1.DevPodWorkspacePreset{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDevPodWorkspacePresets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(devpodworkspacepresetsResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1.DevPodWorkspacePresetList{}) + return err +} + +// Patch applies the patch and returns the patched devPodWorkspacePreset. +func (c *FakeDevPodWorkspacePresets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(devpodworkspacepresetsResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_management_client.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_management_client.go index 6cccf41..942f0d6 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_management_client.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_management_client.go @@ -56,6 +56,10 @@ func (c *FakeManagementV1) DevPodWorkspaceInstances(namespace string) v1.DevPodW return &FakeDevPodWorkspaceInstances{c, namespace} } +func (c *FakeManagementV1) DevPodWorkspacePresets() v1.DevPodWorkspacePresetInterface { + return &FakeDevPodWorkspacePresets{c} +} + func (c *FakeManagementV1) DevPodWorkspaceTemplates() v1.DevPodWorkspaceTemplateInterface { return &FakeDevPodWorkspaceTemplates{c} } diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go index 56239ae..f2b5c3e 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go @@ -140,3 +140,15 @@ func (c *FakeVirtualClusterInstances) GetAccessKey(ctx context.Context, virtualC } return obj.(*v1.VirtualClusterAccessKey), err } + +// GetExternalDatabase takes the representation of a virtualClusterExternalDatabase and creates it. Returns the server's representation of the virtualClusterExternalDatabase, and an error, if there is any. +func (c *FakeVirtualClusterInstances) GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (result *v1.VirtualClusterExternalDatabase, err error) { + emptyResult := &v1.VirtualClusterExternalDatabase{} + obj, err := c.Fake. + Invokes(testing.NewCreateSubresourceActionWithOptions(virtualclusterinstancesResource, virtualClusterInstanceName, "externaldatabase", c.ns, virtualClusterExternalDatabase, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1.VirtualClusterExternalDatabase), err +} diff --git a/pkg/clientset/versioned/typed/management/v1/generated_expansion.go b/pkg/clientset/versioned/typed/management/v1/generated_expansion.go index f825564..d21459c 100644 --- a/pkg/clientset/versioned/typed/management/v1/generated_expansion.go +++ b/pkg/clientset/versioned/typed/management/v1/generated_expansion.go @@ -24,6 +24,8 @@ type DevPodEnvironmentTemplateExpansion interface{} type DevPodWorkspaceInstanceExpansion interface{} +type DevPodWorkspacePresetExpansion interface{} + type DevPodWorkspaceTemplateExpansion interface{} type DirectClusterEndpointTokenExpansion interface{} diff --git a/pkg/clientset/versioned/typed/management/v1/management_client.go b/pkg/clientset/versioned/typed/management/v1/management_client.go index be891c7..538a754 100644 --- a/pkg/clientset/versioned/typed/management/v1/management_client.go +++ b/pkg/clientset/versioned/typed/management/v1/management_client.go @@ -23,6 +23,7 @@ type ManagementV1Interface interface { ConvertVirtualClusterConfigsGetter DevPodEnvironmentTemplatesGetter DevPodWorkspaceInstancesGetter + DevPodWorkspacePresetsGetter DevPodWorkspaceTemplatesGetter DirectClusterEndpointTokensGetter EventsGetter @@ -102,6 +103,10 @@ func (c *ManagementV1Client) DevPodWorkspaceInstances(namespace string) DevPodWo return newDevPodWorkspaceInstances(c, namespace) } +func (c *ManagementV1Client) DevPodWorkspacePresets() DevPodWorkspacePresetInterface { + return newDevPodWorkspacePresets(c) +} + func (c *ManagementV1Client) DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInterface { return newDevPodWorkspaceTemplates(c) } diff --git a/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go b/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go index e8fef8a..cc7cf23 100644 --- a/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go @@ -31,6 +31,7 @@ type VirtualClusterInstanceInterface interface { Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterInstance, err error) GetKubeConfig(ctx context.Context, virtualClusterInstanceName string, virtualClusterInstanceKubeConfig *v1.VirtualClusterInstanceKubeConfig, opts metav1.CreateOptions) (*v1.VirtualClusterInstanceKubeConfig, error) GetAccessKey(ctx context.Context, virtualClusterInstanceName string, options metav1.GetOptions) (*v1.VirtualClusterAccessKey, error) + GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (*v1.VirtualClusterExternalDatabase, error) VirtualClusterInstanceExpansion } @@ -81,3 +82,18 @@ func (c *virtualClusterInstances) GetAccessKey(ctx context.Context, virtualClust Into(result) return } + +// GetExternalDatabase takes the representation of a virtualClusterExternalDatabase and creates it. Returns the server's representation of the virtualClusterExternalDatabase, and an error, if there is any. +func (c *virtualClusterInstances) GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (result *v1.VirtualClusterExternalDatabase, err error) { + result = &v1.VirtualClusterExternalDatabase{} + err = c.GetClient().Post(). + Namespace(c.GetNamespace()). + Resource("virtualclusterinstances"). + Name(virtualClusterInstanceName). + SubResource("externaldatabase"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualClusterExternalDatabase). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/storage/v1/devpodworkspacepreset.go b/pkg/clientset/versioned/typed/storage/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..6be3081 --- /dev/null +++ b/pkg/clientset/versioned/typed/storage/v1/devpodworkspacepreset.go @@ -0,0 +1,51 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + + v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// DevPodWorkspacePresetsGetter has a method to return a DevPodWorkspacePresetInterface. +// A group's client should implement this interface. +type DevPodWorkspacePresetsGetter interface { + DevPodWorkspacePresets() DevPodWorkspacePresetInterface +} + +// DevPodWorkspacePresetInterface has methods to work with DevPodWorkspacePreset resources. +type DevPodWorkspacePresetInterface interface { + Create(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.CreateOptions) (*v1.DevPodWorkspacePreset, error) + Update(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (*v1.DevPodWorkspacePreset, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DevPodWorkspacePreset, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DevPodWorkspacePresetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspacePreset, err error) + DevPodWorkspacePresetExpansion +} + +// devPodWorkspacePresets implements DevPodWorkspacePresetInterface +type devPodWorkspacePresets struct { + *gentype.ClientWithList[*v1.DevPodWorkspacePreset, *v1.DevPodWorkspacePresetList] +} + +// newDevPodWorkspacePresets returns a DevPodWorkspacePresets +func newDevPodWorkspacePresets(c *StorageV1Client) *devPodWorkspacePresets { + return &devPodWorkspacePresets{ + gentype.NewClientWithList[*v1.DevPodWorkspacePreset, *v1.DevPodWorkspacePresetList]( + "devpodworkspacepresets", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DevPodWorkspacePreset { return &v1.DevPodWorkspacePreset{} }, + func() *v1.DevPodWorkspacePresetList { return &v1.DevPodWorkspacePresetList{} }), + } +} diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacepreset.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacepreset.go new file mode 100644 index 0000000..12467c2 --- /dev/null +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacepreset.go @@ -0,0 +1,110 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDevPodWorkspacePresets implements DevPodWorkspacePresetInterface +type FakeDevPodWorkspacePresets struct { + Fake *FakeStorageV1 +} + +var devpodworkspacepresetsResource = v1.SchemeGroupVersion.WithResource("devpodworkspacepresets") + +var devpodworkspacepresetsKind = v1.SchemeGroupVersion.WithKind("DevPodWorkspacePreset") + +// Get takes name of the devPodWorkspacePreset, and returns the corresponding devPodWorkspacePreset object, and an error if there is any. +func (c *FakeDevPodWorkspacePresets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(devpodworkspacepresetsResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// List takes label and field selectors, and returns the list of DevPodWorkspacePresets that match those selectors. +func (c *FakeDevPodWorkspacePresets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspacePresetList, err error) { + emptyResult := &v1.DevPodWorkspacePresetList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(devpodworkspacepresetsResource, devpodworkspacepresetsKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.DevPodWorkspacePresetList{ListMeta: obj.(*v1.DevPodWorkspacePresetList).ListMeta} + for _, item := range obj.(*v1.DevPodWorkspacePresetList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested devPodWorkspacePresets. +func (c *FakeDevPodWorkspacePresets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchActionWithOptions(devpodworkspacepresetsResource, opts)) +} + +// Create takes the representation of a devPodWorkspacePreset and creates it. Returns the server's representation of the devPodWorkspacePreset, and an error, if there is any. +func (c *FakeDevPodWorkspacePresets) Create(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.CreateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(devpodworkspacepresetsResource, devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// Update takes the representation of a devPodWorkspacePreset and updates it. Returns the server's representation of the devPodWorkspacePreset, and an error, if there is any. +func (c *FakeDevPodWorkspacePresets) Update(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(devpodworkspacepresetsResource, devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// Delete takes name of the devPodWorkspacePreset and deletes it. Returns an error if one occurs. +func (c *FakeDevPodWorkspacePresets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(devpodworkspacepresetsResource, name, opts), &v1.DevPodWorkspacePreset{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDevPodWorkspacePresets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(devpodworkspacepresetsResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1.DevPodWorkspacePresetList{}) + return err +} + +// Patch applies the patch and returns the patched devPodWorkspacePreset. +func (c *FakeDevPodWorkspacePresets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(devpodworkspacepresetsResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_storage_client.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_storage_client.go index 81d78c2..3f2e892 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_storage_client.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_storage_client.go @@ -40,6 +40,10 @@ func (c *FakeStorageV1) DevPodWorkspaceInstances(namespace string) v1.DevPodWork return &FakeDevPodWorkspaceInstances{c, namespace} } +func (c *FakeStorageV1) DevPodWorkspacePresets() v1.DevPodWorkspacePresetInterface { + return &FakeDevPodWorkspacePresets{c} +} + func (c *FakeStorageV1) DevPodWorkspaceTemplates() v1.DevPodWorkspaceTemplateInterface { return &FakeDevPodWorkspaceTemplates{c} } diff --git a/pkg/clientset/versioned/typed/storage/v1/generated_expansion.go b/pkg/clientset/versioned/typed/storage/v1/generated_expansion.go index 6faed07..68e8095 100644 --- a/pkg/clientset/versioned/typed/storage/v1/generated_expansion.go +++ b/pkg/clientset/versioned/typed/storage/v1/generated_expansion.go @@ -16,6 +16,8 @@ type DevPodEnvironmentTemplateExpansion interface{} type DevPodWorkspaceInstanceExpansion interface{} +type DevPodWorkspacePresetExpansion interface{} + type DevPodWorkspaceTemplateExpansion interface{} type NetworkPeerExpansion interface{} diff --git a/pkg/clientset/versioned/typed/storage/v1/storage_client.go b/pkg/clientset/versioned/typed/storage/v1/storage_client.go index c360fa2..e3dbd35 100644 --- a/pkg/clientset/versioned/typed/storage/v1/storage_client.go +++ b/pkg/clientset/versioned/typed/storage/v1/storage_client.go @@ -19,6 +19,7 @@ type StorageV1Interface interface { ClusterRoleTemplatesGetter DevPodEnvironmentTemplatesGetter DevPodWorkspaceInstancesGetter + DevPodWorkspacePresetsGetter DevPodWorkspaceTemplatesGetter NetworkPeersGetter ProjectsGetter @@ -66,6 +67,10 @@ func (c *StorageV1Client) DevPodWorkspaceInstances(namespace string) DevPodWorks return newDevPodWorkspaceInstances(c, namespace) } +func (c *StorageV1Client) DevPodWorkspacePresets() DevPodWorkspacePresetInterface { + return newDevPodWorkspacePresets(c) +} + func (c *StorageV1Client) DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInterface { return newDevPodWorkspaceTemplates(c) } diff --git a/pkg/informers/externalversions/generic.go b/pkg/informers/externalversions/generic.go index 19bb27f..60138dd 100644 --- a/pkg/informers/externalversions/generic.go +++ b/pkg/informers/externalversions/generic.go @@ -61,6 +61,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Management().V1().DevPodEnvironmentTemplates().Informer()}, nil case v1.SchemeGroupVersion.WithResource("devpodworkspaceinstances"): return &genericInformer{resource: resource.GroupResource(), informer: f.Management().V1().DevPodWorkspaceInstances().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("devpodworkspacepresets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Management().V1().DevPodWorkspacePresets().Informer()}, nil case v1.SchemeGroupVersion.WithResource("devpodworkspacetemplates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Management().V1().DevPodWorkspaceTemplates().Informer()}, nil case v1.SchemeGroupVersion.WithResource("directclusterendpointtokens"): @@ -133,6 +135,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().DevPodEnvironmentTemplates().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("devpodworkspaceinstances"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().DevPodWorkspaceInstances().Informer()}, nil + case storagev1.SchemeGroupVersion.WithResource("devpodworkspacepresets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().DevPodWorkspacePresets().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("devpodworkspacetemplates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().DevPodWorkspaceTemplates().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("networkpeers"): diff --git a/pkg/informers/externalversions/management/v1/devpodworkspacepreset.go b/pkg/informers/externalversions/management/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..1150827 --- /dev/null +++ b/pkg/informers/externalversions/management/v1/devpodworkspacepreset.go @@ -0,0 +1,73 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + managementv1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" + versioned "github.com/loft-sh/api/v4/pkg/clientset/versioned" + internalinterfaces "github.com/loft-sh/api/v4/pkg/informers/externalversions/internalinterfaces" + v1 "github.com/loft-sh/api/v4/pkg/listers/management/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DevPodWorkspacePresetInformer provides access to a shared informer and lister for +// DevPodWorkspacePresets. +type DevPodWorkspacePresetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DevPodWorkspacePresetLister +} + +type devPodWorkspacePresetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDevPodWorkspacePresetInformer constructs a new informer for DevPodWorkspacePreset type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDevPodWorkspacePresetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDevPodWorkspacePresetInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDevPodWorkspacePresetInformer constructs a new informer for DevPodWorkspacePreset type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDevPodWorkspacePresetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ManagementV1().DevPodWorkspacePresets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ManagementV1().DevPodWorkspacePresets().Watch(context.TODO(), options) + }, + }, + &managementv1.DevPodWorkspacePreset{}, + resyncPeriod, + indexers, + ) +} + +func (f *devPodWorkspacePresetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDevPodWorkspacePresetInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *devPodWorkspacePresetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&managementv1.DevPodWorkspacePreset{}, f.defaultInformer) +} + +func (f *devPodWorkspacePresetInformer) Lister() v1.DevPodWorkspacePresetLister { + return v1.NewDevPodWorkspacePresetLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/management/v1/interface.go b/pkg/informers/externalversions/management/v1/interface.go index 38e860d..93aa6b1 100644 --- a/pkg/informers/externalversions/management/v1/interface.go +++ b/pkg/informers/externalversions/management/v1/interface.go @@ -30,6 +30,8 @@ type Interface interface { DevPodEnvironmentTemplates() DevPodEnvironmentTemplateInformer // DevPodWorkspaceInstances returns a DevPodWorkspaceInstanceInformer. DevPodWorkspaceInstances() DevPodWorkspaceInstanceInformer + // DevPodWorkspacePresets returns a DevPodWorkspacePresetInformer. + DevPodWorkspacePresets() DevPodWorkspacePresetInformer // DevPodWorkspaceTemplates returns a DevPodWorkspaceTemplateInformer. DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInformer // DirectClusterEndpointTokens returns a DirectClusterEndpointTokenInformer. @@ -154,6 +156,11 @@ func (v *version) DevPodWorkspaceInstances() DevPodWorkspaceInstanceInformer { return &devPodWorkspaceInstanceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// DevPodWorkspacePresets returns a DevPodWorkspacePresetInformer. +func (v *version) DevPodWorkspacePresets() DevPodWorkspacePresetInformer { + return &devPodWorkspacePresetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // DevPodWorkspaceTemplates returns a DevPodWorkspaceTemplateInformer. func (v *version) DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInformer { return &devPodWorkspaceTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/pkg/informers/externalversions/storage/v1/devpodworkspacepreset.go b/pkg/informers/externalversions/storage/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..2ed8915 --- /dev/null +++ b/pkg/informers/externalversions/storage/v1/devpodworkspacepreset.go @@ -0,0 +1,73 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + versioned "github.com/loft-sh/api/v4/pkg/clientset/versioned" + internalinterfaces "github.com/loft-sh/api/v4/pkg/informers/externalversions/internalinterfaces" + v1 "github.com/loft-sh/api/v4/pkg/listers/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DevPodWorkspacePresetInformer provides access to a shared informer and lister for +// DevPodWorkspacePresets. +type DevPodWorkspacePresetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DevPodWorkspacePresetLister +} + +type devPodWorkspacePresetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDevPodWorkspacePresetInformer constructs a new informer for DevPodWorkspacePreset type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDevPodWorkspacePresetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDevPodWorkspacePresetInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDevPodWorkspacePresetInformer constructs a new informer for DevPodWorkspacePreset type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDevPodWorkspacePresetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().DevPodWorkspacePresets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().DevPodWorkspacePresets().Watch(context.TODO(), options) + }, + }, + &storagev1.DevPodWorkspacePreset{}, + resyncPeriod, + indexers, + ) +} + +func (f *devPodWorkspacePresetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDevPodWorkspacePresetInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *devPodWorkspacePresetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&storagev1.DevPodWorkspacePreset{}, f.defaultInformer) +} + +func (f *devPodWorkspacePresetInformer) Lister() v1.DevPodWorkspacePresetLister { + return v1.NewDevPodWorkspacePresetLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/storage/v1/interface.go b/pkg/informers/externalversions/storage/v1/interface.go index d2f36b8..1c2b075 100644 --- a/pkg/informers/externalversions/storage/v1/interface.go +++ b/pkg/informers/externalversions/storage/v1/interface.go @@ -22,6 +22,8 @@ type Interface interface { DevPodEnvironmentTemplates() DevPodEnvironmentTemplateInformer // DevPodWorkspaceInstances returns a DevPodWorkspaceInstanceInformer. DevPodWorkspaceInstances() DevPodWorkspaceInstanceInformer + // DevPodWorkspacePresets returns a DevPodWorkspacePresetInformer. + DevPodWorkspacePresets() DevPodWorkspacePresetInformer // DevPodWorkspaceTemplates returns a DevPodWorkspaceTemplateInformer. DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInformer // NetworkPeers returns a NetworkPeerInformer. @@ -94,6 +96,11 @@ func (v *version) DevPodWorkspaceInstances() DevPodWorkspaceInstanceInformer { return &devPodWorkspaceInstanceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// DevPodWorkspacePresets returns a DevPodWorkspacePresetInformer. +func (v *version) DevPodWorkspacePresets() DevPodWorkspacePresetInformer { + return &devPodWorkspacePresetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // DevPodWorkspaceTemplates returns a DevPodWorkspaceTemplateInformer. func (v *version) DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInformer { return &devPodWorkspaceTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/pkg/listers/management/v1/devpodworkspacepreset.go b/pkg/listers/management/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..8a1b33e --- /dev/null +++ b/pkg/listers/management/v1/devpodworkspacepreset.go @@ -0,0 +1,32 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" +) + +// DevPodWorkspacePresetLister helps list DevPodWorkspacePresets. +// All objects returned here must be treated as read-only. +type DevPodWorkspacePresetLister interface { + // List lists all DevPodWorkspacePresets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DevPodWorkspacePreset, err error) + // Get retrieves the DevPodWorkspacePreset from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DevPodWorkspacePreset, error) + DevPodWorkspacePresetListerExpansion +} + +// devPodWorkspacePresetLister implements the DevPodWorkspacePresetLister interface. +type devPodWorkspacePresetLister struct { + listers.ResourceIndexer[*v1.DevPodWorkspacePreset] +} + +// NewDevPodWorkspacePresetLister returns a new DevPodWorkspacePresetLister. +func NewDevPodWorkspacePresetLister(indexer cache.Indexer) DevPodWorkspacePresetLister { + return &devPodWorkspacePresetLister{listers.New[*v1.DevPodWorkspacePreset](indexer, v1.Resource("devpodworkspacepreset"))} +} diff --git a/pkg/listers/management/v1/expansion_generated.go b/pkg/listers/management/v1/expansion_generated.go index 534e225..7870d44 100644 --- a/pkg/listers/management/v1/expansion_generated.go +++ b/pkg/listers/management/v1/expansion_generated.go @@ -50,6 +50,10 @@ type DevPodWorkspaceInstanceListerExpansion interface{} // DevPodWorkspaceInstanceNamespaceLister. type DevPodWorkspaceInstanceNamespaceListerExpansion interface{} +// DevPodWorkspacePresetListerExpansion allows custom methods to be added to +// DevPodWorkspacePresetLister. +type DevPodWorkspacePresetListerExpansion interface{} + // DevPodWorkspaceTemplateListerExpansion allows custom methods to be added to // DevPodWorkspaceTemplateLister. type DevPodWorkspaceTemplateListerExpansion interface{} diff --git a/pkg/listers/storage/v1/devpodworkspacepreset.go b/pkg/listers/storage/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..ca47505 --- /dev/null +++ b/pkg/listers/storage/v1/devpodworkspacepreset.go @@ -0,0 +1,32 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" +) + +// DevPodWorkspacePresetLister helps list DevPodWorkspacePresets. +// All objects returned here must be treated as read-only. +type DevPodWorkspacePresetLister interface { + // List lists all DevPodWorkspacePresets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DevPodWorkspacePreset, err error) + // Get retrieves the DevPodWorkspacePreset from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DevPodWorkspacePreset, error) + DevPodWorkspacePresetListerExpansion +} + +// devPodWorkspacePresetLister implements the DevPodWorkspacePresetLister interface. +type devPodWorkspacePresetLister struct { + listers.ResourceIndexer[*v1.DevPodWorkspacePreset] +} + +// NewDevPodWorkspacePresetLister returns a new DevPodWorkspacePresetLister. +func NewDevPodWorkspacePresetLister(indexer cache.Indexer) DevPodWorkspacePresetLister { + return &devPodWorkspacePresetLister{listers.New[*v1.DevPodWorkspacePreset](indexer, v1.Resource("devpodworkspacepreset"))} +} diff --git a/pkg/listers/storage/v1/expansion_generated.go b/pkg/listers/storage/v1/expansion_generated.go index a609945..dd70675 100644 --- a/pkg/listers/storage/v1/expansion_generated.go +++ b/pkg/listers/storage/v1/expansion_generated.go @@ -34,6 +34,10 @@ type DevPodWorkspaceInstanceListerExpansion interface{} // DevPodWorkspaceInstanceNamespaceLister. type DevPodWorkspaceInstanceNamespaceListerExpansion interface{} +// DevPodWorkspacePresetListerExpansion allows custom methods to be added to +// DevPodWorkspacePresetLister. +type DevPodWorkspacePresetListerExpansion interface{} + // DevPodWorkspaceTemplateListerExpansion allows custom methods to be added to // DevPodWorkspaceTemplateLister. type DevPodWorkspaceTemplateListerExpansion interface{} diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index a60f689..cfadf0f 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -114,6 +114,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.BackupList": schema_pkg_apis_management_v1_BackupList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.BackupSpec": schema_pkg_apis_management_v1_BackupSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.BackupStatus": schema_pkg_apis_management_v1_BackupStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud": schema_pkg_apis_management_v1_Cloud(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.Cluster": schema_pkg_apis_management_v1_Cluster(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ClusterAccess": schema_pkg_apis_management_v1_ClusterAccess(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ClusterAccessKey": schema_pkg_apis_management_v1_ClusterAccessKey(ref), @@ -155,6 +156,11 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.ConvertVirtualClusterConfigList": schema_pkg_apis_management_v1_ConvertVirtualClusterConfigList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ConvertVirtualClusterConfigSpec": schema_pkg_apis_management_v1_ConvertVirtualClusterConfigSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ConvertVirtualClusterConfigStatus": schema_pkg_apis_management_v1_ConvertVirtualClusterConfigStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControl": schema_pkg_apis_management_v1_CostControl(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlClusterConfig": schema_pkg_apis_management_v1_CostControlClusterConfig(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlGlobalConfig": schema_pkg_apis_management_v1_CostControlGlobalConfig(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice": schema_pkg_apis_management_v1_CostControlResourcePrice(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings": schema_pkg_apis_management_v1_CostControlSettings(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodDeleteOptions": schema_pkg_apis_management_v1_DevPodDeleteOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodDeleteOptionsList": schema_pkg_apis_management_v1_DevPodDeleteOptionsList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodEnvironmentTemplate": schema_pkg_apis_management_v1_DevPodEnvironmentTemplate(ref), @@ -175,6 +181,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceState(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceStateList": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStateList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceStatus": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceTroubleshoot(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshootList": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceTroubleshootList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset": schema_pkg_apis_management_v1_DevPodWorkspacePreset(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetList": schema_pkg_apis_management_v1_DevPodWorkspacePresetList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSource": schema_pkg_apis_management_v1_DevPodWorkspacePresetSource(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSpec": schema_pkg_apis_management_v1_DevPodWorkspacePresetSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetStatus": schema_pkg_apis_management_v1_DevPodWorkspacePresetStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate": schema_pkg_apis_management_v1_DevPodWorkspaceTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateList": schema_pkg_apis_management_v1_DevPodWorkspaceTemplateList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateSpec": schema_pkg_apis_management_v1_DevPodWorkspaceTemplateSpec(ref), @@ -191,7 +204,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.FeatureList": schema_pkg_apis_management_v1_FeatureList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.FeatureSpec": schema_pkg_apis_management_v1_FeatureSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.FeatureStatus": schema_pkg_apis_management_v1_FeatureStatus(ref), - "github.com/loft-sh/api/v4/pkg/apis/management/v1.GitEnvironmentTemplate": schema_pkg_apis_management_v1_GitEnvironmentTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.GroupResources": schema_pkg_apis_management_v1_GroupResources(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.IngressAuthToken": schema_pkg_apis_management_v1_IngressAuthToken(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.IngressAuthTokenList": schema_pkg_apis_management_v1_IngressAuthTokenList(ref), @@ -217,6 +229,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.LoftUpgradeList": schema_pkg_apis_management_v1_LoftUpgradeList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.LoftUpgradeSpec": schema_pkg_apis_management_v1_LoftUpgradeSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.LoftUpgradeStatus": schema_pkg_apis_management_v1_LoftUpgradeStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.MaintenanceWindow": schema_pkg_apis_management_v1_MaintenanceWindow(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDC": schema_pkg_apis_management_v1_OIDC(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDCClient": schema_pkg_apis_management_v1_OIDCClient(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDCClientList": schema_pkg_apis_management_v1_OIDCClientList(ref), @@ -342,6 +355,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.UserVirtualClustersOptions": schema_pkg_apis_management_v1_UserVirtualClustersOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKey": schema_pkg_apis_management_v1_VirtualClusterAccessKey(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKeyList": schema_pkg_apis_management_v1_VirtualClusterAccessKeyList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase": schema_pkg_apis_management_v1_VirtualClusterExternalDatabase(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseList": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstance": schema_pkg_apis_management_v1_VirtualClusterInstance(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig": schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfig(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigList": schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfigList(ref), @@ -415,8 +432,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodCommandStopOptions": schema_pkg_apis_storage_v1_DevPodCommandStopOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodCommandUpOptions": schema_pkg_apis_storage_v1_DevPodCommandUpOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplate": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplate(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateDefinition(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateList": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateList(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateSpec": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateStatus": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateVersion(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec": schema_pkg_apis_storage_v1_DevPodProjectSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProviderOption": schema_pkg_apis_storage_v1_DevPodProviderOption(ref), @@ -427,6 +446,12 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceSpec": schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceStatus": schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceTemplateDefinition": schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceTemplateDefinition(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePreset": schema_pkg_apis_storage_v1_DevPodWorkspacePreset(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetList": schema_pkg_apis_storage_v1_DevPodWorkspacePresetList(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource": schema_pkg_apis_storage_v1_DevPodWorkspacePresetSource(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSpec": schema_pkg_apis_storage_v1_DevPodWorkspacePresetSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetStatus": schema_pkg_apis_storage_v1_DevPodWorkspacePresetStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion": schema_pkg_apis_storage_v1_DevPodWorkspacePresetVersion(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceProvider": schema_pkg_apis_storage_v1_DevPodWorkspaceProvider(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplate": schema_pkg_apis_storage_v1_DevPodWorkspaceTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition": schema_pkg_apis_storage_v1_DevPodWorkspaceTemplateDefinition(ref), @@ -456,13 +481,16 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.LocalClusterRoleTemplate": schema_pkg_apis_storage_v1_LocalClusterRoleTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.LocalClusterRoleTemplateSpec": schema_pkg_apis_storage_v1_LocalClusterRoleTemplateSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member": schema_pkg_apis_storage_v1_Member(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics": schema_pkg_apis_storage_v1_Metrics(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern": schema_pkg_apis_storage_v1_NamespacePattern(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeer": schema_pkg_apis_storage_v1_NetworkPeer(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeerList": schema_pkg_apis_storage_v1_NetworkPeerList(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeerSpec": schema_pkg_apis_storage_v1_NetworkPeerSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeerStatus": schema_pkg_apis_storage_v1_NetworkPeerStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ObjectsStatus": schema_pkg_apis_storage_v1_ObjectsStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost": schema_pkg_apis_storage_v1_OpenCost(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PodSelector": schema_pkg_apis_storage_v1_PodSelector(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef": schema_pkg_apis_storage_v1_PresetRef(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Project": schema_pkg_apis_storage_v1_Project(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ProjectList": schema_pkg_apis_storage_v1_ProjectList(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ProjectSpec": schema_pkg_apis_storage_v1_ProjectSpec(ref), @@ -475,6 +503,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas": schema_pkg_apis_storage_v1_Quotas(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec": schema_pkg_apis_storage_v1_RancherIntegrationSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherProjectRef": schema_pkg_apis_storage_v1_RancherProjectRef(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset": schema_pkg_apis_storage_v1_RequirePreset(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate": schema_pkg_apis_storage_v1_RequireTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Runner": schema_pkg_apis_storage_v1_Runner(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerClusterRef": schema_pkg_apis_storage_v1_RunnerClusterRef(ref), @@ -505,6 +534,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SpaceTemplateSpec": schema_pkg_apis_storage_v1_SpaceTemplateSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SpaceTemplateStatus": schema_pkg_apis_storage_v1_SpaceTemplateStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SpaceTemplateVersion": schema_pkg_apis_storage_v1_SpaceTemplateVersion(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Storage": schema_pkg_apis_storage_v1_Storage(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.StreamContainer": schema_pkg_apis_storage_v1_StreamContainer(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SyncMembersSpec": schema_pkg_apis_storage_v1_SyncMembersSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Target": schema_pkg_apis_storage_v1_Target(ref), @@ -553,6 +583,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VirtualClusterTemplateSpec": schema_pkg_apis_storage_v1_VirtualClusterTemplateSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VirtualClusterTemplateStatus": schema_pkg_apis_storage_v1_VirtualClusterTemplateStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VirtualClusterTemplateVersion": schema_pkg_apis_storage_v1_VirtualClusterTemplateVersion(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.WorkspaceRef": schema_pkg_apis_storage_v1_WorkspaceRef(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.WorkspaceStatusResult": schema_pkg_apis_storage_v1_WorkspaceStatusResult(ref), "github.com/loft-sh/api/v4/pkg/apis/ui/v1.NavBarButton": schema_pkg_apis_ui_v1_NavBarButton(ref), "github.com/loft-sh/api/v4/pkg/apis/ui/v1.UISettings": schema_pkg_apis_ui_v1_UISettings(ref), @@ -6587,6 +6618,34 @@ func schema_pkg_apis_management_v1_BackupStatus(ref common.ReferenceCallback) co } } +func schema_pkg_apis_management_v1_Cloud(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "releaseChannel": { + SchemaProps: spec.SchemaProps{ + Description: "ReleaseChannel specifies the release channel for the cloud configuration. This can be used to determine which updates or versions are applied.", + Type: []string{"string"}, + Format: "", + }, + }, + "maintenanceWindow": { + SchemaProps: spec.SchemaProps{ + Description: "MaintenanceWindow specifies the maintenance window for the cloud configuration. This is a structured representation of the time window during which maintenance can occur.", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.MaintenanceWindow"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.MaintenanceWindow"}, + } +} + func schema_pkg_apis_management_v1_Cluster(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -8070,11 +8129,23 @@ func schema_pkg_apis_management_v1_ClusterSpec(ref common.ReferenceCallback) com }, }, }, + "metrics": { + SchemaProps: spec.SchemaProps{ + Description: "Metrics holds the cluster's metrics backend configuration", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, + "opencost": { + SchemaProps: spec.SchemaProps{ + Description: "OpenCost holds the cluster's OpenCost backend configuration", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -8103,6 +8174,20 @@ func schema_pkg_apis_management_v1_ClusterStatus(ref common.ReferenceCallback) c Format: "", }, }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "Conditions holds several conditions the cluster might be in", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"), + }, + }, + }, + }, + }, "online": { SchemaProps: spec.SchemaProps{ Description: "Online is whether the cluster is currently connected to the coordination server.", @@ -8113,6 +8198,8 @@ func schema_pkg_apis_management_v1_ClusterStatus(ref common.ReferenceCallback) c }, }, }, + Dependencies: []string{ + "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"}, } } @@ -8412,11 +8499,23 @@ func schema_pkg_apis_management_v1_ConfigStatus(ref common.ReferenceCallback) co Format: "", }, }, + "cloud": { + SchemaProps: spec.SchemaProps{ + Description: "Cloud holds the settings to be used exclusively in vCluster Cloud based environments and deployments.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud"), + }, + }, + "costControl": { + SchemaProps: spec.SchemaProps{ + Description: "CostControl holds the settings related to the Cost Control ROI dashboard and its metrics gathering infrastructure", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControl"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.Apps", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Audit", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Authentication", "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDC", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/ui/v1.UISettingsConfig"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.Apps", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Audit", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Authentication", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud", "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControl", "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDC", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/ui/v1.UISettingsConfig"}, } } @@ -8701,6 +8800,158 @@ func schema_pkg_apis_management_v1_ConvertVirtualClusterConfigStatus(ref common. } } +func schema_pkg_apis_management_v1_CostControl(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "enabled": { + SchemaProps: spec.SchemaProps{ + Description: "Enabled specifies whether the ROI dashboard should be available in the UI, and if the metrics infrastructure that provides dashboard data is deployed", + Type: []string{"boolean"}, + Format: "", + }, + }, + "global": { + SchemaProps: spec.SchemaProps{ + Description: "Global are settings for globally managed components", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlGlobalConfig"), + }, + }, + "cluster": { + SchemaProps: spec.SchemaProps{ + Description: "Cluster are settings for each cluster's managed components. These settings apply to all connected clusters unless overridden by modifying the Cluster's spec", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlClusterConfig"), + }, + }, + "settings": { + SchemaProps: spec.SchemaProps{ + Description: "Settings specify price-related settings that are taken into account for the ROI dashboard calculations.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlClusterConfig", "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlGlobalConfig", "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings"}, + } +} + +func schema_pkg_apis_management_v1_CostControlClusterConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metrics": { + SchemaProps: spec.SchemaProps{ + Description: "Metrics are settings applied to metric infrastructure in each connected cluster. These can be overridden in individual clusters by modifying the Cluster's spec", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, + "opencost": { + SchemaProps: spec.SchemaProps{ + Description: "OpenCost are settings applied to OpenCost deployments in each connected cluster. These can be overridden in individual clusters by modifying the Cluster's spec", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost"}, + } +} + +func schema_pkg_apis_management_v1_CostControlGlobalConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metrics": { + SchemaProps: spec.SchemaProps{ + Description: "Metrics these settings apply to metric infrastructure used to aggregate metrics across all connected clusters", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"}, + } +} + +func schema_pkg_apis_management_v1_CostControlResourcePrice(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "price": { + SchemaProps: spec.SchemaProps{ + Description: "Price specifies the price.", + Type: []string{"number"}, + Format: "double", + }, + }, + "timePeriod": { + SchemaProps: spec.SchemaProps{ + Description: "TimePeriod specifies the time period for the price.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_CostControlSettings(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "priceCurrency": { + SchemaProps: spec.SchemaProps{ + Description: "PriceCurrency specifies the currency.", + Type: []string{"string"}, + Format: "", + }, + }, + "averageCPUPricePerNode": { + SchemaProps: spec.SchemaProps{ + Description: "AvgCPUPricePerNode specifies the average CPU price per node.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice"), + }, + }, + "averageRAMPricePerNode": { + SchemaProps: spec.SchemaProps{ + Description: "AvgRAMPricePerNode specifies the average RAM price per node.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice"), + }, + }, + "controlPlanePricePerCluster": { + SchemaProps: spec.SchemaProps{ + Description: "ControlPlanePricePerCluster specifies the price of one physical cluster.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice"}, + } +} + func schema_pkg_apis_management_v1_DevPodDeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -8891,11 +9142,11 @@ func schema_pkg_apis_management_v1_DevPodEnvironmentTemplateSpec(ref common.Refe Format: "", }, }, - "git": { + "description": { SchemaProps: spec.SchemaProps{ - Description: "Git holds configuration for git environment spec source", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"), + Description: "Description describes the environment template", + Type: []string{"string"}, + Format: "", }, }, "owner": { @@ -8918,6 +9169,12 @@ func schema_pkg_apis_management_v1_DevPodEnvironmentTemplateSpec(ref common.Refe }, }, }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the inline template to use for DevPod environments", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition"), + }, + }, "versions": { SchemaProps: spec.SchemaProps{ Description: "Versions are different versions of the template that can be referenced as well", @@ -8936,7 +9193,7 @@ func schema_pkg_apis_management_v1_DevPodEnvironmentTemplateSpec(ref common.Refe }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -9418,6 +9675,12 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceSpec(ref common.Refere Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), }, }, + "presetRef": { + SchemaProps: spec.SchemaProps{ + Description: "PresetRef holds the DevPodWorkspacePreset template reference", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef"), + }, + }, "templateRef": { SchemaProps: spec.SchemaProps{ Description: "TemplateRef holds the DevPod machine template reference", @@ -9427,7 +9690,6 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceSpec(ref common.Refere "environmentRef": { SchemaProps: spec.SchemaProps{ Description: "EnvironmentRef is the reference to DevPodEnvironmentTemplate that should be used", - Default: map[string]interface{}{}, Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), }, }, @@ -9476,7 +9738,7 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceSpec(ref common.Refere }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -9651,12 +9913,11 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStatus(ref common.Refe } } -func schema_pkg_apis_management_v1_DevPodWorkspaceTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceTroubleshoot(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DevPodWorkspaceTemplate holds the information", - Type: []string{"object"}, + Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { SchemaProps: spec.SchemaProps{ @@ -9678,27 +9939,77 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceTemplate(ref common.ReferenceC Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, - "spec": { + "state": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateSpec"), + Description: "State holds the workspaces state as given by 'devpod export'", + Type: []string{"string"}, + Format: "", }, }, - "status": { + "workspace": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateStatus"), + Description: "Workspace holds the workspace's instance object data", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstance"), + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template holds the workspace instance's template used to create it. This is the raw template, not the rendered one.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplate"), + }, + }, + "pods": { + SchemaProps: spec.SchemaProps{ + Description: "Pods is a list of pod objects that are linked to the workspace.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Pod"), + }, + }, + }, + }, + }, + "pvcs": { + SchemaProps: spec.SchemaProps{ + Description: "PVCs is a list of PVC objects that are linked to the workspace.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaim"), + }, + }, + }, + }, + }, + "errors": { + SchemaProps: spec.SchemaProps{ + Description: "Errors is a list of errors that occurred while trying to collect informations for troubleshooting.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, }, }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstance", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplate", "k8s.io/api/core/v1.PersistentVolumeClaim", "k8s.io/api/core/v1.Pod", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_pkg_apis_management_v1_DevPodWorkspaceTemplateList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceTroubleshootList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -9731,7 +10042,7 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceTemplateList(ref common.Refere Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot"), }, }, }, @@ -9742,110 +10053,230 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceTemplateList(ref common.Refere }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_management_v1_DevPodWorkspaceTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DevPodWorkspacePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DevPodWorkspaceTemplateSpec holds the specification", + Description: "DevPodWorkspacePreset", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "displayName": { + "kind": { SchemaProps: spec.SchemaProps{ - Description: "DisplayName is the name that is shown in the UI", + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", Type: []string{"string"}, Format: "", }, }, - "description": { + "apiVersion": { SchemaProps: spec.SchemaProps{ - Description: "Description describes the virtual cluster template", + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", Type: []string{"string"}, Format: "", }, }, - "owner": { + "metadata": { SchemaProps: spec.SchemaProps{ - Description: "Owner holds the owner of this object", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, - "parameters": { + "spec": { SchemaProps: spec.SchemaProps{ - Description: "Parameters define additional app parameters that will set provider values", - Type: []string{"array"}, + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_management_v1_DevPodWorkspacePresetList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.AppParameter"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset"), }, }, }, }, }, - "template": { + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_management_v1_DevPodWorkspacePresetSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresetSource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "git": { SchemaProps: spec.SchemaProps{ - Description: "Template holds the DevPod workspace template", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition"), + Description: "Git stores path to git repo to use as workspace source", + Type: []string{"string"}, + Format: "", }, }, - "versions": { + "image": { SchemaProps: spec.SchemaProps{ - Description: "Versions are different versions of the template that can be referenced as well", + Description: "Image stores container image to use as workspace source", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_DevPodWorkspacePresetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresetSpec holds the specification", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "displayName": { + SchemaProps: spec.SchemaProps{ + Description: "DisplayName is the name that should be displayed in the UI", + Type: []string{"string"}, + Format: "", + }, + }, + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source stores inline path of project source", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource"), + }, + }, + "infrastructureRef": { + SchemaProps: spec.SchemaProps{ + Description: "InfrastructureRef stores reference to DevPodWorkspaceTemplate to use", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"), + }, + }, + "environmentRef": { + SchemaProps: spec.SchemaProps{ + Description: "EnvironmentRef stores reference to DevPodEnvironmentTemplate", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), + }, + }, + "useProjectGitCredentials": { + SchemaProps: spec.SchemaProps{ + Description: "UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment", + Type: []string{"boolean"}, + Format: "", + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Owner holds the owner of this object", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), + }, + }, + "access": { + SchemaProps: spec.SchemaProps{ + Description: "Access to the DevPod machine instance object itself", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateVersion"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access"), }, }, }, }, }, - "access": { + "versions": { SchemaProps: spec.SchemaProps{ - Description: "Access holds the access rights for users and teams", + Description: "Versions are different versions of the template that can be referenced as well", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion"), }, }, }, }, }, }, + Required: []string{"source", "infrastructureRef"}, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AppParameter", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } -func schema_pkg_apis_management_v1_DevPodWorkspaceTemplateStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DevPodWorkspacePresetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DevPodWorkspaceTemplateStatus holds the status", + Description: "DevPodWorkspacePresetStatus holds the status", Type: []string{"object"}, }, }, } } -func schema_pkg_apis_management_v1_DirectClusterEndpointToken(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DevPodWorkspaceTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DirectClusterEndpointToken holds the object information", + Description: "DevPodWorkspaceTemplate holds the information", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -9871,24 +10302,24 @@ func schema_pkg_apis_management_v1_DirectClusterEndpointToken(ref common.Referen "spec": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointTokenSpec"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointTokenStatus"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateStatus"), }, }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointTokenSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointTokenStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_pkg_apis_management_v1_DirectClusterEndpointTokenList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DevPodWorkspaceTemplateList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -9921,7 +10352,7 @@ func schema_pkg_apis_management_v1_DirectClusterEndpointTokenList(ref common.Ref Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointToken"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate"), }, }, }, @@ -9932,62 +10363,110 @@ func schema_pkg_apis_management_v1_DirectClusterEndpointTokenList(ref common.Ref }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointToken", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_management_v1_DirectClusterEndpointTokenSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DevPodWorkspaceTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DirectClusterEndpointTokenSpec holds the object specification", + Description: "DevPodWorkspaceTemplateSpec holds the specification", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "ttl": { + "displayName": { SchemaProps: spec.SchemaProps{ - Description: "The time to life for this access token in seconds", - Type: []string{"integer"}, - Format: "int64", + Description: "DisplayName is the name that is shown in the UI", + Type: []string{"string"}, + Format: "", }, }, - "scope": { + "description": { SchemaProps: spec.SchemaProps{ - Description: "Scope is the optional scope of the direct cluster endpoint", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.AccessKeyScope"), + Description: "Description describes the virtual cluster template", + Type: []string{"string"}, + Format: "", + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Owner holds the owner of this object", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters define additional app parameters that will set provider values", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.AppParameter"), + }, + }, + }, + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template holds the DevPod workspace template", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition"), + }, + }, + "versions": { + SchemaProps: spec.SchemaProps{ + Description: "Versions are different versions of the template that can be referenced as well", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateVersion"), + }, + }, + }, + }, + }, + "access": { + SchemaProps: spec.SchemaProps{ + Description: "Access holds the access rights for users and teams", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access"), + }, + }, + }, }, }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AccessKeyScope"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AppParameter", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } -func schema_pkg_apis_management_v1_DirectClusterEndpointTokenStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DevPodWorkspaceTemplateStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DirectClusterEndpointTokenStatus holds the object status", + Description: "DevPodWorkspaceTemplateStatus holds the status", Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "token": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, }, }, } } -func schema_pkg_apis_management_v1_Event(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DirectClusterEndpointToken(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "Event holds an event", + Description: "DirectClusterEndpointToken holds the object information", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -10013,24 +10492,24 @@ func schema_pkg_apis_management_v1_Event(ref common.ReferenceCallback) common.Op "spec": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.EventSpec"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointTokenSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.EventStatus"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointTokenStatus"), }, }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.EventSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.EventStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointTokenSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointTokenStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_pkg_apis_management_v1_EventList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DirectClusterEndpointTokenList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -10063,7 +10542,7 @@ func schema_pkg_apis_management_v1_EventList(ref common.ReferenceCallback) commo Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.Event"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointToken"), }, }, }, @@ -10074,20 +10553,162 @@ func schema_pkg_apis_management_v1_EventList(ref common.ReferenceCallback) commo }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.Event", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DirectClusterEndpointToken", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_management_v1_EventSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_DirectClusterEndpointTokenSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "EventSpec holds the specification", + Description: "DirectClusterEndpointTokenSpec holds the object specification", Type: []string{"object"}, - }, - }, - } -} + Properties: map[string]spec.Schema{ + "ttl": { + SchemaProps: spec.SchemaProps{ + Description: "The time to life for this access token in seconds", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "scope": { + SchemaProps: spec.SchemaProps{ + Description: "Scope is the optional scope of the direct cluster endpoint", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.AccessKeyScope"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AccessKeyScope"}, + } +} + +func schema_pkg_apis_management_v1_DirectClusterEndpointTokenStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DirectClusterEndpointTokenStatus holds the object status", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "token": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_Event(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Event holds an event", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.EventSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.EventStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.EventSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.EventStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_management_v1_EventList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.Event"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.Event", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_management_v1_EventSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "EventSpec holds the specification", + Type: []string{"object"}, + }, + }, + } +} func schema_pkg_apis_management_v1_EventStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ @@ -10429,42 +11050,6 @@ func schema_pkg_apis_management_v1_FeatureStatus(ref common.ReferenceCallback) c } } -func schema_pkg_apis_management_v1_GitEnvironmentTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GitEnvironmentTemplate stores configuration of Git environment template source", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "repository": { - SchemaProps: spec.SchemaProps{ - Description: "Repository stores repository URL for Git environment spec source", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "revision": { - SchemaProps: spec.SchemaProps{ - Description: "Revision stores revision to checkout in repository", - Type: []string{"string"}, - Format: "", - }, - }, - "subpath": { - SchemaProps: spec.SchemaProps{ - Description: "SubPath stores subpath within Repositor where environment spec is", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"repository"}, - }, - }, - } -} - func schema_pkg_apis_management_v1_GroupResources(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -11374,6 +11959,32 @@ func schema_pkg_apis_management_v1_LoftUpgradeStatus(ref common.ReferenceCallbac } } +func schema_pkg_apis_management_v1_MaintenanceWindow(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dayOfWeek": { + SchemaProps: spec.SchemaProps{ + Description: "DayOfWeek specifies the day of the week for the maintenance window. It should be a string representing the day, e.g., \"Monday\", \"Tuesday\", etc.", + Type: []string{"string"}, + Format: "", + }, + }, + "timeWindow": { + SchemaProps: spec.SchemaProps{ + Description: "TimeWindow specifies the time window for the maintenance. It should be a string representing the time range in 24-hour format, in UTC, e.g., \"02:00-03:00\".", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_management_v1_OIDC(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -13209,6 +13820,13 @@ func schema_pkg_apis_management_v1_ProjectSpec(ref common.ReferenceCallback) com Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate"), }, }, + "requirePreset": { + SchemaProps: spec.SchemaProps{ + Description: "RequirePreset configures if a preset is required for instance creation.", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset"), + }, + }, "members": { SchemaProps: spec.SchemaProps{ Description: "Members are the users and teams that are part of this project", @@ -13271,7 +13889,7 @@ func schema_pkg_apis_management_v1_ProjectSpec(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedCluster", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedRunner", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ArgoIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedCluster", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedRunner", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ArgoIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec"}, } } @@ -13413,6 +14031,20 @@ func schema_pkg_apis_management_v1_ProjectTemplates(ref common.ReferenceCallback }, }, }, + "devPodWorkspacePresets": { + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresets holds all the allowed workspace presets", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset"), + }, + }, + }, + }, + }, "defaultDevPodEnvironmentTemplate": { SchemaProps: spec.SchemaProps{ Description: "DefaultDevPodEnvironmentTemplate", @@ -13424,7 +14056,7 @@ func schema_pkg_apis_management_v1_ProjectTemplates(ref common.ReferenceCallback }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodEnvironmentTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.SpaceTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodEnvironmentTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.SpaceTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -17712,11 +18344,11 @@ func schema_pkg_apis_management_v1_VirtualClusterAccessKeyList(ref common.Refere } } -func schema_pkg_apis_management_v1_VirtualClusterInstance(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabase(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "VirtualClusterInstance holds the VirtualClusterInstance information", + Description: "VirtualClusterExternalDatabase holds kube config request and response data for virtual clusters", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -17742,29 +18374,28 @@ func schema_pkg_apis_management_v1_VirtualClusterInstance(ref common.ReferenceCa "spec": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceSpec"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceStatus"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus"), }, }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "VirtualClusterInstanceKubeConfig holds kube config request and response data for virtual clusters", - Type: []string{"object"}, + Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { SchemaProps: spec.SchemaProps{ @@ -17783,46 +18414,180 @@ func schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfig(ref common.R "metadata": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigSpec"), + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, - "status": { + "items": { SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigStatus"), + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase"), + }, + }, + }, }, }, }, + Required: []string{"items"}, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfigList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "connector": { SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Description: "Connector specifies the secret that should be used to connect to an external database server. The connection is used to manage a user and database for the vCluster. A data source endpoint constructed from the created user and database is returned on status. The secret specified by connector should contain the following fields: endpoint - the endpoint where the database server can be accessed user - the database username password - the password for the database username port - the port to be used in conjunction with the endpoint to connect to the databse server. This is commonly 3306", Type: []string{"string"}, Format: "", }, }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dataSource": { + SchemaProps: spec.SchemaProps{ + Description: "DataSource holds a datasource endpoint constructed from the vCluster's designated user and database. The user and database are created from the given connector.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterInstance(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VirtualClusterInstance holds the VirtualClusterInstance information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VirtualClusterInstanceKubeConfig holds kube config request and response data for virtual clusters", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfigList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, Format: "", }, }, @@ -21138,11 +21903,23 @@ func schema_pkg_apis_storage_v1_ClusterSpec(ref common.ReferenceCallback) common }, }, }, + "metrics": { + SchemaProps: spec.SchemaProps{ + Description: "Metrics holds the cluster's metrics backend configuration", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, + "opencost": { + SchemaProps: spec.SchemaProps{ + Description: "OpenCost holds the cluster's OpenCost backend configuration", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -21171,9 +21948,25 @@ func schema_pkg_apis_storage_v1_ClusterStatus(ref common.ReferenceCallback) comm Format: "", }, }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "Conditions holds several conditions the cluster might be in", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"), + }, + }, + }, + }, + }, }, }, }, + Dependencies: []string{ + "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"}, } } @@ -21437,11 +22230,44 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplate(ref common.ReferenceCa Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateSpec"), }, }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateStatus"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "git": { + SchemaProps: spec.SchemaProps{ + Description: "Git holds configuration for git environment spec source", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"), + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline holds an inline devcontainer.json definition", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"}, } } @@ -21449,7 +22275,329 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateList(ref common.Referen return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DevPodEnvironmentTemplateList contains a list of DevPodEnvironmentTemplate objects", + Description: "DevPodEnvironmentTemplateList contains a list of DevPodEnvironmentTemplate objects", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplate"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "displayName": { + SchemaProps: spec.SchemaProps{ + Description: "DisplayName is the name that should be displayed in the UI", + Type: []string{"string"}, + Format: "", + }, + }, + "description": { + SchemaProps: spec.SchemaProps{ + Description: "Description describes the environment template", + Type: []string{"string"}, + Format: "", + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Owner holds the owner of this object", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), + }, + }, + "access": { + SchemaProps: spec.SchemaProps{ + Description: "Access to the DevPod machine instance object itself", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access"), + }, + }, + }, + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the inline template to use for DevPod environments", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition"), + }, + }, + "versions": { + SchemaProps: spec.SchemaProps{ + Description: "Versions are different versions of the template that can be referenced as well", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodEnvironmentTemplateStatus holds the status", + Type: []string{"object"}, + }, + }, + } +} + +func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template holds the environment template definition", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition"), + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version is the version. Needs to be in X.X.X format.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodProjectSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "git": { + SchemaProps: spec.SchemaProps{ + Description: "Git defines additional git related settings like credentials", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitProjectSpec"), + }, + }, + "ssh": { + SchemaProps: spec.SchemaProps{ + Description: "SSH defines additional ssh related settings like private keys, to be specified as base64 encoded strings.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.SSHProjectSpec"), + }, + }, + "fallbackImage": { + SchemaProps: spec.SchemaProps{ + Description: "FallbackImage defines an image all workspace will fall back to if no devcontainer.json could be detected", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SSHProjectSpec"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodProviderOption(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "value": { + SchemaProps: spec.SchemaProps{ + Description: "Value of this option.", + Type: []string{"string"}, + Format: "", + }, + }, + "valueFrom": { + SchemaProps: spec.SchemaProps{ + Description: "ValueFrom specifies a secret where this value should be taken from.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProviderOptionFrom"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProviderOptionFrom"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodProviderOptionFrom(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "projectSecretRef": { + SchemaProps: spec.SchemaProps{ + Description: "ProjectSecretRef is the project secret to use for this value.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + "sharedSecretRef": { + SchemaProps: spec.SchemaProps{ + Description: "SharedSecretRef is the shared secret to use for this value.", + Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.SecretKeySelector"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodProviderSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "github": { + SchemaProps: spec.SchemaProps{ + Description: "Github source for the provider", + Type: []string{"string"}, + Format: "", + }, + }, + "file": { + SchemaProps: spec.SchemaProps{ + Description: "File source for the provider", + Type: []string{"string"}, + Format: "", + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Description: "URL where the provider was downloaded from", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspaceInstance(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspaceInstance", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspaceInstanceList contains a list of DevPodWorkspaceInstance objects", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -21479,7 +22627,7 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateList(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplate"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstance"), }, }, }, @@ -21490,11 +22638,11 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateList(ref common.Referen }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstance", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -21507,11 +22655,11 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref common.Referen Format: "", }, }, - "git": { + "description": { SchemaProps: spec.SchemaProps{ - Description: "Git holds configuration for git environment spec source", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"), + Description: "Description describes a DevPod machine instance", + Type: []string{"string"}, + Format: "", }, }, "owner": { @@ -21520,6 +22668,44 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref common.Referen Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), }, }, + "presetRef": { + SchemaProps: spec.SchemaProps{ + Description: "PresetRef holds the DevPodWorkspacePreset template reference", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef"), + }, + }, + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "TemplateRef holds the DevPod machine template reference", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"), + }, + }, + "environmentRef": { + SchemaProps: spec.SchemaProps{ + Description: "EnvironmentRef is the reference to DevPodEnvironmentTemplate that should be used", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the inline template to use for DevPod machine creation. This is mutually exclusive with templateRef.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition"), + }, + }, + "runnerRef": { + SchemaProps: spec.SchemaProps{ + Description: "RunnerRef is the reference to the connected runner holding this workspace", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef"), + }, + }, + "parameters": { + SchemaProps: spec.SchemaProps{ + Description: "Parameters are values to pass to the template. The values should be encoded as YAML string where each parameter is represented as a top-level field key.", + Type: []string{"string"}, + Format: "", + }, + }, "access": { SchemaProps: spec.SchemaProps{ Description: "Access to the DevPod machine instance object itself", @@ -21534,180 +22720,122 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref common.Referen }, }, }, - "versions": { + "preventWakeUpOnConnection": { SchemaProps: spec.SchemaProps{ - Description: "Versions are different versions of the template that can be referenced as well", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion"), - }, - }, - }, + Description: "PreventWakeUpOnConnection is used to prevent workspace that uses sleep mode from waking up on incomming ssh connection.", + Type: []string{"boolean"}, + Format: "", }, }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } -func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "git": { - SchemaProps: spec.SchemaProps{ - Description: "Git holds the GitEnvironmentTemplate", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"), - }, - }, - "version": { + "lastWorkspaceStatus": { SchemaProps: spec.SchemaProps{ - Description: "Version is the version. Needs to be in X.X.X format.", + Description: "LastWorkspaceStatus is the last workspace status reported by the runner.", Type: []string{"string"}, Format: "", }, }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"}, - } -} - -func schema_pkg_apis_storage_v1_DevPodProjectSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "git": { + "phase": { SchemaProps: spec.SchemaProps{ - Description: "Git defines additional git related settings like credentials", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitProjectSpec"), + Description: "Phase describes the current phase the DevPod machine instance is in", + Type: []string{"string"}, + Format: "", }, }, - "ssh": { + "reason": { SchemaProps: spec.SchemaProps{ - Description: "SSH defines additional ssh related settings like private keys, to be specified as base64 encoded strings.", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.SSHProjectSpec"), + Description: "Reason describes the reason in machine-readable form why the cluster is in the current phase", + Type: []string{"string"}, + Format: "", }, }, - "fallbackImage": { + "message": { SchemaProps: spec.SchemaProps{ - Description: "FallbackImage defines an image all workspace will fall back to if no devcontainer.json could be detected", + Description: "Message describes the reason in human-readable form why the DevPod machine is in the current phase", Type: []string{"string"}, Format: "", }, }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SSHProjectSpec"}, - } -} - -func schema_pkg_apis_storage_v1_DevPodProviderOption(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "value": { + "conditions": { SchemaProps: spec.SchemaProps{ - Description: "Value of this option.", - Type: []string{"string"}, - Format: "", + Description: "Conditions holds several conditions the DevPod machine might be in", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"), + }, + }, + }, }, }, - "valueFrom": { + "instance": { SchemaProps: spec.SchemaProps{ - Description: "ValueFrom specifies a secret where this value should be taken from.", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProviderOptionFrom"), + Description: "Instance is the template rendered with all the parameters", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition"), }, }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProviderOptionFrom"}, - } -} - -func schema_pkg_apis_storage_v1_DevPodProviderOptionFrom(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "projectSecretRef": { + "ignoreReconciliation": { SchemaProps: spec.SchemaProps{ - Description: "ProjectSecretRef is the project secret to use for this value.", - Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + Description: "IgnoreReconciliation ignores reconciliation for this object", + Type: []string{"boolean"}, + Format: "", }, }, - "sharedSecretRef": { + "clusterRef": { SchemaProps: spec.SchemaProps{ - Description: "SharedSecretRef is the shared secret to use for this value.", - Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), + Description: "ClusterRef holds the runners cluster if the workspace is scheduled on kubernetes based runner", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.ClusterRef"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SecretKeySelector"}, + "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ClusterRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition"}, } } -func schema_pkg_apis_storage_v1_DevPodProviderSource(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceTemplateDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "github": { - SchemaProps: spec.SchemaProps{ - Description: "Github source for the provider", - Type: []string{"string"}, - Format: "", - }, - }, - "file": { - SchemaProps: spec.SchemaProps{ - Description: "File source for the provider", - Type: []string{"string"}, - Format: "", - }, - }, - "url": { + "metadata": { SchemaProps: spec.SchemaProps{ - Description: "URL where the provider was downloaded from", - Type: []string{"string"}, - Format: "", + Description: "The virtual cluster instance metadata", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateMetadata"), }, }, }, }, }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateMetadata"}, } } -func schema_pkg_apis_storage_v1_DevPodWorkspaceInstance(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_storage_v1_DevPodWorkspacePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DevPodWorkspaceInstance", + Description: "DevPodWorkspacePreset", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -21733,28 +22861,28 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstance(ref common.ReferenceCall "spec": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceSpec"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceStatus"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetStatus"), }, }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DevPodWorkspaceInstanceList contains a list of DevPodWorkspaceInstance objects", + Description: "DevPodWorkspacePresetList contains a list of DevPodWorkspacePreset objects", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -21784,7 +22912,7 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceList(ref common.Reference Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstance"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePreset"), }, }, }, @@ -21795,67 +22923,78 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceList(ref common.Reference }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstance", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePreset", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "displayName": { + "git": { SchemaProps: spec.SchemaProps{ - Description: "DisplayName is the name that should be displayed in the UI", + Description: "Git stores path to git repo to use as workspace source", Type: []string{"string"}, Format: "", }, }, - "description": { + "image": { SchemaProps: spec.SchemaProps{ - Description: "Description describes a DevPod machine instance", + Description: "Image stores container image to use as workspace source", Type: []string{"string"}, Format: "", }, }, - "owner": { + }, + }, + }, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "displayName": { SchemaProps: spec.SchemaProps{ - Description: "Owner holds the owner of this object", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), + Description: "DisplayName is the name that should be displayed in the UI", + Type: []string{"string"}, + Format: "", }, }, - "templateRef": { + "source": { SchemaProps: spec.SchemaProps{ - Description: "TemplateRef holds the DevPod machine template reference", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"), + Description: "Source stores inline path of project source", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource"), }, }, - "environmentRef": { + "infrastructureRef": { SchemaProps: spec.SchemaProps{ - Description: "EnvironmentRef is the reference to DevPodEnvironmentTemplate that should be used", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), + Description: "InfrastructureRef stores reference to DevPodWorkspaceTemplate to use", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"), }, }, - "template": { + "environmentRef": { SchemaProps: spec.SchemaProps{ - Description: "Template is the inline template to use for DevPod machine creation. This is mutually exclusive with templateRef.", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition"), + Description: "EnvironmentRef stores reference to DevPodEnvironmentTemplate", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), }, }, - "runnerRef": { + "useProjectGitCredentials": { SchemaProps: spec.SchemaProps{ - Description: "RunnerRef is the reference to the connected runner holding this workspace", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef"), + Description: "UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment", + Type: []string{"boolean"}, + Format: "", }, }, - "parameters": { + "owner": { SchemaProps: spec.SchemaProps{ - Description: "Parameters are values to pass to the template. The values should be encoded as YAML string where each parameter is represented as a top-level field key.", - Type: []string{"string"}, - Format: "", + Description: "Owner holds the owner of this object", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), }, }, "access": { @@ -21872,114 +23011,83 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref common.Reference }, }, }, - "preventWakeUpOnConnection": { + "versions": { SchemaProps: spec.SchemaProps{ - Description: "PreventWakeUpOnConnection is used to prevent workspace that uses sleep mode from waking up on incomming ssh connection.", - Type: []string{"boolean"}, - Format: "", + Description: "Versions are different versions of the template that can be referenced as well", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion"), + }, + }, + }, }, }, }, + Required: []string{"source", "infrastructureRef"}, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } -func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresetStatus holds the status", + Type: []string{"object"}, + }, + }, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "lastWorkspaceStatus": { - SchemaProps: spec.SchemaProps{ - Description: "LastWorkspaceStatus is the last workspace status reported by the runner.", - Type: []string{"string"}, - Format: "", - }, - }, - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase describes the current phase the DevPod machine instance is in", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { + "version": { SchemaProps: spec.SchemaProps{ - Description: "Reason describes the reason in machine-readable form why the cluster is in the current phase", + Description: "Version is the version. Needs to be in X.X.X format.", Type: []string{"string"}, Format: "", }, }, - "message": { + "source": { SchemaProps: spec.SchemaProps{ - Description: "Message describes the reason in human-readable form why the DevPod machine is in the current phase", - Type: []string{"string"}, - Format: "", + Description: "Source stores inline path of project source", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource"), }, }, - "conditions": { + "infrastructureRef": { SchemaProps: spec.SchemaProps{ - Description: "Conditions holds several conditions the DevPod machine might be in", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"), - }, - }, - }, + Description: "InfrastructureRef stores reference to DevPodWorkspaceTemplate to use", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"), }, }, - "instance": { + "environmentRef": { SchemaProps: spec.SchemaProps{ - Description: "Instance is the template rendered with all the parameters", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition"), + Description: "EnvironmentRef stores reference to DevPodEnvironmentTemplate", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), }, }, - "ignoreReconciliation": { + "useProjectGitCredentials": { SchemaProps: spec.SchemaProps{ - Description: "IgnoreReconciliation ignores reconciliation for this object", + Description: "UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment", Type: []string{"boolean"}, Format: "", }, }, - "clusterRef": { - SchemaProps: spec.SchemaProps{ - Description: "ClusterRef holds the runners cluster if the workspace is scheduled on kubernetes based runner", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.ClusterRef"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ClusterRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition"}, - } -} - -func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceTemplateDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "The virtual cluster instance metadata", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateMetadata"), - }, - }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateMetadata"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"}, } } @@ -22474,6 +23582,13 @@ func schema_pkg_apis_storage_v1_EnvironmentRef(ref common.ReferenceCallback) com Format: "", }, }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version is the version of DevPodEnvironmentTemplate this references", + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"name"}, }, @@ -23287,6 +24402,47 @@ func schema_pkg_apis_storage_v1_Member(ref common.ReferenceCallback) common.Open } } +func schema_pkg_apis_storage_v1_Metrics(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the number of desired replicas.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "resources": { + SchemaProps: spec.SchemaProps{ + Description: "Resources are compute resource required by the metrics backend", + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "retention": { + SchemaProps: spec.SchemaProps{ + Description: "Retention is the metrics data retention period. Default is 1y", + Type: []string{"string"}, + Format: "", + }, + }, + "storage": { + SchemaProps: spec.SchemaProps{ + Description: "Storage contains settings related to the metrics backend's persistent volume configuration", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Storage"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Storage", "k8s.io/api/core/v1.ResourceRequirements"}, + } +} + func schema_pkg_apis_storage_v1_NamespacePattern(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -23727,6 +24883,33 @@ func schema_pkg_apis_storage_v1_ObjectsStatus(ref common.ReferenceCallback) comm } } +func schema_pkg_apis_storage_v1_OpenCost(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the number of desired replicas.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "resources": { + SchemaProps: spec.SchemaProps{ + Description: "Resources are compute resource required by the OpenCost backend", + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ResourceRequirements"}, + } +} + func schema_pkg_apis_storage_v1_PodSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -23755,6 +24938,34 @@ func schema_pkg_apis_storage_v1_PodSelector(ref common.ReferenceCallback) common } } +func schema_pkg_apis_storage_v1_PresetRef(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of DevPodWorkspacePreset", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version holds the preset version to use. Version is expected to be in semantic versioning format. Alternatively, you can also exchange major, minor or patch with an 'x' to tell Loft to automatically select the latest major, minor or patch version.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + func schema_pkg_apis_storage_v1_Project(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -23933,6 +25144,13 @@ func schema_pkg_apis_storage_v1_ProjectSpec(ref common.ReferenceCallback) common Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate"), }, }, + "requirePreset": { + SchemaProps: spec.SchemaProps{ + Description: "RequirePreset configures if a preset is required for instance creation.", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset"), + }, + }, "members": { SchemaProps: spec.SchemaProps{ Description: "Members are the users and teams that are part of this project", @@ -23995,7 +25213,7 @@ func schema_pkg_apis_storage_v1_ProjectSpec(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedCluster", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedRunner", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ArgoIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedCluster", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedRunner", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ArgoIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec"}, } } @@ -24372,6 +25590,25 @@ func schema_pkg_apis_storage_v1_RancherProjectRef(ref common.ReferenceCallback) } } +func schema_pkg_apis_storage_v1_RequirePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "disabled": { + SchemaProps: spec.SchemaProps{ + Description: "If true, all users within the project will not be allowed to create a new instance without a preset. By default, all users are allowed to create a new instance without a preset.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_storage_v1_RequireTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -25793,6 +27030,32 @@ func schema_pkg_apis_storage_v1_SpaceTemplateVersion(ref common.ReferenceCallbac } } +func schema_pkg_apis_storage_v1_Storage(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "storageClass": { + SchemaProps: spec.SchemaProps{ + Description: "StorageClass the storage class to use when provisioning the metrics backend's persistent volume If set to \"-\" or \"\" dynamic provisioning is disabled If set to undefined or null (the default), the cluster's default storage class is used for provisioning", + Type: []string{"string"}, + Format: "", + }, + }, + "size": { + SchemaProps: spec.SchemaProps{ + Description: "Size the size of the metrics backend's persistent volume", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_storage_v1_StreamContainer(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -28137,6 +29400,27 @@ func schema_pkg_apis_storage_v1_VirtualClusterTemplateVersion(ref common.Referen } } +func schema_pkg_apis_storage_v1_WorkspaceRef(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of DevPodWorkspaceTemplate this references", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + func schema_pkg_apis_storage_v1_WorkspaceStatusResult(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -28483,7 +29767,7 @@ func schema_pkg_apis_ui_v1_UISettingsSpec(ref common.ReferenceCallback) common.O }, "hasHelmRelease": { SchemaProps: spec.SchemaProps{ - Description: "HasHelmRelease indicates whether loft has been installed via Helm", + Description: "HasHelmRelease indicates whether the vCluster Platform instance has been installed via Helm", Type: []string{"boolean"}, Format: "", }, @@ -28495,6 +29779,13 @@ func schema_pkg_apis_ui_v1_UISettingsSpec(ref common.ReferenceCallback) common.O Format: "", }, }, + "loftHosted": { + SchemaProps: spec.SchemaProps{ + Description: "LoftHosted indicates whether the vCluster Platform instance is hosted and operated by Loft Labs Inc.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, },