diff --git a/go.mod b/go.mod index 8694f360d..c3a7a6ca9 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,10 @@ require ( github.com/gertd/go-pluralize v0.2.1 github.com/ghodss/yaml v1.0.0 github.com/invopop/jsonschema v0.12.1-0.20240219232115-a4467074499d - github.com/loft-sh/agentapi/v4 v4.1.0 - github.com/loft-sh/api/v4 v4.1.0 + github.com/loft-sh/agentapi/v4 v4.2.0 + github.com/loft-sh/api/v4 v4.2.0 github.com/wk8/go-ordered-map/v2 v2.1.8 + k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 sigs.k8s.io/controller-runtime v0.19.0 ) @@ -54,14 +55,14 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.10 // indirect github.com/kylelemons/godebug v1.1.0 // indirect - github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0 // indirect + github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 // indirect github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 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 @@ -100,7 +101,6 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.31.1 // indirect k8s.io/apiserver v0.31.1 // indirect k8s.io/client-go v0.31.1 // indirect k8s.io/component-base v0.31.1 // indirect diff --git a/go.sum b/go.sum index 2af4269db..df459d3ea 100644 --- a/go.sum +++ b/go.sum @@ -111,12 +111,12 @@ 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-20241105163154-88dd686aaba0 h1:fAn1LUVsxpkRasDJcSq7wRncxET+zeA8MVtGyxL2rSU= -github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.1.0 h1:2uwBHLy6Aiy6VlTudsWZxSRQ4GEwGL5X87+j+eiOeVE= -github.com/loft-sh/agentapi/v4 v4.1.0/go.mod h1:yqbIMmyXqbzZcK0DlwldRLy0xb3lYnH4NoI3K+iETlM= -github.com/loft-sh/api/v4 v4.1.0 h1:VRSF/qiwutMDKmsSK9SZR1KPp4GsHB3CoSQx0A8thpw= -github.com/loft-sh/api/v4 v4.1.0/go.mod h1:I16jKszAL2/OLQYlzk9y28DlFUzJ+gGVcXJ9VqOXuJE= +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.0 h1:DRLCKsGKkOjig6o4LdujXIhYci7QJMtXzLYRbaHh0YY= +github.com/loft-sh/agentapi/v4 v4.2.0/go.mod h1:np3oo4gi1fYJvhXAYLk+SY6bVy2iqsxoAf8ebZNMnXU= +github.com/loft-sh/api/v4 v4.2.0 h1:PchJdN5mM/p9ixdArZwbO+iuHm6mnrLbc7OMkm5gnPE= +github.com/loft-sh/api/v4 v4.2.0/go.mod h1:hM1kcW4MX0PuYJJF1eYD4WiOCJh3sSJxUgwZQaaiJ+Q= 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/loft-sh/jsonschema v0.0.0-20240411094214-6b88fd9d2a31 h1:fQOxqGdVGSkoaPe2H31eFmEC+0CzCXq7D5TqBJM0eXo= @@ -139,8 +139,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/platform/api/_partials/resources/clusters/reference.mdx b/platform/api/_partials/resources/clusters/reference.mdx index 339662a51..aa4673d1c 100755 --- a/platform/api/_partials/resources/clusters/reference.mdx +++ b/platform/api/_partials/resources/clusters/reference.mdx @@ -295,6 +295,340 @@ Teams specifies which teams should be able to access this secret with the aforem + + + + + + + +
+ + +### `metrics` required object pro {#spec-metrics} + +Metrics holds the cluster's metrics backend configuration + + + + + + +
+ + +#### `replicas` required integer pro {#spec-metrics-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +#### `resources` required object pro {#spec-metrics-resources} + +Resources are compute resource required by the metrics backend + + + + + + +
+ + +##### `limits` required object pro {#spec-metrics-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#spec-metrics-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#spec-metrics-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#spec-metrics-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#spec-metrics-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ + +
+ + + +
+ + +#### `retention` required string pro {#spec-metrics-retention} + +Retention is the metrics data retention period. Default is 1y + + + + + +
+ + + +
+ + +#### `storage` required object pro {#spec-metrics-storage} + + + + + + + + +
+ + +##### `storageClass` required string pro {#spec-metrics-storage-storageClass} + +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 + + + + + +
+ + + +
+ + +##### `size` required string pro {#spec-metrics-storage-size} + +Size the size of the metrics backend's persistent volume + + + + + +
+ + +
+ + +
+ + + +
+ + +### `opencost` required object pro {#spec-opencost} + +OpenCost holds the cluster's OpenCost backend configuration + + + + + + +
+ + +#### `replicas` required integer pro {#spec-opencost-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +#### `resources` required object pro {#spec-opencost-resources} + +Resources are compute resource required by the OpenCost backend + + + + + + +
+ + +##### `limits` required object pro {#spec-opencost-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#spec-opencost-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#spec-opencost-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#spec-opencost-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#spec-opencost-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ +
@@ -358,6 +692,21 @@ Teams specifies which teams should be able to access this secret with the aforem +
+ + + +
+ + +### `conditions` required object pro {#status-conditions} + +Conditions holds several conditions the cluster might be in + + + + +
diff --git a/platform/api/_partials/resources/config/reference.mdx b/platform/api/_partials/resources/config/reference.mdx index a212083f6..89c3775a1 100755 --- a/platform/api/_partials/resources/config/reference.mdx +++ b/platform/api/_partials/resources/config/reference.mdx @@ -3711,7 +3711,7 @@ DisableLoftConfigEndpoint will disable setting config via the UI and config.mana ### `cloud` required object pro {#status-cloud} -Cloud holkds the settings to be used exclusively in vCluster Cloud based +Cloud holds the settings to be used exclusively in vCluster Cloud based environments and deployments. @@ -3776,6 +3776,767 @@ It should be a string representing the time range in 24-hour format, in UTC, e.g + + + + + + + + + + +
+ + +### `costControl` required object pro {#status-costControl} + +CostControl holds the settings related to the Cost Control ROI dashboard and its metrics gathering infrastructure + + + + + + +
+ + +#### `enabled` required boolean pro {#status-costControl-enabled} + +Enabled specifies whether the ROI dashboard should be available in the UI, and if the metrics infrastructure +that provides dashboard data is deployed + + + + + +
+ + + +
+ + +#### `global` required object pro {#status-costControl-global} + +Global are settings for globally managed components + + + + + + +
+ + +##### `metrics` required object pro {#status-costControl-global-metrics} + +Metrics these settings apply to metric infrastructure used to aggregate metrics across all connected clusters + + + + + + +
+ + +##### `replicas` required integer pro {#status-costControl-global-metrics-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +##### `resources` required object pro {#status-costControl-global-metrics-resources} + +Resources are compute resource required by the metrics backend + + + + + + +
+ + +##### `limits` required object pro {#status-costControl-global-metrics-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#status-costControl-global-metrics-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#status-costControl-global-metrics-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#status-costControl-global-metrics-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#status-costControl-global-metrics-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ + +
+ + + +
+ + +##### `retention` required string pro {#status-costControl-global-metrics-retention} + +Retention is the metrics data retention period. Default is 1y + + + + + +
+ + + +
+ + +##### `storage` required object pro {#status-costControl-global-metrics-storage} + + + + + + + + +
+ + +##### `storageClass` required string pro {#status-costControl-global-metrics-storage-storageClass} + +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 + + + + + +
+ + + +
+ + +##### `size` required string pro {#status-costControl-global-metrics-storage-size} + +Size the size of the metrics backend's persistent volume + + + + + +
+ + +
+ + +
+ + +
+ + + +
+ + +#### `cluster` required object pro {#status-costControl-cluster} + +Cluster are settings for each cluster's managed components. These settings apply to all connected clusters +unless overridden by modifying the Cluster's spec + + + + + + +
+ + +##### `metrics` required object pro {#status-costControl-cluster-metrics} + +Metrics are settings applied to metric infrastructure in each connected cluster. These can be overridden in +individual clusters by modifying the Cluster's spec + + + + + + +
+ + +##### `replicas` required integer pro {#status-costControl-cluster-metrics-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +##### `resources` required object pro {#status-costControl-cluster-metrics-resources} + +Resources are compute resource required by the metrics backend + + + + + + +
+ + +##### `limits` required object pro {#status-costControl-cluster-metrics-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#status-costControl-cluster-metrics-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#status-costControl-cluster-metrics-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#status-costControl-cluster-metrics-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#status-costControl-cluster-metrics-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ + +
+ + + +
+ + +##### `retention` required string pro {#status-costControl-cluster-metrics-retention} + +Retention is the metrics data retention period. Default is 1y + + + + + +
+ + + +
+ + +##### `storage` required object pro {#status-costControl-cluster-metrics-storage} + + + + + + + + +
+ + +##### `storageClass` required string pro {#status-costControl-cluster-metrics-storage-storageClass} + +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 + + + + + +
+ + + +
+ + +##### `size` required string pro {#status-costControl-cluster-metrics-storage-size} + +Size the size of the metrics backend's persistent volume + + + + + +
+ + +
+ + +
+ + + +
+ + +##### `opencost` required object pro {#status-costControl-cluster-opencost} + +OpenCost are settings applied to OpenCost deployments in each connected cluster. These can be overridden in +individual clusters by modifying the Cluster's spec + + + + + + +
+ + +##### `replicas` required integer pro {#status-costControl-cluster-opencost-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +##### `resources` required object pro {#status-costControl-cluster-opencost-resources} + +Resources are compute resource required by the OpenCost backend + + + + + + +
+ + +##### `limits` required object pro {#status-costControl-cluster-opencost-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#status-costControl-cluster-opencost-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#status-costControl-cluster-opencost-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#status-costControl-cluster-opencost-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#status-costControl-cluster-opencost-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ + +
+ + +
+ + +
+ + + +
+ + +#### `settings` required object pro {#status-costControl-settings} + +Settings specify price-related settings that are taken into account for the ROI dashboard calculations. + + + + + + +
+ + +##### `priceCurrency` required string pro {#status-costControl-settings-priceCurrency} + +PriceCurrency specifies the currency. + + + + + +
+ + + +
+ + +##### `averageCPUPricePerNode` required object pro {#status-costControl-settings-averageCPUPricePerNode} + +AvgCPUPricePerNode specifies the average CPU price per node. + + + + + + +
+ + +##### `price` required number pro {#status-costControl-settings-averageCPUPricePerNode-price} + +Price specifies the price. + + + + + +
+ + + +
+ + +##### `timePeriod` required string pro {#status-costControl-settings-averageCPUPricePerNode-timePeriod} + +TimePeriod specifies the time period for the price. + + + + + +
+ + +
+ + + +
+ + +##### `averageRAMPricePerNode` required object pro {#status-costControl-settings-averageRAMPricePerNode} + +AvgRAMPricePerNode specifies the average RAM price per node. + + + + + + +
+ + +##### `price` required number pro {#status-costControl-settings-averageRAMPricePerNode-price} + +Price specifies the price. + + + + + +
+ + + +
+ + +##### `timePeriod` required string pro {#status-costControl-settings-averageRAMPricePerNode-timePeriod} + +TimePeriod specifies the time period for the price. + + + + + +
+ + +
+ + + +
+ + +##### `controlPlanePricePerCluster` required object pro {#status-costControl-settings-controlPlanePricePerCluster} + +ControlPlanePricePerCluster specifies the price of one physical cluster. + + + + + + +
+ + +##### `price` required number pro {#status-costControl-settings-controlPlanePricePerCluster-price} + +Price specifies the price. + + + + + +
+ + + +
+ + +##### `timePeriod` required string pro {#status-costControl-settings-controlPlanePricePerCluster-timePeriod} + +TimePeriod specifies the time period for the price. + + + + + +
+ +
diff --git a/platform/api/_partials/resources/config/status_reference.mdx b/platform/api/_partials/resources/config/status_reference.mdx index 3943b017c..80a2406bc 100755 --- a/platform/api/_partials/resources/config/status_reference.mdx +++ b/platform/api/_partials/resources/config/status_reference.mdx @@ -3665,7 +3665,7 @@ DisableLoftConfigEndpoint will disable setting config via the UI and config.mana ## `cloud` required object pro {#cloud} -Cloud holkds the settings to be used exclusively in vCluster Cloud based +Cloud holds the settings to be used exclusively in vCluster Cloud based environments and deployments. @@ -3730,6 +3730,767 @@ It should be a string representing the time range in 24-hour format, in UTC, e.g +
+ + +
+ + + + + + +
+ + +## `costControl` required object pro {#costControl} + +CostControl holds the settings related to the Cost Control ROI dashboard and its metrics gathering infrastructure + + + + + + +
+ + +### `enabled` required boolean pro {#costControl-enabled} + +Enabled specifies whether the ROI dashboard should be available in the UI, and if the metrics infrastructure +that provides dashboard data is deployed + + + + + +
+ + + +
+ + +### `global` required object pro {#costControl-global} + +Global are settings for globally managed components + + + + + + +
+ + +#### `metrics` required object pro {#costControl-global-metrics} + +Metrics these settings apply to metric infrastructure used to aggregate metrics across all connected clusters + + + + + + +
+ + +##### `replicas` required integer pro {#costControl-global-metrics-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +##### `resources` required object pro {#costControl-global-metrics-resources} + +Resources are compute resource required by the metrics backend + + + + + + +
+ + +##### `limits` required object pro {#costControl-global-metrics-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#costControl-global-metrics-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#costControl-global-metrics-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#costControl-global-metrics-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#costControl-global-metrics-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ + +
+ + + +
+ + +##### `retention` required string pro {#costControl-global-metrics-retention} + +Retention is the metrics data retention period. Default is 1y + + + + + +
+ + + +
+ + +##### `storage` required object pro {#costControl-global-metrics-storage} + + + + + + + + +
+ + +##### `storageClass` required string pro {#costControl-global-metrics-storage-storageClass} + +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 + + + + + +
+ + + +
+ + +##### `size` required string pro {#costControl-global-metrics-storage-size} + +Size the size of the metrics backend's persistent volume + + + + + +
+ + +
+ + +
+ + +
+ + + +
+ + +### `cluster` required object pro {#costControl-cluster} + +Cluster are settings for each cluster's managed components. These settings apply to all connected clusters +unless overridden by modifying the Cluster's spec + + + + + + +
+ + +#### `metrics` required object pro {#costControl-cluster-metrics} + +Metrics are settings applied to metric infrastructure in each connected cluster. These can be overridden in +individual clusters by modifying the Cluster's spec + + + + + + +
+ + +##### `replicas` required integer pro {#costControl-cluster-metrics-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +##### `resources` required object pro {#costControl-cluster-metrics-resources} + +Resources are compute resource required by the metrics backend + + + + + + +
+ + +##### `limits` required object pro {#costControl-cluster-metrics-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#costControl-cluster-metrics-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#costControl-cluster-metrics-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#costControl-cluster-metrics-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#costControl-cluster-metrics-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ + +
+ + + +
+ + +##### `retention` required string pro {#costControl-cluster-metrics-retention} + +Retention is the metrics data retention period. Default is 1y + + + + + +
+ + + +
+ + +##### `storage` required object pro {#costControl-cluster-metrics-storage} + + + + + + + + +
+ + +##### `storageClass` required string pro {#costControl-cluster-metrics-storage-storageClass} + +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 + + + + + +
+ + + +
+ + +##### `size` required string pro {#costControl-cluster-metrics-storage-size} + +Size the size of the metrics backend's persistent volume + + + + + +
+ + +
+ + +
+ + + +
+ + +#### `opencost` required object pro {#costControl-cluster-opencost} + +OpenCost are settings applied to OpenCost deployments in each connected cluster. These can be overridden in +individual clusters by modifying the Cluster's spec + + + + + + +
+ + +##### `replicas` required integer pro {#costControl-cluster-opencost-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +##### `resources` required object pro {#costControl-cluster-opencost-resources} + +Resources are compute resource required by the OpenCost backend + + + + + + +
+ + +##### `limits` required object pro {#costControl-cluster-opencost-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#costControl-cluster-opencost-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#costControl-cluster-opencost-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#costControl-cluster-opencost-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#costControl-cluster-opencost-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ + +
+ + +
+ + +
+ + + +
+ + +### `settings` required object pro {#costControl-settings} + +Settings specify price-related settings that are taken into account for the ROI dashboard calculations. + + + + + + +
+ + +#### `priceCurrency` required string pro {#costControl-settings-priceCurrency} + +PriceCurrency specifies the currency. + + + + + +
+ + + +
+ + +#### `averageCPUPricePerNode` required object pro {#costControl-settings-averageCPUPricePerNode} + +AvgCPUPricePerNode specifies the average CPU price per node. + + + + + + +
+ + +##### `price` required number pro {#costControl-settings-averageCPUPricePerNode-price} + +Price specifies the price. + + + + + +
+ + + +
+ + +##### `timePeriod` required string pro {#costControl-settings-averageCPUPricePerNode-timePeriod} + +TimePeriod specifies the time period for the price. + + + + + +
+ + +
+ + + +
+ + +#### `averageRAMPricePerNode` required object pro {#costControl-settings-averageRAMPricePerNode} + +AvgRAMPricePerNode specifies the average RAM price per node. + + + + + + +
+ + +##### `price` required number pro {#costControl-settings-averageRAMPricePerNode-price} + +Price specifies the price. + + + + + +
+ + + +
+ + +##### `timePeriod` required string pro {#costControl-settings-averageRAMPricePerNode-timePeriod} + +TimePeriod specifies the time period for the price. + + + + + +
+ + +
+ + + +
+ + +#### `controlPlanePricePerCluster` required object pro {#costControl-settings-controlPlanePricePerCluster} + +ControlPlanePricePerCluster specifies the price of one physical cluster. + + + + + + +
+ + +##### `price` required number pro {#costControl-settings-controlPlanePricePerCluster-price} + +Price specifies the price. + + + + + +
+ + + +
+ + +##### `timePeriod` required string pro {#costControl-settings-controlPlanePricePerCluster-timePeriod} + +TimePeriod specifies the time period for the price. + + + + + +
+ +
diff --git a/platform/api/_partials/resources/devpodworkspaceinstances/create.mdx b/platform/api/_partials/resources/devpodworkspaceinstances/create.mdx index 7b9783e61..fa2354692 100755 --- a/platform/api/_partials/resources/devpodworkspaceinstances/create.mdx +++ b/platform/api/_partials/resources/devpodworkspaceinstances/create.mdx @@ -24,8 +24,6 @@ metadata: namespace: loft-p-my-project spec: displayName: my-display-name - environmentRef: - name: "" owner: user: my-user parameters: 'my-parameter: my-value' @@ -56,8 +54,6 @@ metadata: namespace: loft-p-my-project spec: displayName: my-display-name - environmentRef: - name: "" owner: user: my-user parameters: 'my-parameter: my-value' diff --git a/platform/api/_partials/resources/devpodworkspaceinstances/reference.mdx b/platform/api/_partials/resources/devpodworkspaceinstances/reference.mdx index fa36b1c39..3dd24d2ab 100755 --- a/platform/api/_partials/resources/devpodworkspaceinstances/reference.mdx +++ b/platform/api/_partials/resources/devpodworkspaceinstances/reference.mdx @@ -92,6 +92,54 @@ Team specifies a Loft team. +
+ + +### `presetRef` required object pro {#spec-presetRef} + +PresetRef holds the DevPodWorkspacePreset template reference + + + + + + +
+ + +#### `name` required string pro {#spec-presetRef-name} + +Name is the name of DevPodWorkspacePreset + + + + + +
+ + + +
+ + +#### `version` required string pro {#spec-presetRef-version} + +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. + + + + + +
+ + +
+ + +
@@ -181,6 +229,21 @@ Name is the name of DevPodEnvironmentTemplate this references +
+ + + +
+ + +#### `version` required string pro {#spec-environmentRef-version} + +Version is the version of DevPodEnvironmentTemplate this references + + + + +
diff --git a/platform/api/_partials/resources/devpodworkspaceinstances/update.mdx b/platform/api/_partials/resources/devpodworkspaceinstances/update.mdx index e885683d5..1c1a8f9c2 100755 --- a/platform/api/_partials/resources/devpodworkspaceinstances/update.mdx +++ b/platform/api/_partials/resources/devpodworkspaceinstances/update.mdx @@ -54,8 +54,6 @@ metadata: uid: af5f9f0f-8ab9-4b4b-a595-a95a5921f3c2 spec: displayName: my-display-name - environmentRef: - name: "" owner: user: my-user parameters: 'my-parameter: my-value' diff --git a/platform/api/_partials/resources/projects/clusters/reference.mdx b/platform/api/_partials/resources/projects/clusters/reference.mdx index 35ad0843f..3874da346 100755 --- a/platform/api/_partials/resources/projects/clusters/reference.mdx +++ b/platform/api/_partials/resources/projects/clusters/reference.mdx @@ -894,6 +894,340 @@ Teams specifies which teams should be able to access this secret with the aforem +
+ + +
+ + + +
+ + +#### `metrics` required object pro {#clusters-spec-metrics} + +Metrics holds the cluster's metrics backend configuration + + + + + + +
+ + +##### `replicas` required integer pro {#clusters-spec-metrics-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +##### `resources` required object pro {#clusters-spec-metrics-resources} + +Resources are compute resource required by the metrics backend + + + + + + +
+ + +##### `limits` required object pro {#clusters-spec-metrics-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#clusters-spec-metrics-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#clusters-spec-metrics-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#clusters-spec-metrics-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#clusters-spec-metrics-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ + +
+ + + +
+ + +##### `retention` required string pro {#clusters-spec-metrics-retention} + +Retention is the metrics data retention period. Default is 1y + + + + + +
+ + + +
+ + +##### `storage` required object pro {#clusters-spec-metrics-storage} + + + + + + + + +
+ + +##### `storageClass` required string pro {#clusters-spec-metrics-storage-storageClass} + +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 + + + + + +
+ + + +
+ + +##### `size` required string pro {#clusters-spec-metrics-storage-size} + +Size the size of the metrics backend's persistent volume + + + + + +
+ + +
+ + +
+ + + +
+ + +#### `opencost` required object pro {#clusters-spec-opencost} + +OpenCost holds the cluster's OpenCost backend configuration + + + + + + +
+ + +##### `replicas` required integer pro {#clusters-spec-opencost-replicas} + +Replicas is the number of desired replicas. + + + + + +
+ + + +
+ + +##### `resources` required object pro {#clusters-spec-opencost-resources} + +Resources are compute resource required by the OpenCost backend + + + + + + +
+ + +##### `limits` required object pro {#clusters-spec-opencost-resources-limits} + +Limits describes the maximum amount of compute resources allowed. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `requests` required object pro {#clusters-spec-opencost-resources-requests} + +Requests describes the minimum amount of compute resources required. +If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, +otherwise to an implementation-defined value. Requests cannot exceed Limits. +More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + + + + + +
+ + + +
+ + +##### `claims` required object[] pro {#clusters-spec-opencost-resources-claims} + +Claims lists the names of resources, defined in spec.resourceClaims, +that are used by this container. + +This is an alpha field and requires enabling the +DynamicResourceAllocation feature gate. + +This field is immutable. It can only be set for containers. + + + + + + + +
+ + +##### `name` required string pro {#clusters-spec-opencost-resources-claims-name} + +Name must match the name of one entry in pod.spec.resourceClaims of +the Pod where this field is used. It makes that resource available +inside a container. + + + + + +
+ + + +
+ + +##### `request` required string pro {#clusters-spec-opencost-resources-claims-request} + +Request is the name chosen for a request in the referenced claim. +If empty, everything from the claim is made available, otherwise +only the result of this request. + + + + + + +
+ + +
+ +
@@ -961,6 +1295,21 @@ Teams specifies which teams should be able to access this secret with the aforem +
+ + +#### `conditions` required object pro {#clusters-status-conditions} + +Conditions holds several conditions the cluster might be in + + + + + +
+ + +
diff --git a/platform/api/_partials/resources/projects/create.mdx b/platform/api/_partials/resources/projects/create.mdx index cfd2d3baf..13110c9c2 100755 --- a/platform/api/_partials/resources/projects/create.mdx +++ b/platform/api/_partials/resources/projects/create.mdx @@ -38,6 +38,7 @@ spec: kind: Team name: my-team quotas: {} + requirePreset: {} requireTemplate: {} vault: {} status: {} @@ -79,6 +80,7 @@ spec: kind: Team name: my-team quotas: {} + requirePreset: {} requireTemplate: {} vault: {} status: {} diff --git a/platform/api/_partials/resources/projects/reference.mdx b/platform/api/_partials/resources/projects/reference.mdx index f72a455fa..d6d59c70f 100755 --- a/platform/api/_partials/resources/projects/reference.mdx +++ b/platform/api/_partials/resources/projects/reference.mdx @@ -306,6 +306,37 @@ By default, only admins are allowed to create a new instance without a template. +
+ + +### `requirePreset` required object pro {#spec-requirePreset} + +RequirePreset configures if a preset is required for instance creation. + + + + + + +
+ + +#### `disabled` required boolean pro {#spec-requirePreset-disabled} + +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. + + + + + +
+ + +
+ + +
diff --git a/platform/api/_partials/resources/projects/templates/reference.mdx b/platform/api/_partials/resources/projects/templates/reference.mdx index 1b2759627..62a3374a3 100755 --- a/platform/api/_partials/resources/projects/templates/reference.mdx +++ b/platform/api/_partials/resources/projects/templates/reference.mdx @@ -14875,12 +14875,1026 @@ DisplayName is the name that should be displayed in the UI +
+ + +#### `description` required string pro {#devPodEnvironmentTemplates-spec-description} + +Description describes the environment template + + + + + +
+ + + +
+ + +#### `owner` required object pro {#devPodEnvironmentTemplates-spec-owner} + +Owner holds the owner of this object + + + + + + +
+ + +##### `user` required string pro {#devPodEnvironmentTemplates-spec-owner-user} + +User specifies a Loft user. + + + + + +
+ + + +
+ + +##### `team` required string pro {#devPodEnvironmentTemplates-spec-owner-team} + +Team specifies a Loft team. + + + + + +
+ + +
+ + + +
+ + +#### `access` required object[] pro {#devPodEnvironmentTemplates-spec-access} + +Access to the DevPod machine instance object itself + + + + + + +
+ + +##### `name` required string pro {#devPodEnvironmentTemplates-spec-access-name} + +Name is an optional name that is used for this access rule + + + + + +
+ + + +
+ + +##### `verbs` required string[] pro {#devPodEnvironmentTemplates-spec-access-verbs} + +Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. + + + + + +
+ + + +
+ + +##### `subresources` required string[] pro {#devPodEnvironmentTemplates-spec-access-subresources} + +Subresources defines the sub resources that are allowed by this access rule + + + + + +
+ + + +
+ + +##### `users` required string[] pro {#devPodEnvironmentTemplates-spec-access-users} + +Users specifies which users should be able to access this secret with the aforementioned verbs + + + + + +
+ + + +
+ + +##### `teams` required string[] pro {#devPodEnvironmentTemplates-spec-access-teams} + +Teams specifies which teams should be able to access this secret with the aforementioned verbs + + + + + +
+ + +
+ + + +
+ + +#### `template` required object pro {#devPodEnvironmentTemplates-spec-template} + +Template is the inline template to use for DevPod environments + + + + + + +
+ + +##### `git` required object pro {#devPodEnvironmentTemplates-spec-template-git} + +Git holds configuration for git environment spec source + + + + + + +
+ + +##### `repository` required string pro {#devPodEnvironmentTemplates-spec-template-git-repository} + +Repository stores repository URL for Git environment spec source + + + + + +
+ + + +
+ + +##### `revision` required string pro {#devPodEnvironmentTemplates-spec-template-git-revision} + +Revision stores revision to checkout in repository + + + + + +
+ + + +
+ + +##### `subpath` required string pro {#devPodEnvironmentTemplates-spec-template-git-subpath} + +SubPath stores subpath within Repositor where environment spec is + + + + + +
+ + + +
+ + +##### `useProjectGitCredentials` required boolean pro {#devPodEnvironmentTemplates-spec-template-git-useProjectGitCredentials} + +UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment + + + + + +
+ + +
+ + + +
+ + +##### `inline` required string pro {#devPodEnvironmentTemplates-spec-template-inline} + +Inline holds an inline devcontainer.json definition + + + + + +
+ + +
+ + + +
+ + +#### `versions` required object[] pro {#devPodEnvironmentTemplates-spec-versions} + +Versions are different versions of the template that can be referenced as well + + + + + + +
+ + +##### `template` required object pro {#devPodEnvironmentTemplates-spec-versions-template} + +Template holds the environment template definition + + + + + + +
+ + +##### `git` required object pro {#devPodEnvironmentTemplates-spec-versions-template-git} + +Git holds configuration for git environment spec source + + + + + + +
+ + +##### `repository` required string pro {#devPodEnvironmentTemplates-spec-versions-template-git-repository} + +Repository stores repository URL for Git environment spec source + + + + + +
+ + + +
+ + +##### `revision` required string pro {#devPodEnvironmentTemplates-spec-versions-template-git-revision} + +Revision stores revision to checkout in repository + + + + + +
+ + + +
+ + +##### `subpath` required string pro {#devPodEnvironmentTemplates-spec-versions-template-git-subpath} + +SubPath stores subpath within Repositor where environment spec is + + + + + +
+ + + +
+ + +##### `useProjectGitCredentials` required boolean pro {#devPodEnvironmentTemplates-spec-versions-template-git-useProjectGitCredentials} + +UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment + + + + + +
+ + +
+ + + +
+ + +##### `inline` required string pro {#devPodEnvironmentTemplates-spec-versions-template-inline} + +Inline holds an inline devcontainer.json definition + + + + + +
+ + +
+ + + +
+ + +##### `version` required string pro {#devPodEnvironmentTemplates-spec-versions-version} + +Version is the version. Needs to be in X.X.X format. + + + + + +
+ + +
+ + +
+ + + +
+ + +### `status` required object pro {#devPodEnvironmentTemplates-status} + + + + + + + +
+ + +
+ + + +
+ + +## `devPodWorkspacePresets` required object[] pro {#devPodWorkspacePresets} + +DevPodWorkspacePresets holds all the allowed workspace presets + + + + + + +
+ + +### `kind` required string pro {#devPodWorkspacePresets-kind} + +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 + + + + + +
+ + + +
+ + +### `apiVersion` required string pro {#devPodWorkspacePresets-apiVersion} + +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 + + + + + +
+ + + +
+ + +### `metadata` required object pro {#devPodWorkspacePresets-metadata} + + + + + + + + +
+ + +#### `name` required string pro {#devPodWorkspacePresets-metadata-name} + +Name must be unique within a namespace. Is required when creating resources, although +some resources may allow a client to request the generation of an appropriate name +automatically. Name is primarily intended for creation idempotence and configuration +definition. +Cannot be updated. +More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names + + + + + +
+ + + +
+ + +#### `generateName` required string pro {#devPodWorkspacePresets-metadata-generateName} + +GenerateName is an optional prefix, used by the server, to generate a unique +name ONLY IF the Name field has not been provided. +If this field is used, the name returned to the client will be different +than the name passed. This value will also be combined with a unique suffix. +The provided value has the same validation rules as the Name field, +and may be truncated by the length of the suffix required to make the value +unique on the server. + +If this field is specified and the generated name exists, the server will return a 409. + +Applied only if Name is not specified. +More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + + + + + +
+ + + +
+ + +#### `namespace` required string pro {#devPodWorkspacePresets-metadata-namespace} + +Namespace defines the space within which each name must be unique. An empty namespace is +equivalent to the "default" namespace, but "default" is the canonical representation. +Not all objects are required to be scoped to a namespace - the value of this field for +those objects will be empty. + +Must be a DNS_LABEL. +Cannot be updated. +More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces + + + + + +
+ + + +
+ + +#### `selfLink` required string pro {#devPodWorkspacePresets-metadata-selfLink} + +Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + + + + + +
+ + + +
+ + +#### `uid` required string pro {#devPodWorkspacePresets-metadata-uid} + +UID is the unique in time and space value for this object. It is typically generated by +the server on successful creation of a resource and is not allowed to change on PUT +operations. + +Populated by the system. +Read-only. +More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + + + + + +
+ + + +
+ + +#### `resourceVersion` required string pro {#devPodWorkspacePresets-metadata-resourceVersion} + +An opaque value that represents the internal version of this object that can +be used by clients to determine when objects have changed. May be used for optimistic +concurrency, change detection, and the watch operation on a resource or set of resources. +Clients must treat these values as opaque and passed unmodified back to the server. +They may only be valid for a particular resource or set of resources. + +Populated by the system. +Read-only. +Value must be treated as opaque by clients and . +More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + + + + + +
+ + + +
+ + +#### `generation` required integer pro {#devPodWorkspacePresets-metadata-generation} + +A sequence number representing a specific generation of the desired state. +Populated by the system. Read-only. + + + + + +
+ + + +
+ + +#### `creationTimestamp` required object pro {#devPodWorkspacePresets-metadata-creationTimestamp} + +CreationTimestamp is a timestamp representing the server time when this object was +created. It is not guaranteed to be set in happens-before order across separate operations. +Clients may not set this value. It is represented in RFC3339 form and is in UTC. + +Populated by the system. +Read-only. +Null for lists. +More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + + + + + +
+ + + +
+ + +#### `deletionTimestamp` required object pro {#devPodWorkspacePresets-metadata-deletionTimestamp} + +DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This +field is set by the server when a graceful deletion is requested by the user, and is not +directly settable by a client. The resource is expected to be deleted (no longer visible +from resource lists, and not reachable by name) after the time in this field, once the +finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. +Once the deletionTimestamp is set, this value may not be unset or be set further into the +future, although it may be shortened or the resource may be deleted prior to this time. +For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react +by sending a graceful termination signal to the containers in the pod. After that 30 seconds, +the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, +remove the pod from the API. In the presence of network partitions, this object may still +exist after this timestamp, until an administrator or automated process can determine the +resource is fully terminated. +If not set, graceful deletion of the object has not been requested. + +Populated by the system when a graceful deletion is requested. +Read-only. +More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + + + + + +
+ + + +
+ + +#### `deletionGracePeriodSeconds` required integer pro {#devPodWorkspacePresets-metadata-deletionGracePeriodSeconds} + +Number of seconds allowed for this object to gracefully terminate before +it will be removed from the system. Only set when deletionTimestamp is also set. +May only be shortened. +Read-only. + + + + + +
+ + + +
+ + +#### `labels` required object pro {#devPodWorkspacePresets-metadata-labels} + +Map of string keys and values that can be used to organize and categorize +(scope and select) objects. May match selectors of replication controllers +and services. +More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels + + + + + +
+ + + +
+ + +#### `annotations` required object pro {#devPodWorkspacePresets-metadata-annotations} + +Annotations is an unstructured key value map stored with a resource that may be +set by external tools to store and retrieve arbitrary metadata. They are not +queryable and should be preserved when modifying objects. +More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations + + + + + +
+ + + +
+ + +#### `ownerReferences` required object[] pro {#devPodWorkspacePresets-metadata-ownerReferences} + +List of objects depended by this object. If ALL objects in the list have +been deleted, this object will be garbage collected. If this object is managed by a controller, +then an entry in this list will point to this controller, with the controller field set to true. +There cannot be more than one managing controller. + + + + + + +
+ + +##### `apiVersion` required string pro {#devPodWorkspacePresets-metadata-ownerReferences-apiVersion} + +API version of the referent. + + + + + +
+ + + +
+ + +##### `kind` required string pro {#devPodWorkspacePresets-metadata-ownerReferences-kind} + +Kind of the referent. +More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + + + + + +
+ + + +
+ + +##### `name` required string pro {#devPodWorkspacePresets-metadata-ownerReferences-name} + +Name of the referent. +More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names + + + + + +
+ + + +
+ + +##### `uid` required string pro {#devPodWorkspacePresets-metadata-ownerReferences-uid} + +UID of the referent. +More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + + + + + +
+ + + +
+ + +##### `controller` required boolean pro {#devPodWorkspacePresets-metadata-ownerReferences-controller} + +If true, this reference points to the managing controller. + + + + + +
+ + + +
+ + +##### `blockOwnerDeletion` required boolean pro {#devPodWorkspacePresets-metadata-ownerReferences-blockOwnerDeletion} + +If true, AND if the owner has the "foregroundDeletion" finalizer, then +the owner cannot be deleted from the key-value store until this +reference is removed. +See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion +for how the garbage collector interacts with this field and enforces the foreground deletion. +Defaults to false. +To set this field, a user needs "delete" permission of the owner, +otherwise 422 (Unprocessable Entity) will be returned. + + + + + +
+ + +
+ + + +
+ + +#### `finalizers` required string[] pro {#devPodWorkspacePresets-metadata-finalizers} + +Must be empty before the object is deleted from the registry. Each entry +is an identifier for the responsible component that will remove the entry +from the list. If the deletionTimestamp of the object is non-nil, entries +in this list can only be removed. +Finalizers may be processed and removed in any order. Order is NOT enforced +because it introduces significant risk of stuck finalizers. +finalizers is a shared field, any actor with permission can reorder it. +If the finalizer list is processed in order, then this can lead to a situation +in which the component responsible for the first finalizer in the list is +waiting for a signal (field value, external system, or other) produced by a +component responsible for a finalizer later in the list, resulting in a deadlock. +Without enforced ordering finalizers are free to order amongst themselves and +are not vulnerable to ordering changes in the list. + + + + + +
+ + + +
+ + +#### `managedFields` required object[] pro {#devPodWorkspacePresets-metadata-managedFields} + +ManagedFields maps workflow-id and version to the set of fields +that are managed by that workflow. This is mostly for internal +housekeeping, and users typically shouldn't need to set or +understand this field. A workflow can be the user's name, a +controller's name, or the name of a specific apply path like +"ci-cd". The set of fields is always in the version that the +workflow used when modifying the object. + + + + + + + +
+ + +##### `manager` required string pro {#devPodWorkspacePresets-metadata-managedFields-manager} + +Manager is an identifier of the workflow managing these fields. + + + + + +
+ + + +
+ + +##### `operation` required string pro {#devPodWorkspacePresets-metadata-managedFields-operation} + +Operation is the type of operation which lead to this ManagedFieldsEntry being created. +The only valid values for this field are 'Apply' and 'Update'. + + + + + +
+ + + +
+ + +##### `apiVersion` required string pro {#devPodWorkspacePresets-metadata-managedFields-apiVersion} + +APIVersion defines the version of this resource that this field set +applies to. The format is "group/version" just like the top-level +APIVersion field. It is necessary to track the version of a field +set because it cannot be automatically converted. + + + + + +
+ + + +
+ + +##### `time` required object pro {#devPodWorkspacePresets-metadata-managedFields-time} + +Time is the timestamp of when the ManagedFields entry was added. The +timestamp will also be updated if a field is added, the manager +changes any of the owned fields value or removes a field. The +timestamp does not update when a field is removed from the entry +because another manager took it over. + + + + + +
+ + + +
+ + +##### `fieldsType` required string pro {#devPodWorkspacePresets-metadata-managedFields-fieldsType} + +FieldsType is the discriminator for the different fields format and version. +There is currently only one possible value: "FieldsV1" + + + + + +
+ + + +
+ + +##### `fieldsV1` required object pro {#devPodWorkspacePresets-metadata-managedFields-fieldsV1} + +FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. + + + + + +
+ + + +
+ + +##### `subresource` required string pro {#devPodWorkspacePresets-metadata-managedFields-subresource} + +Subresource is the name of the subresource used to update that object, or +empty string if the object was updated through the main resource. The +value of this field is used to distinguish between managers, even if they +share the same name. For example, a status update will be distinct from a +regular update using the same manager name. +Note that the APIVersion field is not related to the Subresource field and +it always corresponds to the version of the main resource. + + + + + +
+ + +
+ + +
+ + +
-#### `git` required object pro {#devPodEnvironmentTemplates-spec-git} +### `spec` required object pro {#devPodWorkspacePresets-spec} + -Git holds configuration for git environment spec source @@ -14890,9 +15904,9 @@ Git holds configuration for git environment spec source
-##### `repository` required string pro {#devPodEnvironmentTemplates-spec-git-repository} +#### `displayName` required string pro {#devPodWorkspacePresets-spec-displayName} -Repository stores repository URL for Git environment spec source +DisplayName is the name that should be displayed in the UI @@ -14902,12 +15916,24 @@ Repository stores repository URL for Git environment spec source +
+ + +#### `source` required object pro {#devPodWorkspacePresets-spec-source} + +Source stores inline path of project source + + + + + +
-##### `revision` required string pro {#devPodEnvironmentTemplates-spec-git-revision} +##### `git` required string pro {#devPodWorkspacePresets-spec-source-git} -Revision stores revision to checkout in repository +Git stores path to git repo to use as workspace source @@ -14920,9 +15946,9 @@ Revision stores revision to checkout in repository
-##### `subpath` required string pro {#devPodEnvironmentTemplates-spec-git-subpath} +##### `image` required string pro {#devPodWorkspacePresets-spec-source-image} -SubPath stores subpath within Repositor where environment spec is +Image stores container image to use as workspace source @@ -14931,13 +15957,64 @@ SubPath stores subpath within Repositor where environment spec is
+
+ + + +
+ + +#### `infrastructureRef` required object pro {#devPodWorkspacePresets-spec-infrastructureRef} + +InfrastructureRef stores reference to DevPodWorkspaceTemplate to use + + + + +
-##### `useProjectGitCredentials` required boolean pro {#devPodEnvironmentTemplates-spec-git-useProjectGitCredentials} +##### `name` required string pro {#devPodWorkspacePresets-spec-infrastructureRef-name} -UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment +Name holds the name of the template to reference. + + + + + +
+ + + +
+ + +##### `version` required string pro {#devPodWorkspacePresets-spec-infrastructureRef-version} + +Version holds the template 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. + + + + + +
+ + + +
+ + +##### `syncOnce` required boolean pro {#devPodWorkspacePresets-spec-infrastructureRef-syncOnce} + +SyncOnce tells the controller to sync the instance once with the template. +This is useful if you want to sync an instance after a template was changed. +To automatically sync an instance with a template, use 'x.x.x' as version +instead. @@ -14953,7 +16030,67 @@ UseProjectGitCredentials specifies if the project git credentials should be used
-#### `owner` required object pro {#devPodEnvironmentTemplates-spec-owner} +#### `environmentRef` required object pro {#devPodWorkspacePresets-spec-environmentRef} + +EnvironmentRef stores reference to DevPodEnvironmentTemplate + + + + + + +
+ + +##### `name` required string pro {#devPodWorkspacePresets-spec-environmentRef-name} + +Name is the name of DevPodEnvironmentTemplate this references + + + + + +
+ + + +
+ + +##### `version` required string pro {#devPodWorkspacePresets-spec-environmentRef-version} + +Version is the version of DevPodEnvironmentTemplate this references + + + + + +
+ + +
+ + + +
+ + +#### `useProjectGitCredentials` required boolean pro {#devPodWorkspacePresets-spec-useProjectGitCredentials} + +UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment + + + + + +
+ + + +
+ + +#### `owner` required object pro {#devPodWorkspacePresets-spec-owner} Owner holds the owner of this object @@ -14965,7 +16102,7 @@ Owner holds the owner of this object
-##### `user` required string pro {#devPodEnvironmentTemplates-spec-owner-user} +##### `user` required string pro {#devPodWorkspacePresets-spec-owner-user} User specifies a Loft user. @@ -14980,7 +16117,7 @@ User specifies a Loft user.
-##### `team` required string pro {#devPodEnvironmentTemplates-spec-owner-team} +##### `team` required string pro {#devPodWorkspacePresets-spec-owner-team} Team specifies a Loft team. @@ -14998,7 +16135,7 @@ Team specifies a Loft team.
-#### `access` required object[] pro {#devPodEnvironmentTemplates-spec-access} +#### `access` required object[] pro {#devPodWorkspacePresets-spec-access} Access to the DevPod machine instance object itself @@ -15010,7 +16147,7 @@ Access to the DevPod machine instance object itself
-##### `name` required string pro {#devPodEnvironmentTemplates-spec-access-name} +##### `name` required string pro {#devPodWorkspacePresets-spec-access-name} Name is an optional name that is used for this access rule @@ -15025,7 +16162,7 @@ Name is an optional name that is used for this access rule
-##### `verbs` required string[] pro {#devPodEnvironmentTemplates-spec-access-verbs} +##### `verbs` required string[] pro {#devPodWorkspacePresets-spec-access-verbs} Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds. @@ -15040,7 +16177,7 @@ Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestri
-##### `subresources` required string[] pro {#devPodEnvironmentTemplates-spec-access-subresources} +##### `subresources` required string[] pro {#devPodWorkspacePresets-spec-access-subresources} Subresources defines the sub resources that are allowed by this access rule @@ -15055,7 +16192,7 @@ Subresources defines the sub resources that are allowed by this access rule
-##### `users` required string[] pro {#devPodEnvironmentTemplates-spec-access-users} +##### `users` required string[] pro {#devPodWorkspacePresets-spec-access-users} Users specifies which users should be able to access this secret with the aforementioned verbs @@ -15070,7 +16207,7 @@ Users specifies which users should be able to access this secret with the aforem
-##### `teams` required string[] pro {#devPodEnvironmentTemplates-spec-access-teams} +##### `teams` required string[] pro {#devPodWorkspacePresets-spec-access-teams} Teams specifies which teams should be able to access this secret with the aforementioned verbs @@ -15088,7 +16225,7 @@ Teams specifies which teams should be able to access this secret with the aforem
-#### `versions` required object[] pro {#devPodEnvironmentTemplates-spec-versions} +#### `versions` required object[] pro {#devPodWorkspacePresets-spec-versions} Versions are different versions of the template that can be referenced as well @@ -15097,12 +16234,27 @@ Versions are different versions of the template that can be referenced as well +
+ + +##### `version` required string pro {#devPodWorkspacePresets-spec-versions-version} + +Version is the version. Needs to be in X.X.X format. + + + + + +
+ + +
-##### `git` required object pro {#devPodEnvironmentTemplates-spec-versions-git} +##### `source` required object pro {#devPodWorkspacePresets-spec-versions-source} -Git holds the GitEnvironmentTemplate +Source stores inline path of project source @@ -15112,9 +16264,9 @@ Git holds the GitEnvironmentTemplate
-##### `repository` required string pro {#devPodEnvironmentTemplates-spec-versions-git-repository} +##### `git` required string pro {#devPodWorkspacePresets-spec-versions-source-git} -Repository stores repository URL for Git environment spec source +Git stores path to git repo to use as workspace source @@ -15127,9 +16279,9 @@ Repository stores repository URL for Git environment spec source
-##### `revision` required string pro {#devPodEnvironmentTemplates-spec-versions-git-revision} +##### `image` required string pro {#devPodWorkspacePresets-spec-versions-source-image} -Revision stores revision to checkout in repository +Image stores container image to use as workspace source @@ -15138,13 +16290,28 @@ Revision stores revision to checkout in repository
+
+ + + +
+ + +##### `infrastructureRef` required object pro {#devPodWorkspacePresets-spec-versions-infrastructureRef} + +InfrastructureRef stores reference to DevPodWorkspaceTemplate to use + + + + +
-##### `subpath` required string pro {#devPodEnvironmentTemplates-spec-versions-git-subpath} +##### `name` required string pro {#devPodWorkspacePresets-spec-versions-infrastructureRef-name} -SubPath stores subpath within Repositor where environment spec is +Name holds the name of the template to reference. @@ -15157,9 +16324,30 @@ SubPath stores subpath within Repositor where environment spec is
-##### `useProjectGitCredentials` required boolean pro {#devPodEnvironmentTemplates-spec-versions-git-useProjectGitCredentials} +##### `version` required string pro {#devPodWorkspacePresets-spec-versions-infrastructureRef-version} -UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment +Version holds the template 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. + + + + + +
+ + + +
+ + +##### `syncOnce` required boolean pro {#devPodWorkspacePresets-spec-versions-infrastructureRef-syncOnce} + +SyncOnce tells the controller to sync the instance once with the template. +This is useful if you want to sync an instance after a template was changed. +To automatically sync an instance with a template, use 'x.x.x' as version +instead. @@ -15172,12 +16360,57 @@ UseProjectGitCredentials specifies if the project git credentials should be used +
+ + +##### `environmentRef` required object pro {#devPodWorkspacePresets-spec-versions-environmentRef} + +EnvironmentRef stores reference to DevPodEnvironmentTemplate + + + + + +
-##### `version` required string pro {#devPodEnvironmentTemplates-spec-versions-version} +##### `name` required string pro {#devPodWorkspacePresets-spec-versions-environmentRef-name} -Version is the version. Needs to be in X.X.X format. +Name is the name of DevPodEnvironmentTemplate this references + + + + + +
+ + + +
+ + +##### `version` required string pro {#devPodWorkspacePresets-spec-versions-environmentRef-version} + +Version is the version of DevPodEnvironmentTemplate this references + + + + + +
+ + +
+ + + +
+ + +##### `useProjectGitCredentials` required boolean pro {#devPodWorkspacePresets-spec-versions-useProjectGitCredentials} + +UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment @@ -15196,7 +16429,7 @@ Version is the version. Needs to be in X.X.X format.
-### `status` required object pro {#devPodEnvironmentTemplates-status} +### `status` required object pro {#devPodWorkspacePresets-status} diff --git a/platform/api/_partials/resources/projects/update.mdx b/platform/api/_partials/resources/projects/update.mdx index c3a5c7ae6..6649fae22 100755 --- a/platform/api/_partials/resources/projects/update.mdx +++ b/platform/api/_partials/resources/projects/update.mdx @@ -69,6 +69,7 @@ spec: kind: Team name: my-team quotas: {} + requirePreset: {} requireTemplate: {} vault: {} status: {} diff --git a/platform/api/resources/devpodworkspaceinstance/devpodworkspaceinstance.mdx b/platform/api/resources/devpodworkspaceinstance/devpodworkspaceinstance.mdx index b41d1fe50..f5b127875 100755 --- a/platform/api/resources/devpodworkspaceinstance/devpodworkspaceinstance.mdx +++ b/platform/api/resources/devpodworkspaceinstance/devpodworkspaceinstance.mdx @@ -22,8 +22,6 @@ metadata: namespace: loft-p-my-project spec: displayName: my-display-name - environmentRef: - name: "" owner: user: my-user parameters: 'my-parameter: my-value' diff --git a/platform/api/resources/project/project.mdx b/platform/api/resources/project/project.mdx index 0b7d4888a..f1cea9b81 100755 --- a/platform/api/resources/project/project.mdx +++ b/platform/api/resources/project/project.mdx @@ -37,6 +37,7 @@ spec: kind: Team name: my-team quotas: {} + requirePreset: {} requireTemplate: {} vault: {} status: {} diff --git a/vendor/github.com/loft-sh/admin-apis/pkg/licenseapi/features.go b/vendor/github.com/loft-sh/admin-apis/pkg/licenseapi/features.go index 2a788993b..05526e315 100644 --- a/vendor/github.com/loft-sh/admin-apis/pkg/licenseapi/features.go +++ b/vendor/github.com/loft-sh/admin-apis/pkg/licenseapi/features.go @@ -23,8 +23,10 @@ const ( VirtualClusterProDistroFips FeatureName = "vcp-distro-fips" VirtualClusterProDistroIntegrationsExternalSecrets FeatureName = "vcp-distro-integrations-external-secrets" VirtualClusterProDistroIntegrationsKubeVirt FeatureName = "vcp-distro-integrations-kube-virt" + VirtualClusterProDistroIntegrationsCertManager FeatureName = "vcp-distro-integrations-cert-manager" VirtualClusterProDistroExternalDatabase FeatureName = "vcp-distro-external-database" VirtualClusterProDistroDatabaseConnector FeatureName = "connector-external-database" + VirtualClusterProDistroSleepMode FeatureName = "vcp-distro-sleep-mode" // Spaces & Clusters ConnectedClusters FeatureName = "connected-clusters" @@ -87,7 +89,9 @@ func GetVClusterFeatures() []FeatureName { VirtualClusterProDistroFips, VirtualClusterProDistroIntegrationsKubeVirt, VirtualClusterProDistroIntegrationsExternalSecrets, + VirtualClusterProDistroIntegrationsCertManager, VirtualClusterProDistroExternalDatabase, VirtualClusterProDistroDatabaseConnector, + VirtualClusterProDistroSleepMode, } } diff --git a/vendor/github.com/loft-sh/admin-apis/pkg/licenseapi/license_new.go b/vendor/github.com/loft-sh/admin-apis/pkg/licenseapi/license_new.go index a06ee9d90..809366ef4 100644 --- a/vendor/github.com/loft-sh/admin-apis/pkg/licenseapi/license_new.go +++ b/vendor/github.com/loft-sh/admin-apis/pkg/licenseapi/license_new.go @@ -136,6 +136,11 @@ func New(product ProductName) *License { Name: string(VirtualClusterProDistroIntegrationsExternalSecrets), Status: virtualClusterStatus, }, + { + DisplayName: "Cert Manager Integration", + Name: string(VirtualClusterProDistroIntegrationsCertManager), + Status: virtualClusterStatus, + }, { DisplayName: "FIPS", Name: string(VirtualClusterProDistroFips), @@ -150,6 +155,11 @@ func New(product ProductName) *License { Name: string(VirtualClusterProDistroDatabaseConnector), Status: virtualClusterStatus, }, + { + DisplayName: "SleepMode", + Name: string(VirtualClusterProDistroSleepMode), + Status: virtualClusterStatus, + }, }, }, { @@ -327,6 +337,10 @@ func New(product ProductName) *License { }, }, }, + { + DisplayName: "vCluster Sleep Mode", + Name: string(VirtualClusterSleepMode), + }, }, } } diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/cluster_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/cluster_types.go index af3148670..228c2f205 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/cluster_types.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/config_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/config_types.go index 3015b1132..6b4a528f4 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/config_types.go +++ b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/config_types.go @@ -70,9 +70,12 @@ type ConfigStatus struct { // DisableLoftConfigEndpoint will disable setting config via the UI and config.management.loft.sh endpoint DisableConfigEndpoint bool `json:"disableConfigEndpoint,omitempty"` - // Cloud holkds the settings to be used exclusively in vCluster Cloud based + // 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 @@ -716,3 +719,56 @@ type MaintenanceWindow struct { // 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/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodenvironmenttemplate_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodenvironmenttemplate_types.go index c61f33604..b22464aa5 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodenvironmenttemplate_types.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go new file mode 100644 index 000000000..33edb58a8 --- /dev/null +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodworkspaceinstance_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodworkspaceinstance_types.go index a77b54985..08db551bc 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodworkspaceinstance_types.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodworkspacepreset_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/devpodworkspacepreset_types.go new file mode 100644 index 000000000..45b1f9129 --- /dev/null +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/project_templates_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/project_templates_types.go index 5c894109a..6ea1539d2 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/project_templates_types.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.api.register.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.api.register.go index de255385e..41670215d 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.api.register.go +++ b/vendor/github.com/loft-sh/api/v4/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{}, @@ -153,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 @@ -224,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, @@ -629,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"` @@ -637,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"` diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.conversion.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.conversion.go index 8bb4e6829..e5f3f90e0 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.conversion.go +++ b/vendor/github.com/loft-sh/api/v4/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" @@ -819,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 { @@ -1019,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 { @@ -4804,6 +4915,7 @@ func autoConvert_v1_ConfigStatus_To_management_ConfigStatus(in *ConfigStatus, ou 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 } @@ -4826,6 +4938,7 @@ func autoConvert_management_ConfigStatus_To_v1_ConfigStatus(in *management.Confi 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 } @@ -4992,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 @@ -5551,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 { @@ -7520,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 } @@ -7538,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 } diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.deepcopy.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.deepcopy.go index 7476a60c4..dbcf7a96c 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/loft-sh/api/v4/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" ) @@ -1018,7 +1019,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 } @@ -1834,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 } @@ -2033,6 +2034,11 @@ func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus) { *out = new(Cloud) **out = **in } + if in.CostControl != nil { + in, out := &in.CostControl, &out.CostControl + *out = new(CostControl) + (*in).DeepCopyInto(*out) + } return } @@ -2209,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 @@ -2742,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 @@ -3123,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 @@ -4874,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 } diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.defaults.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.defaults.go index d7e43310b..dcd0a9684 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/v1/zz_generated.defaults.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go index 2fbd630c4..048915122 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.api.register.go +++ b/vendor/github.com/loft-sh/api/v4/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", @@ -1270,7 +1305,10 @@ var ( InternalDevPodSshOptionsREST, InternalDevPodWorkspaceInstanceStateREST, InternalDevPodStopOptionsREST, + InternalDevPodWorkspaceInstanceTroubleshootREST, InternalDevPodUpOptionsREST, + InternalDevPodWorkspacePreset, + InternalDevPodWorkspacePresetStatus, InternalDevPodWorkspaceTemplate, InternalDevPodWorkspaceTemplateStatus, InternalDirectClusterEndpointToken, @@ -1821,6 +1859,7 @@ type ConfigStatus struct { VaultIntegration *storagev1.VaultIntegrationSpec `json:"vault,omitempty"` DisableConfigEndpoint bool `json:"disableConfigEndpoint,omitempty"` Cloud *Cloud `json:"cloud,omitempty"` + CostControl *CostControl `json:"costControl,omitempty"` } type Connector struct { @@ -1860,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 { @@ -1944,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 @@ -2358,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"` } @@ -4165,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"` @@ -4270,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 diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.deepcopy.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.deepcopy.go index 1e201a8bb..2df2d326d 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.deepcopy.go +++ b/vendor/github.com/loft-sh/api/v4/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" ) @@ -993,7 +994,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 } @@ -1809,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 } @@ -2008,6 +2009,11 @@ func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus) { *out = new(Cloud) **out = **in } + if in.CostControl != nil { + in, out := &in.CostControl, &out.CostControl + *out = new(CostControl) + (*in).DeepCopyInto(*out) + } return } @@ -2184,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 @@ -2717,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 @@ -4833,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 } diff --git a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.defaults.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.defaults.go index 619605f48..228a30c34 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/management/zz_generated.defaults.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/cluster_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/cluster_types.go index e814511f3..520207adb 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/cluster_types.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go index c2737baad..ed66c9602 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspaceinstance_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspaceinstance_types.go index 51e8fedda..c6e86c3fe 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspaceinstance_types.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacepreset_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/devpodworkspacepreset_types.go new file mode 100644 index 000000000..4fff5fa12 --- /dev/null +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/project_types.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/project_types.go index 2fec41e1d..1cca19b94 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/project_types.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/zz_generated.deepcopy.go b/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/zz_generated.deepcopy.go index 7de9add4a..f6c13ca6c 100644 --- a/vendor/github.com/loft-sh/api/v4/pkg/apis/storage/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/loft-sh/api/v4/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/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go index e0ac34666..6f1200180 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go @@ -158,6 +158,9 @@ func GatherAndCount(g prometheus.Gatherer, metricNames ...string) (int, error) { // ScrapeAndCompare calls a remote exporter's endpoint which is expected to return some metrics in // plain text format. Then it compares it with the results that the `expected` would return. // If the `metricNames` is not empty it would filter the comparison only to the given metric names. +// +// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter +// both expected and scraped metrics. See https://github.com/prometheus/client_golang/issues/1351. func ScrapeAndCompare(url string, expected io.Reader, metricNames ...string) error { resp, err := http.Get(url) if err != nil { @@ -185,6 +188,9 @@ func ScrapeAndCompare(url string, expected io.Reader, metricNames ...string) err // CollectAndCompare collects the metrics identified by `metricNames` and compares them in the Prometheus text // exposition format to the data read from expected. +// +// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter +// both expected and collected metrics. See https://github.com/prometheus/client_golang/issues/1351. func CollectAndCompare(c prometheus.Collector, expected io.Reader, metricNames ...string) error { reg := prometheus.NewPedanticRegistry() if err := reg.Register(c); err != nil { @@ -197,6 +203,9 @@ func CollectAndCompare(c prometheus.Collector, expected io.Reader, metricNames . // it to an expected output read from the provided Reader in the Prometheus text // exposition format. If any metricNames are provided, only metrics with those // names are compared. +// +// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter +// both expected and gathered metrics. See https://github.com/prometheus/client_golang/issues/1351. func GatherAndCompare(g prometheus.Gatherer, expected io.Reader, metricNames ...string) error { return TransactionalGatherAndCompare(prometheus.ToTransactionalGatherer(g), expected, metricNames...) } @@ -205,6 +214,9 @@ func GatherAndCompare(g prometheus.Gatherer, expected io.Reader, metricNames ... // it to an expected output read from the provided Reader in the Prometheus text // exposition format. If any metricNames are provided, only metrics with those // names are compared. +// +// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter +// both expected and gathered metrics. See https://github.com/prometheus/client_golang/issues/1351. func TransactionalGatherAndCompare(g prometheus.TransactionalGatherer, expected io.Reader, metricNames ...string) error { got, done, err := g.Gather() defer done() @@ -277,15 +289,6 @@ func compareMetricFamilies(got, expected []*dto.MetricFamily, metricNames ...str if metricNames != nil { got = filterMetrics(got, metricNames) expected = filterMetrics(expected, metricNames) - if len(metricNames) > len(got) { - var missingMetricNames []string - for _, name := range metricNames { - if ok := hasMetricByName(got, name); !ok { - missingMetricNames = append(missingMetricNames, name) - } - } - return fmt.Errorf("expected metric name(s) not found: %v", missingMetricNames) - } } return compare(got, expected) @@ -327,12 +330,3 @@ func filterMetrics(metrics []*dto.MetricFamily, names []string) []*dto.MetricFam } return filtered } - -func hasMetricByName(metrics []*dto.MetricFamily, name string) bool { - for _, mf := range metrics { - if mf.GetName() == name { - return true - } - } - return false -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 446213c14..794b3fe08 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -167,15 +167,15 @@ github.com/klauspost/compress/zstd/internal/xxhash # github.com/kylelemons/godebug v1.1.0 ## explicit; go 1.11 github.com/kylelemons/godebug/diff -# github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0 +# github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 ## explicit; go 1.21.1 github.com/loft-sh/admin-apis/pkg/licenseapi -# github.com/loft-sh/agentapi/v4 v4.1.0 +# github.com/loft-sh/agentapi/v4 v4.2.0 ## explicit; go 1.22.5 github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster github.com/loft-sh/agentapi/v4/pkg/apis/loft/cluster/v1 github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1 -# github.com/loft-sh/api/v4 v4.1.0 +# github.com/loft-sh/api/v4 v4.2.0 ## explicit; go 1.22.5 github.com/loft-sh/api/v4/pkg/apis/audit/v1 github.com/loft-sh/api/v4/pkg/apis/management @@ -203,7 +203,7 @@ github.com/munnerz/goautoneg # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors -# github.com/prometheus/client_golang v1.20.4 +# github.com/prometheus/client_golang v1.20.5 ## explicit; go 1.20 github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil github.com/prometheus/client_golang/internal/github.com/golang/gddo/httputil/header