From 41f9e3edf5fbccc0a21303c84ec47621a5909a48 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:04:09 +0000 Subject: [PATCH 01/11] [skip ci] repo-sync --- go.mod | 2 +- go.sum | 4 ++-- pkg/apis/ui/v1/ui_types.go | 7 ++++++- pkg/openapi/zz_generated.openapi.go | 9 ++++++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 8410991..dc3ca0b 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 - github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 + github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 7e4f65b..671fe03 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 h1:aqT1UeosCYB+3DEzfxW0evhcYHxhoBVAEWtkXLXFimI= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 h1:yoTwfLkurXmA7ENb8YWQePIVK42vZVSeV4unngNc8c8= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= +github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19 h1:YoSavyYFrGN2diMO3qLLz89ufbeuiKaOADahBPgURGk= +github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/pkg/apis/ui/v1/ui_types.go b/pkg/apis/ui/v1/ui_types.go index b5cd94b..91c2f8b 100644 --- a/pkg/apis/ui/v1/ui_types.go +++ b/pkg/apis/ui/v1/ui_types.go @@ -34,11 +34,16 @@ type UISettingsSpec struct { // +optional Offline bool `json:"offline,omitempty"` - // HasHelmRelease indicates whether loft has been installed via Helm + // HasHelmRelease indicates whether the vCluster Platform instance + // has been installed via Helm HasHelmRelease bool `json:"hasHelmRelease,omitempty"` // DefaultVClusterVersion is the default version of vClusters DefaultVClusterVersion string `json:"defaultVClusterVersion,omitempty"` + + // LoftHosted indicates whether the vCluster Platform instance + // is hosted and operated by Loft Labs Inc. + LoftHosted bool `json:"loftHosted,omitempty"` } type UISettingsConfig struct { diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index a60f689..2e5b689 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -28483,7 +28483,7 @@ func schema_pkg_apis_ui_v1_UISettingsSpec(ref common.ReferenceCallback) common.O }, "hasHelmRelease": { SchemaProps: spec.SchemaProps{ - Description: "HasHelmRelease indicates whether loft has been installed via Helm", + Description: "HasHelmRelease indicates whether the vCluster Platform instance has been installed via Helm", Type: []string{"boolean"}, Format: "", }, @@ -28495,6 +28495,13 @@ func schema_pkg_apis_ui_v1_UISettingsSpec(ref common.ReferenceCallback) common.O Format: "", }, }, + "loftHosted": { + SchemaProps: spec.SchemaProps{ + Description: "LoftHosted indicates whether the vCluster Platform instance is hosted and operated by Loft Labs Inc.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, From 0fe28c2e0287f57bb332d9e6f6395994b0ac2d24 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:35:16 +0000 Subject: [PATCH 02/11] [skip ci] repo-sync --- go.mod | 2 +- go.sum | 4 +- .../install/zz_generated.api.register.go | 1 + ...lclusterinstance_externaldatabase_types.go | 34 ++++ .../v1/virtualclusterinstance_types.go | 2 + .../v1/zz_generated.api.register.go | 14 ++ .../management/v1/zz_generated.conversion.go | 134 ++++++++++++++++ .../management/v1/zz_generated.deepcopy.go | 93 +++++++++++ .../management/zz_generated.api.register.go | 36 ++++- pkg/apis/management/zz_generated.deepcopy.go | 93 +++++++++++ .../v1/fake/fake_virtualclusterinstance.go | 12 ++ .../management/v1/virtualclusterinstance.go | 16 ++ pkg/openapi/zz_generated.openapi.go | 149 +++++++++++++++++- 13 files changed, 578 insertions(+), 12 deletions(-) create mode 100644 pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go diff --git a/go.mod b/go.mod index dc3ca0b..feeb4ca 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 - github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19 + github.com/loft-sh/agentapi/v4 v4.1.0-alpha.21 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 671fe03..46a8aca 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 h1:aqT1UeosCYB+3DEzfxW0evhcYHxhoBVAEWtkXLXFimI= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19 h1:YoSavyYFrGN2diMO3qLLz89ufbeuiKaOADahBPgURGk= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.19/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= +github.com/loft-sh/agentapi/v4 v4.1.0-alpha.21 h1:P4cotygKNhYiwFPaDSCeUSeGQPT/2CIX0vIbdHwxfWc= +github.com/loft-sh/agentapi/v4 v4.1.0-alpha.21/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/pkg/apis/management/install/zz_generated.api.register.go b/pkg/apis/management/install/zz_generated.api.register.go index bbc8be2..6480568 100644 --- a/pkg/apis/management/install/zz_generated.api.register.go +++ b/pkg/apis/management/install/zz_generated.api.register.go @@ -136,6 +136,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &management.VirtualClusterInstance{}, &management.VirtualClusterInstanceList{}, &management.VirtualClusterAccessKey{}, + &management.VirtualClusterExternalDatabase{}, &management.VirtualClusterInstanceKubeConfig{}, &management.VirtualClusterInstanceLog{}, &management.VirtualClusterTemplate{}, diff --git a/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go b/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go new file mode 100644 index 0000000..1fd3701 --- /dev/null +++ b/pkg/apis/management/v1/virtualclusterinstance_externaldatabase_types.go @@ -0,0 +1,34 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualClusterExternalDatabase holds kube config request and response data for virtual clusters +// +subresource-request +type VirtualClusterExternalDatabase struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualClusterExternalDatabaseSpec `json:"spec,omitempty"` + Status VirtualClusterExternalDatabaseStatus `json:"status,omitempty"` +} + +type VirtualClusterExternalDatabaseSpec struct { + // Connector specifies the secret that should be used to connect to an external database server. The connection is + // used to manage a user and database for the vCluster. A data source endpoint constructed from the created user and + // database is returned on status. The secret specified by connector should contain the following fields: + // endpoint - the endpoint where the database server can be accessed + // user - the database username + // password - the password for the database username + // port - the port to be used in conjunction with the endpoint to connect to the databse server. This is commonly + // 3306 + // +optional + Connector string `json:"connector,omitempty"` +} + +type VirtualClusterExternalDatabaseStatus struct { + // DataSource holds a datasource endpoint constructed from the vCluster's designated user and database. The user and + // database are created from the given connector. + DataSource string `json:"dataSource,omitempty"` +} diff --git a/pkg/apis/management/v1/virtualclusterinstance_types.go b/pkg/apis/management/v1/virtualclusterinstance_types.go index 3dc28a2..c0b87f1 100644 --- a/pkg/apis/management/v1/virtualclusterinstance_types.go +++ b/pkg/apis/management/v1/virtualclusterinstance_types.go @@ -11,6 +11,7 @@ import ( // +genclient:noStatus // +genclient:method=GetKubeConfig,verb=create,subresource=kubeconfig,input=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig // +genclient:method=GetAccessKey,verb=get,subresource=accesskey,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKey +// +genclient:method=GetExternalDatabase,verb=create,subresource=externaldatabase,input=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // VirtualClusterInstance holds the VirtualClusterInstance information @@ -19,6 +20,7 @@ import ( // +subresource:request=VirtualClusterInstanceLog,path=log,kind=VirtualClusterInstanceLog,rest=VirtualClusterInstanceLogREST // +subresource:request=VirtualClusterInstanceKubeConfig,path=kubeconfig,kind=VirtualClusterInstanceKubeConfig,rest=VirtualClusterInstanceKubeConfigREST // +subresource:request=VirtualClusterAccessKey,path=accesskey,kind=VirtualClusterAccessKey,rest=VirtualClusterAccessKeyREST +// +subresource:request=VirtualClusterExternalDatabase,path=externaldatabase,kind=VirtualClusterExternalDatabase,rest=VirtualClusterExternalDatabaseREST type VirtualClusterInstance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/v1/zz_generated.api.register.go b/pkg/apis/management/v1/zz_generated.api.register.go index 631c4d1..de25538 100644 --- a/pkg/apis/management/v1/zz_generated.api.register.go +++ b/pkg/apis/management/v1/zz_generated.api.register.go @@ -127,6 +127,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &VirtualClusterInstance{}, &VirtualClusterInstanceList{}, &VirtualClusterAccessKey{}, + &VirtualClusterExternalDatabase{}, &VirtualClusterInstanceKubeConfig{}, &VirtualClusterInstanceLog{}, &VirtualClusterTemplate{}, @@ -371,6 +372,11 @@ var ( func() runtime.Object { return &VirtualClusterAccessKey{} }, // Register versioned resource nil, management.NewVirtualClusterAccessKeyREST), + builders.NewApiResourceWithStorage( + management.InternalVirtualClusterExternalDatabaseREST, + func() runtime.Object { return &VirtualClusterExternalDatabase{} }, // Register versioned resource + nil, + management.NewVirtualClusterExternalDatabaseREST), builders.NewApiResourceWithStorage( management.InternalVirtualClusterInstanceKubeConfigREST, func() runtime.Object { return &VirtualClusterInstanceKubeConfig{} }, // Register versioned resource @@ -1015,6 +1021,14 @@ type VirtualClusterAccessKeyList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type VirtualClusterExternalDatabaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualClusterExternalDatabase `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type VirtualClusterInstanceKubeConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/v1/zz_generated.conversion.go b/pkg/apis/management/v1/zz_generated.conversion.go index 2812850..2677282 100644 --- a/pkg/apis/management/v1/zz_generated.conversion.go +++ b/pkg/apis/management/v1/zz_generated.conversion.go @@ -2659,6 +2659,46 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabase)(nil), (*management.VirtualClusterExternalDatabase)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(a.(*VirtualClusterExternalDatabase), b.(*management.VirtualClusterExternalDatabase), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabase)(nil), (*VirtualClusterExternalDatabase)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(a.(*management.VirtualClusterExternalDatabase), b.(*VirtualClusterExternalDatabase), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseList)(nil), (*management.VirtualClusterExternalDatabaseList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(a.(*VirtualClusterExternalDatabaseList), b.(*management.VirtualClusterExternalDatabaseList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseList)(nil), (*VirtualClusterExternalDatabaseList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(a.(*management.VirtualClusterExternalDatabaseList), b.(*VirtualClusterExternalDatabaseList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseSpec)(nil), (*management.VirtualClusterExternalDatabaseSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(a.(*VirtualClusterExternalDatabaseSpec), b.(*management.VirtualClusterExternalDatabaseSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseSpec)(nil), (*VirtualClusterExternalDatabaseSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(a.(*management.VirtualClusterExternalDatabaseSpec), b.(*VirtualClusterExternalDatabaseSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VirtualClusterExternalDatabaseStatus)(nil), (*management.VirtualClusterExternalDatabaseStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(a.(*VirtualClusterExternalDatabaseStatus), b.(*management.VirtualClusterExternalDatabaseStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.VirtualClusterExternalDatabaseStatus)(nil), (*VirtualClusterExternalDatabaseStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(a.(*management.VirtualClusterExternalDatabaseStatus), b.(*VirtualClusterExternalDatabaseStatus), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*VirtualClusterInstance)(nil), (*management.VirtualClusterInstance)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_VirtualClusterInstance_To_management_VirtualClusterInstance(a.(*VirtualClusterInstance), b.(*management.VirtualClusterInstance), scope) }); err != nil { @@ -9532,6 +9572,100 @@ func Convert_management_VirtualClusterAccessKeyList_To_v1_VirtualClusterAccessKe return autoConvert_management_VirtualClusterAccessKeyList_To_v1_VirtualClusterAccessKeyList(in, out, s) } +func autoConvert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in *VirtualClusterExternalDatabase, out *management.VirtualClusterExternalDatabase, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in *VirtualClusterExternalDatabase, out *management.VirtualClusterExternalDatabase, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabase_To_management_VirtualClusterExternalDatabase(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in *management.VirtualClusterExternalDatabase, out *VirtualClusterExternalDatabase, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in *management.VirtualClusterExternalDatabase, out *VirtualClusterExternalDatabase, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabase_To_v1_VirtualClusterExternalDatabase(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in *VirtualClusterExternalDatabaseList, out *management.VirtualClusterExternalDatabaseList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]management.VirtualClusterExternalDatabase)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in *VirtualClusterExternalDatabaseList, out *management.VirtualClusterExternalDatabaseList, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseList_To_management_VirtualClusterExternalDatabaseList(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in *management.VirtualClusterExternalDatabaseList, out *VirtualClusterExternalDatabaseList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]VirtualClusterExternalDatabase)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in *management.VirtualClusterExternalDatabaseList, out *VirtualClusterExternalDatabaseList, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseList_To_v1_VirtualClusterExternalDatabaseList(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in *VirtualClusterExternalDatabaseSpec, out *management.VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + out.Connector = in.Connector + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in *VirtualClusterExternalDatabaseSpec, out *management.VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseSpec_To_management_VirtualClusterExternalDatabaseSpec(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in *management.VirtualClusterExternalDatabaseSpec, out *VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + out.Connector = in.Connector + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in *management.VirtualClusterExternalDatabaseSpec, out *VirtualClusterExternalDatabaseSpec, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseSpec_To_v1_VirtualClusterExternalDatabaseSpec(in, out, s) +} + +func autoConvert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in *VirtualClusterExternalDatabaseStatus, out *management.VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + out.DataSource = in.DataSource + return nil +} + +// Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus is an autogenerated conversion function. +func Convert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in *VirtualClusterExternalDatabaseStatus, out *management.VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + return autoConvert_v1_VirtualClusterExternalDatabaseStatus_To_management_VirtualClusterExternalDatabaseStatus(in, out, s) +} + +func autoConvert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in *management.VirtualClusterExternalDatabaseStatus, out *VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + out.DataSource = in.DataSource + return nil +} + +// Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus is an autogenerated conversion function. +func Convert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in *management.VirtualClusterExternalDatabaseStatus, out *VirtualClusterExternalDatabaseStatus, s conversion.Scope) error { + return autoConvert_management_VirtualClusterExternalDatabaseStatus_To_v1_VirtualClusterExternalDatabaseStatus(in, out, s) +} + func autoConvert_v1_VirtualClusterInstance_To_management_VirtualClusterInstance(in *VirtualClusterInstance, out *management.VirtualClusterInstance, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1_VirtualClusterInstanceSpec_To_management_VirtualClusterInstanceSpec(&in.Spec, &out.Spec, s); err != nil { diff --git a/pkg/apis/management/v1/zz_generated.deepcopy.go b/pkg/apis/management/v1/zz_generated.deepcopy.go index 0dbb4fb..d1b05f3 100644 --- a/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -7106,6 +7106,99 @@ func (in *VirtualClusterAccessKeyList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabase) DeepCopyInto(out *VirtualClusterExternalDatabase) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabase. +func (in *VirtualClusterExternalDatabase) DeepCopy() *VirtualClusterExternalDatabase { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabase) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseList) DeepCopyInto(out *VirtualClusterExternalDatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualClusterExternalDatabase, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseList. +func (in *VirtualClusterExternalDatabaseList) DeepCopy() *VirtualClusterExternalDatabaseList { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabaseList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopyInto(out *VirtualClusterExternalDatabaseSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseSpec. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopy() *VirtualClusterExternalDatabaseSpec { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopyInto(out *VirtualClusterExternalDatabaseStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseStatus. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopy() *VirtualClusterExternalDatabaseStatus { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualClusterInstance) DeepCopyInto(out *VirtualClusterInstance) { *out = *in diff --git a/pkg/apis/management/zz_generated.api.register.go b/pkg/apis/management/zz_generated.api.register.go index 15c51fd..4c757f5 100644 --- a/pkg/apis/management/zz_generated.api.register.go +++ b/pkg/apis/management/zz_generated.api.register.go @@ -1194,7 +1194,15 @@ var ( NewVirtualClusterAccessKeyREST = func(getter generic.RESTOptionsGetter) rest.Storage { return NewVirtualClusterAccessKeyRESTFunc(Factory) } - NewVirtualClusterAccessKeyRESTFunc NewRESTFunc + NewVirtualClusterAccessKeyRESTFunc NewRESTFunc + InternalVirtualClusterExternalDatabaseREST = builders.NewInternalSubresource( + "virtualclusterinstances", "VirtualClusterExternalDatabase", "externaldatabase", + func() runtime.Object { return &VirtualClusterExternalDatabase{} }, + ) + NewVirtualClusterExternalDatabaseREST = func(getter generic.RESTOptionsGetter) rest.Storage { + return NewVirtualClusterExternalDatabaseRESTFunc(Factory) + } + NewVirtualClusterExternalDatabaseRESTFunc NewRESTFunc InternalVirtualClusterInstanceKubeConfigREST = builders.NewInternalSubresource( "virtualclusterinstances", "VirtualClusterInstanceKubeConfig", "kubeconfig", func() runtime.Object { return &VirtualClusterInstanceKubeConfig{} }, @@ -1339,6 +1347,7 @@ var ( InternalVirtualClusterInstance, InternalVirtualClusterInstanceStatus, InternalVirtualClusterAccessKeyREST, + InternalVirtualClusterExternalDatabaseREST, InternalVirtualClusterInstanceKubeConfigREST, InternalVirtualClusterInstanceLogREST, InternalVirtualClusterTemplate, @@ -2729,6 +2738,23 @@ type VirtualClusterAccessKey struct { AccessKey string `json:"accessKey,omitempty"` } +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type VirtualClusterExternalDatabase struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec VirtualClusterExternalDatabaseSpec `json:"spec,omitempty"` + Status VirtualClusterExternalDatabaseStatus `json:"status,omitempty"` +} + +type VirtualClusterExternalDatabaseSpec struct { + Connector string `json:"connector,omitempty"` +} + +type VirtualClusterExternalDatabaseStatus struct { + DataSource string `json:"dataSource,omitempty"` +} + // +genclient // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -7628,6 +7654,14 @@ type VirtualClusterAccessKeyList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type VirtualClusterExternalDatabaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []VirtualClusterExternalDatabase `json:"items"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + type VirtualClusterInstanceKubeConfigList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/zz_generated.deepcopy.go b/pkg/apis/management/zz_generated.deepcopy.go index a6d83fc..2dd0f50 100644 --- a/pkg/apis/management/zz_generated.deepcopy.go +++ b/pkg/apis/management/zz_generated.deepcopy.go @@ -7049,6 +7049,99 @@ func (in *VirtualClusterAccessKeyList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabase) DeepCopyInto(out *VirtualClusterExternalDatabase) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabase. +func (in *VirtualClusterExternalDatabase) DeepCopy() *VirtualClusterExternalDatabase { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabase) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabase) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseList) DeepCopyInto(out *VirtualClusterExternalDatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualClusterExternalDatabase, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseList. +func (in *VirtualClusterExternalDatabaseList) DeepCopy() *VirtualClusterExternalDatabaseList { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualClusterExternalDatabaseList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopyInto(out *VirtualClusterExternalDatabaseSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseSpec. +func (in *VirtualClusterExternalDatabaseSpec) DeepCopy() *VirtualClusterExternalDatabaseSpec { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopyInto(out *VirtualClusterExternalDatabaseStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualClusterExternalDatabaseStatus. +func (in *VirtualClusterExternalDatabaseStatus) DeepCopy() *VirtualClusterExternalDatabaseStatus { + if in == nil { + return nil + } + out := new(VirtualClusterExternalDatabaseStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualClusterInstance) DeepCopyInto(out *VirtualClusterInstance) { *out = *in diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go index 56239ae..f2b5c3e 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_virtualclusterinstance.go @@ -140,3 +140,15 @@ func (c *FakeVirtualClusterInstances) GetAccessKey(ctx context.Context, virtualC } return obj.(*v1.VirtualClusterAccessKey), err } + +// GetExternalDatabase takes the representation of a virtualClusterExternalDatabase and creates it. Returns the server's representation of the virtualClusterExternalDatabase, and an error, if there is any. +func (c *FakeVirtualClusterInstances) GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (result *v1.VirtualClusterExternalDatabase, err error) { + emptyResult := &v1.VirtualClusterExternalDatabase{} + obj, err := c.Fake. + Invokes(testing.NewCreateSubresourceActionWithOptions(virtualclusterinstancesResource, virtualClusterInstanceName, "externaldatabase", c.ns, virtualClusterExternalDatabase, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1.VirtualClusterExternalDatabase), err +} diff --git a/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go b/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go index e8fef8a..cc7cf23 100644 --- a/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/virtualclusterinstance.go @@ -31,6 +31,7 @@ type VirtualClusterInstanceInterface interface { Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualClusterInstance, err error) GetKubeConfig(ctx context.Context, virtualClusterInstanceName string, virtualClusterInstanceKubeConfig *v1.VirtualClusterInstanceKubeConfig, opts metav1.CreateOptions) (*v1.VirtualClusterInstanceKubeConfig, error) GetAccessKey(ctx context.Context, virtualClusterInstanceName string, options metav1.GetOptions) (*v1.VirtualClusterAccessKey, error) + GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (*v1.VirtualClusterExternalDatabase, error) VirtualClusterInstanceExpansion } @@ -81,3 +82,18 @@ func (c *virtualClusterInstances) GetAccessKey(ctx context.Context, virtualClust Into(result) return } + +// GetExternalDatabase takes the representation of a virtualClusterExternalDatabase and creates it. Returns the server's representation of the virtualClusterExternalDatabase, and an error, if there is any. +func (c *virtualClusterInstances) GetExternalDatabase(ctx context.Context, virtualClusterInstanceName string, virtualClusterExternalDatabase *v1.VirtualClusterExternalDatabase, opts metav1.CreateOptions) (result *v1.VirtualClusterExternalDatabase, err error) { + result = &v1.VirtualClusterExternalDatabase{} + err = c.GetClient().Post(). + Namespace(c.GetNamespace()). + Resource("virtualclusterinstances"). + Name(virtualClusterInstanceName). + SubResource("externaldatabase"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualClusterExternalDatabase). + Do(ctx). + Into(result) + return +} diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index 2e5b689..2530d09 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -342,6 +342,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.UserVirtualClustersOptions": schema_pkg_apis_management_v1_UserVirtualClustersOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKey": schema_pkg_apis_management_v1_VirtualClusterAccessKey(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterAccessKeyList": schema_pkg_apis_management_v1_VirtualClusterAccessKeyList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase": schema_pkg_apis_management_v1_VirtualClusterExternalDatabase(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseList": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus": schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstance": schema_pkg_apis_management_v1_VirtualClusterInstance(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfig": schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfig(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterInstanceKubeConfigList": schema_pkg_apis_management_v1_VirtualClusterInstanceKubeConfigList(ref), @@ -17712,6 +17716,139 @@ func schema_pkg_apis_management_v1_VirtualClusterAccessKeyList(ref common.Refere } } +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabase(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VirtualClusterExternalDatabase holds kube config request and response data for virtual clusters", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabaseStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterExternalDatabase", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "connector": { + SchemaProps: spec.SchemaProps{ + Description: "Connector specifies the secret that should be used to connect to an external database server. The connection is used to manage a user and database for the vCluster. A data source endpoint constructed from the created user and database is returned on status. The secret specified by connector should contain the following fields: endpoint - the endpoint where the database server can be accessed user - the database username password - the password for the database username port - the port to be used in conjunction with the endpoint to connect to the databse server. This is commonly 3306", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_VirtualClusterExternalDatabaseStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dataSource": { + SchemaProps: spec.SchemaProps{ + Description: "DataSource holds a datasource endpoint constructed from the vCluster's designated user and database. The user and database are created from the given connector.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_management_v1_VirtualClusterInstance(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -29246,10 +29383,9 @@ func schema_k8sio_api_admissionregistration_v1_NamedRuleWithOperations(ref commo }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -29411,10 +29547,9 @@ func schema_k8sio_api_admissionregistration_v1_Rule(ref common.ReferenceCallback }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -29513,10 +29648,9 @@ func schema_k8sio_api_admissionregistration_v1_RuleWithOperations(ref common.Ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -30914,10 +31048,9 @@ func schema_k8sio_api_admissionregistration_v1beta1_NamedRuleWithOperations(ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, From 2a6efd5edf127f39a8281bcf715b51171beb11c9 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:10:25 +0000 Subject: [PATCH 03/11] [skip ci] repo-sync --- go.mod | 2 +- go.sum | 4 +- pkg/apis/management/v1/config_types.go | 24 ++++++ .../management/v1/zz_generated.conversion.go | 70 +++++++++++++++++ .../management/v1/zz_generated.deepcopy.go | 38 ++++++++++ .../management/zz_generated.api.register.go | 13 +++- pkg/apis/management/zz_generated.deepcopy.go | 38 ++++++++++ pkg/openapi/zz_generated.openapi.go | 76 +++++++++++++++++-- 8 files changed, 256 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index feeb4ca..15af1ea 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 - github.com/loft-sh/agentapi/v4 v4.1.0-alpha.21 + github.com/loft-sh/agentapi/v4 v4.1.0-beta.1 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 46a8aca..1529bf5 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 h1:aqT1UeosCYB+3DEzfxW0evhcYHxhoBVAEWtkXLXFimI= github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.21 h1:P4cotygKNhYiwFPaDSCeUSeGQPT/2CIX0vIbdHwxfWc= -github.com/loft-sh/agentapi/v4 v4.1.0-alpha.21/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= +github.com/loft-sh/agentapi/v4 v4.1.0-beta.1 h1:+/gPF6NmlznxHReo/C1DqlV7pLv0Jh0+kp1V2Kw0SJY= +github.com/loft-sh/agentapi/v4 v4.1.0-beta.1/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/pkg/apis/management/v1/config_types.go b/pkg/apis/management/v1/config_types.go index b8da709..3015b11 100644 --- a/pkg/apis/management/v1/config_types.go +++ b/pkg/apis/management/v1/config_types.go @@ -69,6 +69,10 @@ 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 + // environments and deployments. + Cloud *Cloud `json:"cloud,omitempty"` } // Audit holds the audit configuration options for loft. Changing any options will require a loft restart @@ -692,3 +696,23 @@ type AuthenticationOIDC struct { // +optional Type string `json:"type,omitempty"` } + +type Cloud struct { + // ReleaseChannel specifies the release channel for the cloud configuration. + // This can be used to determine which updates or versions are applied. + ReleaseChannel string `json:"releaseChannel,omitempty"` + + // MaintenanceWindow specifies the maintenance window for the cloud configuration. + // This is a structured representation of the time window during which maintenance can occur. + MaintenanceWindow MaintenanceWindow `json:"maintenanceWindow,omitempty"` +} + +type MaintenanceWindow struct { + // DayOfWeek specifies the day of the week for the maintenance window. + // It should be a string representing the day, e.g., "Monday", "Tuesday", etc. + DayOfWeek string `json:"dayOfWeek,omitempty"` + + // TimeWindow specifies the time window for the maintenance. + // It should be a string representing the time range in 24-hour format, in UTC, e.g., "02:00-03:00". + TimeWindow string `json:"timeWindow,omitempty"` +} diff --git a/pkg/apis/management/v1/zz_generated.conversion.go b/pkg/apis/management/v1/zz_generated.conversion.go index 2677282..8bb4e68 100644 --- a/pkg/apis/management/v1/zz_generated.conversion.go +++ b/pkg/apis/management/v1/zz_generated.conversion.go @@ -399,6 +399,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*Cloud)(nil), (*management.Cloud)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_Cloud_To_management_Cloud(a.(*Cloud), b.(*management.Cloud), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.Cloud)(nil), (*Cloud)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_Cloud_To_v1_Cloud(a.(*management.Cloud), b.(*Cloud), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*management.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_Cluster_To_management_Cluster(a.(*Cluster), b.(*management.Cluster), scope) }); err != nil { @@ -1419,6 +1429,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*MaintenanceWindow)(nil), (*management.MaintenanceWindow)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_MaintenanceWindow_To_management_MaintenanceWindow(a.(*MaintenanceWindow), b.(*management.MaintenanceWindow), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*management.MaintenanceWindow)(nil), (*MaintenanceWindow)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_management_MaintenanceWindow_To_v1_MaintenanceWindow(a.(*management.MaintenanceWindow), b.(*MaintenanceWindow), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*OIDC)(nil), (*management.OIDC)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_OIDC_To_management_OIDC(a.(*OIDC), b.(*management.OIDC), scope) }); err != nil { @@ -3920,6 +3940,32 @@ func Convert_management_BackupStatus_To_v1_BackupStatus(in *management.BackupSta return autoConvert_management_BackupStatus_To_v1_BackupStatus(in, out, s) } +func autoConvert_v1_Cloud_To_management_Cloud(in *Cloud, out *management.Cloud, s conversion.Scope) error { + out.ReleaseChannel = in.ReleaseChannel + if err := Convert_v1_MaintenanceWindow_To_management_MaintenanceWindow(&in.MaintenanceWindow, &out.MaintenanceWindow, s); err != nil { + return err + } + return nil +} + +// Convert_v1_Cloud_To_management_Cloud is an autogenerated conversion function. +func Convert_v1_Cloud_To_management_Cloud(in *Cloud, out *management.Cloud, s conversion.Scope) error { + return autoConvert_v1_Cloud_To_management_Cloud(in, out, s) +} + +func autoConvert_management_Cloud_To_v1_Cloud(in *management.Cloud, out *Cloud, s conversion.Scope) error { + out.ReleaseChannel = in.ReleaseChannel + if err := Convert_management_MaintenanceWindow_To_v1_MaintenanceWindow(&in.MaintenanceWindow, &out.MaintenanceWindow, s); err != nil { + return err + } + return nil +} + +// Convert_management_Cloud_To_v1_Cloud is an autogenerated conversion function. +func Convert_management_Cloud_To_v1_Cloud(in *management.Cloud, out *Cloud, s conversion.Scope) error { + return autoConvert_management_Cloud_To_v1_Cloud(in, out, s) +} + func autoConvert_v1_Cluster_To_management_Cluster(in *Cluster, out *management.Cluster, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta if err := Convert_v1_ClusterSpec_To_management_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { @@ -4757,6 +4803,7 @@ func autoConvert_v1_ConfigStatus_To_management_ConfigStatus(in *ConfigStatus, ou out.UISettings = (*uiv1.UISettingsConfig)(unsafe.Pointer(in.UISettings)) out.VaultIntegration = (*storagev1.VaultIntegrationSpec)(unsafe.Pointer(in.VaultIntegration)) out.DisableConfigEndpoint = in.DisableConfigEndpoint + out.Cloud = (*management.Cloud)(unsafe.Pointer(in.Cloud)) return nil } @@ -4778,6 +4825,7 @@ func autoConvert_management_ConfigStatus_To_v1_ConfigStatus(in *management.Confi out.UISettings = (*uiv1.UISettingsConfig)(unsafe.Pointer(in.UISettings)) out.VaultIntegration = (*storagev1.VaultIntegrationSpec)(unsafe.Pointer(in.VaultIntegration)) out.DisableConfigEndpoint = in.DisableConfigEndpoint + out.Cloud = (*Cloud)(unsafe.Pointer(in.Cloud)) return nil } @@ -6489,6 +6537,28 @@ func Convert_management_LoftUpgradeStatus_To_v1_LoftUpgradeStatus(in *management return autoConvert_management_LoftUpgradeStatus_To_v1_LoftUpgradeStatus(in, out, s) } +func autoConvert_v1_MaintenanceWindow_To_management_MaintenanceWindow(in *MaintenanceWindow, out *management.MaintenanceWindow, s conversion.Scope) error { + out.DayOfWeek = in.DayOfWeek + out.TimeWindow = in.TimeWindow + return nil +} + +// Convert_v1_MaintenanceWindow_To_management_MaintenanceWindow is an autogenerated conversion function. +func Convert_v1_MaintenanceWindow_To_management_MaintenanceWindow(in *MaintenanceWindow, out *management.MaintenanceWindow, s conversion.Scope) error { + return autoConvert_v1_MaintenanceWindow_To_management_MaintenanceWindow(in, out, s) +} + +func autoConvert_management_MaintenanceWindow_To_v1_MaintenanceWindow(in *management.MaintenanceWindow, out *MaintenanceWindow, s conversion.Scope) error { + out.DayOfWeek = in.DayOfWeek + out.TimeWindow = in.TimeWindow + return nil +} + +// Convert_management_MaintenanceWindow_To_v1_MaintenanceWindow is an autogenerated conversion function. +func Convert_management_MaintenanceWindow_To_v1_MaintenanceWindow(in *management.MaintenanceWindow, out *MaintenanceWindow, s conversion.Scope) error { + return autoConvert_management_MaintenanceWindow_To_v1_MaintenanceWindow(in, out, s) +} + func autoConvert_v1_OIDC_To_management_OIDC(in *OIDC, out *management.OIDC, s conversion.Scope) error { out.Enabled = in.Enabled out.WildcardRedirect = in.WildcardRedirect diff --git a/pkg/apis/management/v1/zz_generated.deepcopy.go b/pkg/apis/management/v1/zz_generated.deepcopy.go index d1b05f3..7476a60 100644 --- a/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -995,6 +995,23 @@ func (in *BackupStatus) DeepCopy() *BackupStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cloud) DeepCopyInto(out *Cloud) { + *out = *in + out.MaintenanceWindow = in.MaintenanceWindow + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cloud. +func (in *Cloud) DeepCopy() *Cloud { + if in == nil { + return nil + } + out := new(Cloud) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in @@ -2011,6 +2028,11 @@ func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus) { *out = new(storagev1.VaultIntegrationSpec) (*in).DeepCopyInto(*out) } + if in.Cloud != nil { + in, out := &in.Cloud, &out.Cloud + *out = new(Cloud) + **out = **in + } return } @@ -3730,6 +3752,22 @@ func (in *LoftUpgradeStatus) DeepCopy() *LoftUpgradeStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceWindow) DeepCopyInto(out *MaintenanceWindow) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceWindow. +func (in *MaintenanceWindow) DeepCopy() *MaintenanceWindow { + if in == nil { + return nil + } + out := new(MaintenanceWindow) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OIDC) DeepCopyInto(out *OIDC) { *out = *in diff --git a/pkg/apis/management/zz_generated.api.register.go b/pkg/apis/management/zz_generated.api.register.go index 4c757f5..2fbd630 100644 --- a/pkg/apis/management/zz_generated.api.register.go +++ b/pkg/apis/management/zz_generated.api.register.go @@ -1632,6 +1632,11 @@ type BackupStatus struct { RawBackup string `json:"rawBackup,omitempty"` } +type Cloud struct { + ReleaseChannel string `json:"releaseChannel,omitempty"` + MaintenanceWindow MaintenanceWindow `json:"maintenanceWindow,omitempty"` +} + // +genclient // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -1815,6 +1820,7 @@ type ConfigStatus struct { UISettings *uiv1.UISettingsConfig `json:"uiSettings,omitempty"` VaultIntegration *storagev1.VaultIntegrationSpec `json:"vault,omitempty"` DisableConfigEndpoint bool `json:"disableConfigEndpoint,omitempty"` + Cloud *Cloud `json:"cloud,omitempty"` } type Connector struct { @@ -2065,7 +2071,7 @@ type KioskStatus struct { } // +genclient -// +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type License struct { @@ -2141,6 +2147,11 @@ type LoftUpgradeSpec struct { type LoftUpgradeStatus struct { } +type MaintenanceWindow struct { + DayOfWeek string `json:"dayOfWeek,omitempty"` + TimeWindow string `json:"timeWindow,omitempty"` +} + type OIDC struct { Enabled bool `json:"enabled,omitempty"` WildcardRedirect bool `json:"wildcardRedirect,omitempty"` diff --git a/pkg/apis/management/zz_generated.deepcopy.go b/pkg/apis/management/zz_generated.deepcopy.go index 2dd0f50..1e201a8 100644 --- a/pkg/apis/management/zz_generated.deepcopy.go +++ b/pkg/apis/management/zz_generated.deepcopy.go @@ -970,6 +970,23 @@ func (in *BackupStatus) DeepCopy() *BackupStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cloud) DeepCopyInto(out *Cloud) { + *out = *in + out.MaintenanceWindow = in.MaintenanceWindow + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cloud. +func (in *Cloud) DeepCopy() *Cloud { + if in == nil { + return nil + } + out := new(Cloud) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Cluster) DeepCopyInto(out *Cluster) { *out = *in @@ -1986,6 +2003,11 @@ func (in *ConfigStatus) DeepCopyInto(out *ConfigStatus) { *out = new(storagev1.VaultIntegrationSpec) (*in).DeepCopyInto(*out) } + if in.Cloud != nil { + in, out := &in.Cloud, &out.Cloud + *out = new(Cloud) + **out = **in + } return } @@ -3689,6 +3711,22 @@ func (in *LoftUpgradeStatus) DeepCopy() *LoftUpgradeStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceWindow) DeepCopyInto(out *MaintenanceWindow) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceWindow. +func (in *MaintenanceWindow) DeepCopy() *MaintenanceWindow { + if in == nil { + return nil + } + out := new(MaintenanceWindow) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OIDC) DeepCopyInto(out *OIDC) { *out = *in diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index 2530d09..7582087 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -114,6 +114,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.BackupList": schema_pkg_apis_management_v1_BackupList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.BackupSpec": schema_pkg_apis_management_v1_BackupSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.BackupStatus": schema_pkg_apis_management_v1_BackupStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud": schema_pkg_apis_management_v1_Cloud(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.Cluster": schema_pkg_apis_management_v1_Cluster(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ClusterAccess": schema_pkg_apis_management_v1_ClusterAccess(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ClusterAccessKey": schema_pkg_apis_management_v1_ClusterAccessKey(ref), @@ -217,6 +218,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.LoftUpgradeList": schema_pkg_apis_management_v1_LoftUpgradeList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.LoftUpgradeSpec": schema_pkg_apis_management_v1_LoftUpgradeSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.LoftUpgradeStatus": schema_pkg_apis_management_v1_LoftUpgradeStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.MaintenanceWindow": schema_pkg_apis_management_v1_MaintenanceWindow(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDC": schema_pkg_apis_management_v1_OIDC(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDCClient": schema_pkg_apis_management_v1_OIDCClient(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDCClientList": schema_pkg_apis_management_v1_OIDCClientList(ref), @@ -6591,6 +6593,34 @@ func schema_pkg_apis_management_v1_BackupStatus(ref common.ReferenceCallback) co } } +func schema_pkg_apis_management_v1_Cloud(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "releaseChannel": { + SchemaProps: spec.SchemaProps{ + Description: "ReleaseChannel specifies the release channel for the cloud configuration. This can be used to determine which updates or versions are applied.", + Type: []string{"string"}, + Format: "", + }, + }, + "maintenanceWindow": { + SchemaProps: spec.SchemaProps{ + Description: "MaintenanceWindow specifies the maintenance window for the cloud configuration. This is a structured representation of the time window during which maintenance can occur.", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.MaintenanceWindow"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.MaintenanceWindow"}, + } +} + func schema_pkg_apis_management_v1_Cluster(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -8416,11 +8446,17 @@ func schema_pkg_apis_management_v1_ConfigStatus(ref common.ReferenceCallback) co Format: "", }, }, + "cloud": { + SchemaProps: spec.SchemaProps{ + Description: "Cloud holkds the settings to be used exclusively in vCluster Cloud based environments and deployments.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.Apps", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Audit", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Authentication", "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDC", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/ui/v1.UISettingsConfig"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.Apps", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Audit", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Authentication", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud", "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDC", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/ui/v1.UISettingsConfig"}, } } @@ -11378,6 +11414,32 @@ func schema_pkg_apis_management_v1_LoftUpgradeStatus(ref common.ReferenceCallbac } } +func schema_pkg_apis_management_v1_MaintenanceWindow(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "dayOfWeek": { + SchemaProps: spec.SchemaProps{ + Description: "DayOfWeek specifies the day of the week for the maintenance window. It should be a string representing the day, e.g., \"Monday\", \"Tuesday\", etc.", + Type: []string{"string"}, + Format: "", + }, + }, + "timeWindow": { + SchemaProps: spec.SchemaProps{ + Description: "TimeWindow specifies the time window for the maintenance. It should be a string representing the time range in 24-hour format, in UTC, e.g., \"02:00-03:00\".", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_management_v1_OIDC(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -29383,9 +29445,10 @@ func schema_k8sio_api_admissionregistration_v1_NamedRuleWithOperations(ref commo }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -29547,9 +29610,10 @@ func schema_k8sio_api_admissionregistration_v1_Rule(ref common.ReferenceCallback }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -29648,9 +29712,10 @@ func schema_k8sio_api_admissionregistration_v1_RuleWithOperations(ref common.Ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -31048,9 +31113,10 @@ func schema_k8sio_api_admissionregistration_v1beta1_NamedRuleWithOperations(ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, From edfe1d92cfdca4f9f150ecc956c94ff152864da5 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:37:12 +0000 Subject: [PATCH 04/11] [skip ci] repo-sync --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 15af1ea..c966b88 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 - github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 - github.com/loft-sh/agentapi/v4 v4.1.0-beta.1 + github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0 + github.com/loft-sh/agentapi/v4 v4.2.0-alpha.2 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 1529bf5..3ff820a 100644 --- a/go.sum +++ b/go.sum @@ -107,10 +107,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 h1:aqT1UeosCYB+3DEzfxW0evhcYHxhoBVAEWtkXLXFimI= -github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.1.0-beta.1 h1:+/gPF6NmlznxHReo/C1DqlV7pLv0Jh0+kp1V2Kw0SJY= -github.com/loft-sh/agentapi/v4 v4.1.0-beta.1/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k= +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.2.0-alpha.2 h1:pjFv8n2cahDrEZ2HEQROFcY256H8hsEheI1+r6rk+HQ= +github.com/loft-sh/agentapi/v4 v4.2.0-alpha.2/go.mod h1:yqbIMmyXqbzZcK0DlwldRLy0xb3lYnH4NoI3K+iETlM= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= From 7a25611a47c4e61ba9fca1d424f569dc36d27789 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:20:53 +0000 Subject: [PATCH 05/11] [skip ci] repo-sync --- go.mod | 2 +- go.sum | 4 +- .../install/zz_generated.api.register.go | 2 + .../v1/devpodenvironmenttemplate_types.go | 26 +- .../v1/devpodworkspacepreset_types.go | 51 ++ .../management/v1/project_templates_types.go | 3 + .../v1/zz_generated.api.register.go | 11 + .../management/v1/zz_generated.conversion.go | 134 ++++ .../management/v1/zz_generated.deepcopy.go | 134 +++- .../management/zz_generated.api.register.go | 166 +++- pkg/apis/management/zz_generated.deepcopy.go | 101 +++ .../v1/devpodenvironmenttemplate_types.go | 43 +- .../v1/devpodworkspaceinstance_types.go | 22 +- .../storage/v1/devpodworkspacepreset_types.go | 121 +++ pkg/apis/storage/v1/project_types.go | 12 + pkg/apis/storage/v1/zz_generated.deepcopy.go | 284 ++++++- pkg/apis/zz_generated.api.register.go | 1 + .../management/v1/devpodworkspacepreset.go | 53 ++ .../v1/fake/fake_devpodworkspacepreset.go | 122 +++ .../v1/fake/fake_management_client.go | 4 + .../management/v1/generated_expansion.go | 2 + .../typed/management/v1/management_client.go | 5 + .../typed/storage/v1/devpodworkspacepreset.go | 51 ++ .../v1/fake/fake_devpodworkspacepreset.go | 110 +++ .../storage/v1/fake/fake_storage_client.go | 4 + .../typed/storage/v1/generated_expansion.go | 2 + .../typed/storage/v1/storage_client.go | 5 + pkg/informers/externalversions/generic.go | 4 + .../management/v1/devpodworkspacepreset.go | 73 ++ .../management/v1/interface.go | 7 + .../storage/v1/devpodworkspacepreset.go | 73 ++ .../externalversions/storage/v1/interface.go | 7 + .../management/v1/devpodworkspacepreset.go | 32 + .../management/v1/expansion_generated.go | 4 + .../storage/v1/devpodworkspacepreset.go | 32 + pkg/listers/storage/v1/expansion_generated.go | 4 + pkg/openapi/zz_generated.openapi.go | 753 ++++++++++++++++-- 37 files changed, 2351 insertions(+), 113 deletions(-) create mode 100644 pkg/apis/management/v1/devpodworkspacepreset_types.go create mode 100644 pkg/apis/storage/v1/devpodworkspacepreset_types.go create mode 100644 pkg/clientset/versioned/typed/management/v1/devpodworkspacepreset.go create mode 100644 pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacepreset.go create mode 100644 pkg/clientset/versioned/typed/storage/v1/devpodworkspacepreset.go create mode 100644 pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacepreset.go create mode 100644 pkg/informers/externalversions/management/v1/devpodworkspacepreset.go create mode 100644 pkg/informers/externalversions/storage/v1/devpodworkspacepreset.go create mode 100644 pkg/listers/management/v1/devpodworkspacepreset.go create mode 100644 pkg/listers/storage/v1/devpodworkspacepreset.go diff --git a/go.mod b/go.mod index c966b88..9092aa3 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0 - github.com/loft-sh/agentapi/v4 v4.2.0-alpha.2 + github.com/loft-sh/agentapi/v4 v4.2.0-alpha.5 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 3ff820a..3f56f01 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 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.2.0-alpha.2 h1:pjFv8n2cahDrEZ2HEQROFcY256H8hsEheI1+r6rk+HQ= -github.com/loft-sh/agentapi/v4 v4.2.0-alpha.2/go.mod h1:yqbIMmyXqbzZcK0DlwldRLy0xb3lYnH4NoI3K+iETlM= +github.com/loft-sh/agentapi/v4 v4.2.0-alpha.5 h1:tyBxgUjW/JmV9CL4GxNBrLTPNcrd6r7jFmO+/wjHYTw= +github.com/loft-sh/agentapi/v4 v4.2.0-alpha.5/go.mod h1:yqbIMmyXqbzZcK0DlwldRLy0xb3lYnH4NoI3K+iETlM= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/pkg/apis/management/install/zz_generated.api.register.go b/pkg/apis/management/install/zz_generated.api.register.go index 6480568..f4ddc32 100644 --- a/pkg/apis/management/install/zz_generated.api.register.go +++ b/pkg/apis/management/install/zz_generated.api.register.go @@ -60,6 +60,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &management.DevPodWorkspaceInstanceState{}, &management.DevPodStopOptions{}, &management.DevPodUpOptions{}, + &management.DevPodWorkspacePreset{}, + &management.DevPodWorkspacePresetList{}, &management.DevPodWorkspaceTemplate{}, &management.DevPodWorkspaceTemplateList{}, &management.DirectClusterEndpointToken{}, diff --git a/pkg/apis/management/v1/devpodenvironmenttemplate_types.go b/pkg/apis/management/v1/devpodenvironmenttemplate_types.go index c61f336..b22464a 100644 --- a/pkg/apis/management/v1/devpodenvironmenttemplate_types.go +++ b/pkg/apis/management/v1/devpodenvironmenttemplate_types.go @@ -26,18 +26,17 @@ type DevPodEnvironmentTemplateSpec struct { storagev1.DevPodEnvironmentTemplateSpec `json:",inline"` } -// GitEnvironmentTemplate stores configuration of Git environment template source -type GitEnvironmentTemplate struct { - // Repository stores repository URL for Git environment spec source - Repository string `json:"repository"` - - // Revision stores revision to checkout in repository - // +optional - Revision string `json:"revision,omitempty"` - - // SubPath stores subpath within Repositor where environment spec is - // +optional - SubPath string `json:"subpath,omitempty"` +// DevPodEnvironmentTemplateStatus holds the status +type DevPodEnvironmentTemplateStatus struct{} + +func (a *DevPodEnvironmentTemplate) GetVersions() []storagev1.VersionAccessor { + var retVersions []storagev1.VersionAccessor + for _, v := range a.Spec.Versions { + b := v + retVersions = append(retVersions, &b) + } + + return retVersions } func (a *DevPodEnvironmentTemplate) GetOwner() *storagev1.UserOrTeam { @@ -55,6 +54,3 @@ func (a *DevPodEnvironmentTemplate) GetAccess() []storagev1.Access { func (a *DevPodEnvironmentTemplate) SetAccess(access []storagev1.Access) { a.Spec.Access = access } - -// DevPodEnvironmentTemplateStatus holds the status -type DevPodEnvironmentTemplateStatus struct{} diff --git a/pkg/apis/management/v1/devpodworkspacepreset_types.go b/pkg/apis/management/v1/devpodworkspacepreset_types.go new file mode 100644 index 0000000..45b1f91 --- /dev/null +++ b/pkg/apis/management/v1/devpodworkspacepreset_types.go @@ -0,0 +1,51 @@ +package v1 + +import ( + storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DevPodWorkspacePreset +// +k8s:openapi-gen=true +// +resource:path=devpodworkspacepresets,rest=DevPodWorkspacePresetREST +type DevPodWorkspacePreset struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec DevPodWorkspacePresetSpec `json:"spec,omitempty"` + Status DevPodWorkspacePresetStatus `json:"status,omitempty"` +} + +// DevPodWorkspacePresetSpec holds the specification +type DevPodWorkspacePresetSpec struct { + storagev1.DevPodWorkspacePresetSpec `json:",inline"` +} + +// DevPodWorkspacePresetSource +// +k8s:openapi-gen=true +type DevPodWorkspacePresetSource struct { + storagev1.DevPodWorkspacePresetSource `json:",inline"` +} + +func (a *DevPodWorkspacePreset) GetOwner() *storagev1.UserOrTeam { + return a.Spec.Owner +} + +func (a *DevPodWorkspacePreset) SetOwner(userOrTeam *storagev1.UserOrTeam) { + a.Spec.Owner = userOrTeam +} + +func (a *DevPodWorkspacePreset) GetAccess() []storagev1.Access { + return a.Spec.Access +} + +func (a *DevPodWorkspacePreset) SetAccess(access []storagev1.Access) { + a.Spec.Access = access +} + +// DevPodWorkspacePresetStatus holds the status +type DevPodWorkspacePresetStatus struct{} diff --git a/pkg/apis/management/v1/project_templates_types.go b/pkg/apis/management/v1/project_templates_types.go index 5c89410..6ea1539 100644 --- a/pkg/apis/management/v1/project_templates_types.go +++ b/pkg/apis/management/v1/project_templates_types.go @@ -32,6 +32,9 @@ type ProjectTemplates struct { // DevPodEnvironmentTemplates holds all the allowed environment templates DevPodEnvironmentTemplates []DevPodEnvironmentTemplate `json:"devPodEnvironmentTemplates,omitempty"` + // DevPodWorkspacePresets holds all the allowed workspace presets + DevPodWorkspacePresets []DevPodWorkspacePreset `json:"devPodWorkspacePresets,omitempty"` + // DefaultDevPodEnvironmentTemplate DefaultDevPodEnvironmentTemplate string `json:"defaultDevPodEnvironmentTemplate,omitempty"` } diff --git a/pkg/apis/management/v1/zz_generated.api.register.go b/pkg/apis/management/v1/zz_generated.api.register.go index de25538..6f1d2d3 100644 --- a/pkg/apis/management/v1/zz_generated.api.register.go +++ b/pkg/apis/management/v1/zz_generated.api.register.go @@ -51,6 +51,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &DevPodWorkspaceInstanceState{}, &DevPodStopOptions{}, &DevPodUpOptions{}, + &DevPodWorkspacePreset{}, + &DevPodWorkspacePresetList{}, &DevPodWorkspaceTemplate{}, &DevPodWorkspaceTemplateList{}, &DirectClusterEndpointToken{}, @@ -229,6 +231,7 @@ var ( func() runtime.Object { return &DevPodUpOptions{} }, // Register versioned resource nil, management.NewDevPodUpOptionsREST), + management.ManagementDevPodWorkspacePresetStorage, management.ManagementDevPodWorkspaceTemplateStorage, management.ManagementDirectClusterEndpointTokenStorage, management.ManagementEventStorage, @@ -637,6 +640,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/pkg/apis/management/v1/zz_generated.conversion.go b/pkg/apis/management/v1/zz_generated.conversion.go index 8bb4e68..225988f 100644 --- a/pkg/apis/management/v1/zz_generated.conversion.go +++ b/pkg/apis/management/v1/zz_generated.conversion.go @@ -1019,6 +1019,46 @@ func RegisterConversions(s *runtime.Scheme) error { }); 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 { @@ -5551,6 +5591,98 @@ func Convert_management_DevPodWorkspaceInstanceStatus_To_v1_DevPodWorkspaceInsta return autoConvert_management_DevPodWorkspaceInstanceStatus_To_v1_DevPodWorkspaceInstanceStatus(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 +7652,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 +7671,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/pkg/apis/management/v1/zz_generated.deepcopy.go b/pkg/apis/management/v1/zz_generated.deepcopy.go index 7476a60..13aaa5d 100644 --- a/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -2742,6 +2742,117 @@ 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 *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 +3234,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 +4969,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/pkg/apis/management/zz_generated.api.register.go b/pkg/apis/management/zz_generated.api.register.go index 2fbd630..902b93b 100644 --- a/pkg/apis/management/zz_generated.api.register.go +++ b/pkg/apis/management/zz_generated.api.register.go @@ -136,7 +136,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 @@ -698,7 +708,19 @@ var ( 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", @@ -1271,6 +1293,8 @@ var ( InternalDevPodWorkspaceInstanceStateREST, InternalDevPodStopOptionsREST, InternalDevPodUpOptionsREST, + InternalDevPodWorkspacePreset, + InternalDevPodWorkspacePresetStatus, InternalDevPodWorkspaceTemplate, InternalDevPodWorkspaceTemplateStatus, InternalDirectClusterEndpointToken, @@ -1948,6 +1972,24 @@ type DevPodWorkspaceInstanceStatus struct { // +genclient // +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 + type DevPodWorkspaceTemplate struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -2358,6 +2400,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"` } @@ -4270,6 +4313,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/pkg/apis/management/zz_generated.deepcopy.go b/pkg/apis/management/zz_generated.deepcopy.go index 1e201a8..ae1dfd1 100644 --- a/pkg/apis/management/zz_generated.deepcopy.go +++ b/pkg/apis/management/zz_generated.deepcopy.go @@ -2717,6 +2717,100 @@ 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 *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 +4927,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/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go b/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go index c2737ba..ed66c96 100644 --- a/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go +++ b/pkg/apis/storage/v1/devpodenvironmenttemplate_types.go @@ -15,7 +15,26 @@ type DevPodEnvironmentTemplate struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec DevPodEnvironmentTemplateSpec `json:"spec,omitempty"` + Spec DevPodEnvironmentTemplateSpec `json:"spec,omitempty"` + Status DevPodEnvironmentTemplateStatus `json:"status,omitempty"` +} + +// DevPodEnvironmentTemplateStatus holds the status +type DevPodEnvironmentTemplateStatus struct { +} + +func (a *DevPodEnvironmentTemplate) GetVersions() []VersionAccessor { + var retVersions []VersionAccessor + for _, v := range a.Spec.Versions { + b := v + retVersions = append(retVersions, &b) + } + + return retVersions +} + +func (a *DevPodEnvironmentTemplateVersion) GetVersion() string { + return a.Version } func (a *DevPodEnvironmentTemplate) GetOwner() *UserOrTeam { @@ -39,9 +58,9 @@ type DevPodEnvironmentTemplateSpec struct { // +optional DisplayName string `json:"displayName,omitempty"` - // Git holds configuration for git environment spec source + // Description describes the environment template // +optional - Git GitEnvironmentTemplate `json:"git,omitempty"` + Description string `json:"description,omitempty"` // Owner holds the owner of this object // +optional @@ -51,11 +70,25 @@ type DevPodEnvironmentTemplateSpec struct { // +optional Access []Access `json:"access,omitempty"` + // Template is the inline template to use for DevPod environments + // +optional + Template *DevPodEnvironmentTemplateDefinition `json:"template,omitempty"` + // Versions are different versions of the template that can be referenced as well // +optional Versions []DevPodEnvironmentTemplateVersion `json:"versions,omitempty"` } +type DevPodEnvironmentTemplateDefinition struct { + // Git holds configuration for git environment spec source + // +optional + Git *GitEnvironmentTemplate `json:"git,omitempty"` + + // Inline holds an inline devcontainer.json definition + // +optional + Inline string `json:"inline,omitempty"` +} + // GitEnvironmentTemplate stores configuration of Git environment template source type GitEnvironmentTemplate struct { // Repository stores repository URL for Git environment spec source @@ -75,9 +108,9 @@ type GitEnvironmentTemplate struct { } type DevPodEnvironmentTemplateVersion struct { - // Git holds the GitEnvironmentTemplate + // Template holds the environment template definition // +optional - Git GitEnvironmentTemplate `json:"git,omitempty"` + Template DevPodEnvironmentTemplateDefinition `json:"template,omitempty"` // Version is the version. Needs to be in X.X.X format. // +optional diff --git a/pkg/apis/storage/v1/devpodworkspaceinstance_types.go b/pkg/apis/storage/v1/devpodworkspaceinstance_types.go index 51e8fed..3063847 100644 --- a/pkg/apis/storage/v1/devpodworkspaceinstance_types.go +++ b/pkg/apis/storage/v1/devpodworkspaceinstance_types.go @@ -86,13 +86,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 +122,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 +143,10 @@ type RunnerRef struct { type EnvironmentRef struct { // Name is the name of DevPodEnvironmentTemplate this references Name string `json:"name"` + + // Version is the version of DevPodEnvironmentTemplate this references + // +optional + Version string `json:"version,omitempty"` } type DevPodWorkspaceInstanceStatus struct { diff --git a/pkg/apis/storage/v1/devpodworkspacepreset_types.go b/pkg/apis/storage/v1/devpodworkspacepreset_types.go new file mode 100644 index 0000000..4fff5fa --- /dev/null +++ b/pkg/apis/storage/v1/devpodworkspacepreset_types.go @@ -0,0 +1,121 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DevPodWorkspacePreset +// +k8s:openapi-gen=true +type DevPodWorkspacePreset struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec DevPodWorkspacePresetSpec `json:"spec,omitempty"` + Status DevPodWorkspacePresetStatus `json:"status,omitempty"` +} + +func (a *DevPodWorkspacePreset) GetOwner() *UserOrTeam { + return a.Spec.Owner +} + +func (a *DevPodWorkspacePreset) SetOwner(userOrTeam *UserOrTeam) { + a.Spec.Owner = userOrTeam +} + +func (a *DevPodWorkspacePreset) GetAccess() []Access { + return a.Spec.Access +} + +func (a *DevPodWorkspacePreset) SetAccess(access []Access) { + a.Spec.Access = access +} + +type DevPodWorkspacePresetSpec struct { + // DisplayName is the name that should be displayed in the UI + // +optional + DisplayName string `json:"displayName,omitempty"` + + // Source stores inline path of project source + Source *DevPodWorkspacePresetSource `json:"source"` + + // InfrastructureRef stores reference to DevPodWorkspaceTemplate to use + InfrastructureRef *TemplateRef `json:"infrastructureRef"` + + // EnvironmentRef stores reference to DevPodEnvironmentTemplate + // +optional + EnvironmentRef *EnvironmentRef `json:"environmentRef,omitempty"` + + // UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment + // +optional + UseProjectGitCredentials bool `json:"useProjectGitCredentials,omitempty"` + + // Owner holds the owner of this object + // +optional + Owner *UserOrTeam `json:"owner,omitempty"` + + // Access to the DevPod machine instance object itself + // +optional + Access []Access `json:"access,omitempty"` + + // Versions are different versions of the template that can be referenced as well + // +optional + Versions []DevPodWorkspacePresetVersion `json:"versions,omitempty"` +} + +type DevPodWorkspacePresetSource struct { + // Git stores path to git repo to use as workspace source + // +optional + Git string `json:"git,omitempty"` + + // Image stores container image to use as workspace source + // +optional + Image string `json:"image,omitempty"` +} + +type DevPodWorkspacePresetVersion struct { + // Version is the version. Needs to be in X.X.X format. + // +optional + Version string `json:"version,omitempty"` + + // Source stores inline path of project source + // +optional + Source *DevPodWorkspacePresetSource `json:"source,omitempty"` + + // InfrastructureRef stores reference to DevPodWorkspaceTemplate to use + // +optional + InfrastructureRef *TemplateRef `json:"infrastructureRef,omitempty"` + + // EnvironmentRef stores reference to DevPodEnvironmentTemplate + // +optional + EnvironmentRef *EnvironmentRef `json:"environmentRef,omitempty"` + + // UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment + // +optional + UseProjectGitCredentials bool `json:"useProjectGitCredentials,omitempty"` +} + +// DevPodWorkspacePresetStatus holds the status +type DevPodWorkspacePresetStatus struct { +} + +type WorkspaceRef struct { + // Name is the name of DevPodWorkspaceTemplate this references + Name string `json:"name"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// DevPodWorkspacePresetList contains a list of DevPodWorkspacePreset objects +type DevPodWorkspacePresetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DevPodWorkspacePreset `json:"items"` +} + +func init() { + SchemeBuilder.Register(&DevPodWorkspacePreset{}, &DevPodWorkspacePresetList{}) +} diff --git a/pkg/apis/storage/v1/project_types.go b/pkg/apis/storage/v1/project_types.go index 2fec41e..1cca19b 100644 --- a/pkg/apis/storage/v1/project_types.go +++ b/pkg/apis/storage/v1/project_types.go @@ -106,6 +106,10 @@ type ProjectSpec struct { // +optional RequireTemplate RequireTemplate `json:"requireTemplate,omitempty"` + // RequirePreset configures if a preset is required for instance creation. + // +optional + RequirePreset RequirePreset `json:"requirePreset,omitempty"` + // Members are the users and teams that are part of this project // +optional Members []Member `json:"members,omitempty"` @@ -142,6 +146,13 @@ type RequireTemplate struct { Disabled bool `json:"disabled,omitempty"` } +type RequirePreset struct { + // If true, all users within the project will not be allowed to create a new instance without a preset. + // By default, all users are allowed to create a new instance without a preset. + // +optional + Enabled bool `json:"disabled,omitempty"` +} + type NamespacePattern struct { // Space holds the namespace pattern to use for space instances // +optional @@ -165,6 +176,7 @@ var ( SpaceTemplateKind = "SpaceTemplate" VirtualClusterTemplateKind = "VirtualClusterTemplate" DevPodWorkspaceTemplateKind = "DevPodWorkspaceTemplate" + DevPodWorkspacePresetKind = "DevPodWorkspacePreset" ) type AllowedTemplate struct { diff --git a/pkg/apis/storage/v1/zz_generated.deepcopy.go b/pkg/apis/storage/v1/zz_generated.deepcopy.go index 7de9add..0412cfa 100644 --- a/pkg/apis/storage/v1/zz_generated.deepcopy.go +++ b/pkg/apis/storage/v1/zz_generated.deepcopy.go @@ -1447,6 +1447,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 +1469,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 +1526,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 +1538,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 +1563,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 +1754,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 +1845,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 @@ -2622,6 +2849,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 +2951,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 +3262,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 @@ -5132,6 +5392,22 @@ func (in *VirtualClusterTemplateVersion) DeepCopy() *VirtualClusterTemplateVersi return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkspaceRef) DeepCopyInto(out *WorkspaceRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceRef. +func (in *WorkspaceRef) DeepCopy() *WorkspaceRef { + if in == nil { + return nil + } + out := new(WorkspaceRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WorkspaceStatusResult) DeepCopyInto(out *WorkspaceStatusResult) { *out = *in diff --git a/pkg/apis/zz_generated.api.register.go b/pkg/apis/zz_generated.api.register.go index 3e4477a..00ba513 100644 --- a/pkg/apis/zz_generated.api.register.go +++ b/pkg/apis/zz_generated.api.register.go @@ -49,6 +49,7 @@ func GetManagementAPIBuilder() *builders.APIGroupBuilder { "Config", "ConvertVirtualClusterConfig", "DevPodEnvironmentTemplate", + "DevPodWorkspacePreset", "DevPodWorkspaceTemplate", "DirectClusterEndpointToken", "Event", diff --git a/pkg/clientset/versioned/typed/management/v1/devpodworkspacepreset.go b/pkg/clientset/versioned/typed/management/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..9877f62 --- /dev/null +++ b/pkg/clientset/versioned/typed/management/v1/devpodworkspacepreset.go @@ -0,0 +1,53 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + + v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" + scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// DevPodWorkspacePresetsGetter has a method to return a DevPodWorkspacePresetInterface. +// A group's client should implement this interface. +type DevPodWorkspacePresetsGetter interface { + DevPodWorkspacePresets() DevPodWorkspacePresetInterface +} + +// DevPodWorkspacePresetInterface has methods to work with DevPodWorkspacePreset resources. +type DevPodWorkspacePresetInterface interface { + Create(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.CreateOptions) (*v1.DevPodWorkspacePreset, error) + Update(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (*v1.DevPodWorkspacePreset, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (*v1.DevPodWorkspacePreset, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DevPodWorkspacePreset, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DevPodWorkspacePresetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspacePreset, err error) + DevPodWorkspacePresetExpansion +} + +// devPodWorkspacePresets implements DevPodWorkspacePresetInterface +type devPodWorkspacePresets struct { + *gentype.ClientWithList[*v1.DevPodWorkspacePreset, *v1.DevPodWorkspacePresetList] +} + +// newDevPodWorkspacePresets returns a DevPodWorkspacePresets +func newDevPodWorkspacePresets(c *ManagementV1Client) *devPodWorkspacePresets { + return &devPodWorkspacePresets{ + gentype.NewClientWithList[*v1.DevPodWorkspacePreset, *v1.DevPodWorkspacePresetList]( + "devpodworkspacepresets", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DevPodWorkspacePreset { return &v1.DevPodWorkspacePreset{} }, + func() *v1.DevPodWorkspacePresetList { return &v1.DevPodWorkspacePresetList{} }), + } +} diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacepreset.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacepreset.go new file mode 100644 index 0000000..6929b12 --- /dev/null +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspacepreset.go @@ -0,0 +1,122 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDevPodWorkspacePresets implements DevPodWorkspacePresetInterface +type FakeDevPodWorkspacePresets struct { + Fake *FakeManagementV1 +} + +var devpodworkspacepresetsResource = v1.SchemeGroupVersion.WithResource("devpodworkspacepresets") + +var devpodworkspacepresetsKind = v1.SchemeGroupVersion.WithKind("DevPodWorkspacePreset") + +// Get takes name of the devPodWorkspacePreset, and returns the corresponding devPodWorkspacePreset object, and an error if there is any. +func (c *FakeDevPodWorkspacePresets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(devpodworkspacepresetsResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// List takes label and field selectors, and returns the list of DevPodWorkspacePresets that match those selectors. +func (c *FakeDevPodWorkspacePresets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspacePresetList, err error) { + emptyResult := &v1.DevPodWorkspacePresetList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(devpodworkspacepresetsResource, devpodworkspacepresetsKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.DevPodWorkspacePresetList{ListMeta: obj.(*v1.DevPodWorkspacePresetList).ListMeta} + for _, item := range obj.(*v1.DevPodWorkspacePresetList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested devPodWorkspacePresets. +func (c *FakeDevPodWorkspacePresets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchActionWithOptions(devpodworkspacepresetsResource, opts)) +} + +// Create takes the representation of a devPodWorkspacePreset and creates it. Returns the server's representation of the devPodWorkspacePreset, and an error, if there is any. +func (c *FakeDevPodWorkspacePresets) Create(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.CreateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(devpodworkspacepresetsResource, devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// Update takes the representation of a devPodWorkspacePreset and updates it. Returns the server's representation of the devPodWorkspacePreset, and an error, if there is any. +func (c *FakeDevPodWorkspacePresets) Update(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(devpodworkspacepresetsResource, devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeDevPodWorkspacePresets) UpdateStatus(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(devpodworkspacepresetsResource, "status", devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// Delete takes name of the devPodWorkspacePreset and deletes it. Returns an error if one occurs. +func (c *FakeDevPodWorkspacePresets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(devpodworkspacepresetsResource, name, opts), &v1.DevPodWorkspacePreset{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDevPodWorkspacePresets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(devpodworkspacepresetsResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1.DevPodWorkspacePresetList{}) + return err +} + +// Patch applies the patch and returns the patched devPodWorkspacePreset. +func (c *FakeDevPodWorkspacePresets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(devpodworkspacepresetsResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_management_client.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_management_client.go index 6cccf41..942f0d6 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_management_client.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_management_client.go @@ -56,6 +56,10 @@ func (c *FakeManagementV1) DevPodWorkspaceInstances(namespace string) v1.DevPodW return &FakeDevPodWorkspaceInstances{c, namespace} } +func (c *FakeManagementV1) DevPodWorkspacePresets() v1.DevPodWorkspacePresetInterface { + return &FakeDevPodWorkspacePresets{c} +} + func (c *FakeManagementV1) DevPodWorkspaceTemplates() v1.DevPodWorkspaceTemplateInterface { return &FakeDevPodWorkspaceTemplates{c} } diff --git a/pkg/clientset/versioned/typed/management/v1/generated_expansion.go b/pkg/clientset/versioned/typed/management/v1/generated_expansion.go index f825564..d21459c 100644 --- a/pkg/clientset/versioned/typed/management/v1/generated_expansion.go +++ b/pkg/clientset/versioned/typed/management/v1/generated_expansion.go @@ -24,6 +24,8 @@ type DevPodEnvironmentTemplateExpansion interface{} type DevPodWorkspaceInstanceExpansion interface{} +type DevPodWorkspacePresetExpansion interface{} + type DevPodWorkspaceTemplateExpansion interface{} type DirectClusterEndpointTokenExpansion interface{} diff --git a/pkg/clientset/versioned/typed/management/v1/management_client.go b/pkg/clientset/versioned/typed/management/v1/management_client.go index be891c7..538a754 100644 --- a/pkg/clientset/versioned/typed/management/v1/management_client.go +++ b/pkg/clientset/versioned/typed/management/v1/management_client.go @@ -23,6 +23,7 @@ type ManagementV1Interface interface { ConvertVirtualClusterConfigsGetter DevPodEnvironmentTemplatesGetter DevPodWorkspaceInstancesGetter + DevPodWorkspacePresetsGetter DevPodWorkspaceTemplatesGetter DirectClusterEndpointTokensGetter EventsGetter @@ -102,6 +103,10 @@ func (c *ManagementV1Client) DevPodWorkspaceInstances(namespace string) DevPodWo return newDevPodWorkspaceInstances(c, namespace) } +func (c *ManagementV1Client) DevPodWorkspacePresets() DevPodWorkspacePresetInterface { + return newDevPodWorkspacePresets(c) +} + func (c *ManagementV1Client) DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInterface { return newDevPodWorkspaceTemplates(c) } diff --git a/pkg/clientset/versioned/typed/storage/v1/devpodworkspacepreset.go b/pkg/clientset/versioned/typed/storage/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..6be3081 --- /dev/null +++ b/pkg/clientset/versioned/typed/storage/v1/devpodworkspacepreset.go @@ -0,0 +1,51 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + + v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + scheme "github.com/loft-sh/api/v4/pkg/clientset/versioned/scheme" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// DevPodWorkspacePresetsGetter has a method to return a DevPodWorkspacePresetInterface. +// A group's client should implement this interface. +type DevPodWorkspacePresetsGetter interface { + DevPodWorkspacePresets() DevPodWorkspacePresetInterface +} + +// DevPodWorkspacePresetInterface has methods to work with DevPodWorkspacePreset resources. +type DevPodWorkspacePresetInterface interface { + Create(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.CreateOptions) (*v1.DevPodWorkspacePreset, error) + Update(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (*v1.DevPodWorkspacePreset, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DevPodWorkspacePreset, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DevPodWorkspacePresetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspacePreset, err error) + DevPodWorkspacePresetExpansion +} + +// devPodWorkspacePresets implements DevPodWorkspacePresetInterface +type devPodWorkspacePresets struct { + *gentype.ClientWithList[*v1.DevPodWorkspacePreset, *v1.DevPodWorkspacePresetList] +} + +// newDevPodWorkspacePresets returns a DevPodWorkspacePresets +func newDevPodWorkspacePresets(c *StorageV1Client) *devPodWorkspacePresets { + return &devPodWorkspacePresets{ + gentype.NewClientWithList[*v1.DevPodWorkspacePreset, *v1.DevPodWorkspacePresetList]( + "devpodworkspacepresets", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.DevPodWorkspacePreset { return &v1.DevPodWorkspacePreset{} }, + func() *v1.DevPodWorkspacePresetList { return &v1.DevPodWorkspacePresetList{} }), + } +} diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacepreset.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacepreset.go new file mode 100644 index 0000000..12467c2 --- /dev/null +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_devpodworkspacepreset.go @@ -0,0 +1,110 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDevPodWorkspacePresets implements DevPodWorkspacePresetInterface +type FakeDevPodWorkspacePresets struct { + Fake *FakeStorageV1 +} + +var devpodworkspacepresetsResource = v1.SchemeGroupVersion.WithResource("devpodworkspacepresets") + +var devpodworkspacepresetsKind = v1.SchemeGroupVersion.WithKind("DevPodWorkspacePreset") + +// Get takes name of the devPodWorkspacePreset, and returns the corresponding devPodWorkspacePreset object, and an error if there is any. +func (c *FakeDevPodWorkspacePresets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(devpodworkspacepresetsResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// List takes label and field selectors, and returns the list of DevPodWorkspacePresets that match those selectors. +func (c *FakeDevPodWorkspacePresets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DevPodWorkspacePresetList, err error) { + emptyResult := &v1.DevPodWorkspacePresetList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(devpodworkspacepresetsResource, devpodworkspacepresetsKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.DevPodWorkspacePresetList{ListMeta: obj.(*v1.DevPodWorkspacePresetList).ListMeta} + for _, item := range obj.(*v1.DevPodWorkspacePresetList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested devPodWorkspacePresets. +func (c *FakeDevPodWorkspacePresets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchActionWithOptions(devpodworkspacepresetsResource, opts)) +} + +// Create takes the representation of a devPodWorkspacePreset and creates it. Returns the server's representation of the devPodWorkspacePreset, and an error, if there is any. +func (c *FakeDevPodWorkspacePresets) Create(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.CreateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(devpodworkspacepresetsResource, devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// Update takes the representation of a devPodWorkspacePreset and updates it. Returns the server's representation of the devPodWorkspacePreset, and an error, if there is any. +func (c *FakeDevPodWorkspacePresets) Update(ctx context.Context, devPodWorkspacePreset *v1.DevPodWorkspacePreset, opts metav1.UpdateOptions) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(devpodworkspacepresetsResource, devPodWorkspacePreset, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} + +// Delete takes name of the devPodWorkspacePreset and deletes it. Returns an error if one occurs. +func (c *FakeDevPodWorkspacePresets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(devpodworkspacepresetsResource, name, opts), &v1.DevPodWorkspacePreset{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDevPodWorkspacePresets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(devpodworkspacepresetsResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1.DevPodWorkspacePresetList{}) + return err +} + +// Patch applies the patch and returns the patched devPodWorkspacePreset. +func (c *FakeDevPodWorkspacePresets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspacePreset, err error) { + emptyResult := &v1.DevPodWorkspacePreset{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(devpodworkspacepresetsResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspacePreset), err +} diff --git a/pkg/clientset/versioned/typed/storage/v1/fake/fake_storage_client.go b/pkg/clientset/versioned/typed/storage/v1/fake/fake_storage_client.go index 81d78c2..3f2e892 100644 --- a/pkg/clientset/versioned/typed/storage/v1/fake/fake_storage_client.go +++ b/pkg/clientset/versioned/typed/storage/v1/fake/fake_storage_client.go @@ -40,6 +40,10 @@ func (c *FakeStorageV1) DevPodWorkspaceInstances(namespace string) v1.DevPodWork return &FakeDevPodWorkspaceInstances{c, namespace} } +func (c *FakeStorageV1) DevPodWorkspacePresets() v1.DevPodWorkspacePresetInterface { + return &FakeDevPodWorkspacePresets{c} +} + func (c *FakeStorageV1) DevPodWorkspaceTemplates() v1.DevPodWorkspaceTemplateInterface { return &FakeDevPodWorkspaceTemplates{c} } diff --git a/pkg/clientset/versioned/typed/storage/v1/generated_expansion.go b/pkg/clientset/versioned/typed/storage/v1/generated_expansion.go index 6faed07..68e8095 100644 --- a/pkg/clientset/versioned/typed/storage/v1/generated_expansion.go +++ b/pkg/clientset/versioned/typed/storage/v1/generated_expansion.go @@ -16,6 +16,8 @@ type DevPodEnvironmentTemplateExpansion interface{} type DevPodWorkspaceInstanceExpansion interface{} +type DevPodWorkspacePresetExpansion interface{} + type DevPodWorkspaceTemplateExpansion interface{} type NetworkPeerExpansion interface{} diff --git a/pkg/clientset/versioned/typed/storage/v1/storage_client.go b/pkg/clientset/versioned/typed/storage/v1/storage_client.go index c360fa2..e3dbd35 100644 --- a/pkg/clientset/versioned/typed/storage/v1/storage_client.go +++ b/pkg/clientset/versioned/typed/storage/v1/storage_client.go @@ -19,6 +19,7 @@ type StorageV1Interface interface { ClusterRoleTemplatesGetter DevPodEnvironmentTemplatesGetter DevPodWorkspaceInstancesGetter + DevPodWorkspacePresetsGetter DevPodWorkspaceTemplatesGetter NetworkPeersGetter ProjectsGetter @@ -66,6 +67,10 @@ func (c *StorageV1Client) DevPodWorkspaceInstances(namespace string) DevPodWorks return newDevPodWorkspaceInstances(c, namespace) } +func (c *StorageV1Client) DevPodWorkspacePresets() DevPodWorkspacePresetInterface { + return newDevPodWorkspacePresets(c) +} + func (c *StorageV1Client) DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInterface { return newDevPodWorkspaceTemplates(c) } diff --git a/pkg/informers/externalversions/generic.go b/pkg/informers/externalversions/generic.go index 19bb27f..60138dd 100644 --- a/pkg/informers/externalversions/generic.go +++ b/pkg/informers/externalversions/generic.go @@ -61,6 +61,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Management().V1().DevPodEnvironmentTemplates().Informer()}, nil case v1.SchemeGroupVersion.WithResource("devpodworkspaceinstances"): return &genericInformer{resource: resource.GroupResource(), informer: f.Management().V1().DevPodWorkspaceInstances().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("devpodworkspacepresets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Management().V1().DevPodWorkspacePresets().Informer()}, nil case v1.SchemeGroupVersion.WithResource("devpodworkspacetemplates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Management().V1().DevPodWorkspaceTemplates().Informer()}, nil case v1.SchemeGroupVersion.WithResource("directclusterendpointtokens"): @@ -133,6 +135,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().DevPodEnvironmentTemplates().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("devpodworkspaceinstances"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().DevPodWorkspaceInstances().Informer()}, nil + case storagev1.SchemeGroupVersion.WithResource("devpodworkspacepresets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().DevPodWorkspacePresets().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("devpodworkspacetemplates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().DevPodWorkspaceTemplates().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("networkpeers"): diff --git a/pkg/informers/externalversions/management/v1/devpodworkspacepreset.go b/pkg/informers/externalversions/management/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..1150827 --- /dev/null +++ b/pkg/informers/externalversions/management/v1/devpodworkspacepreset.go @@ -0,0 +1,73 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + managementv1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" + versioned "github.com/loft-sh/api/v4/pkg/clientset/versioned" + internalinterfaces "github.com/loft-sh/api/v4/pkg/informers/externalversions/internalinterfaces" + v1 "github.com/loft-sh/api/v4/pkg/listers/management/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DevPodWorkspacePresetInformer provides access to a shared informer and lister for +// DevPodWorkspacePresets. +type DevPodWorkspacePresetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DevPodWorkspacePresetLister +} + +type devPodWorkspacePresetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDevPodWorkspacePresetInformer constructs a new informer for DevPodWorkspacePreset type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDevPodWorkspacePresetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDevPodWorkspacePresetInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDevPodWorkspacePresetInformer constructs a new informer for DevPodWorkspacePreset type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDevPodWorkspacePresetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ManagementV1().DevPodWorkspacePresets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ManagementV1().DevPodWorkspacePresets().Watch(context.TODO(), options) + }, + }, + &managementv1.DevPodWorkspacePreset{}, + resyncPeriod, + indexers, + ) +} + +func (f *devPodWorkspacePresetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDevPodWorkspacePresetInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *devPodWorkspacePresetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&managementv1.DevPodWorkspacePreset{}, f.defaultInformer) +} + +func (f *devPodWorkspacePresetInformer) Lister() v1.DevPodWorkspacePresetLister { + return v1.NewDevPodWorkspacePresetLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/management/v1/interface.go b/pkg/informers/externalversions/management/v1/interface.go index 38e860d..93aa6b1 100644 --- a/pkg/informers/externalversions/management/v1/interface.go +++ b/pkg/informers/externalversions/management/v1/interface.go @@ -30,6 +30,8 @@ type Interface interface { DevPodEnvironmentTemplates() DevPodEnvironmentTemplateInformer // DevPodWorkspaceInstances returns a DevPodWorkspaceInstanceInformer. DevPodWorkspaceInstances() DevPodWorkspaceInstanceInformer + // DevPodWorkspacePresets returns a DevPodWorkspacePresetInformer. + DevPodWorkspacePresets() DevPodWorkspacePresetInformer // DevPodWorkspaceTemplates returns a DevPodWorkspaceTemplateInformer. DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInformer // DirectClusterEndpointTokens returns a DirectClusterEndpointTokenInformer. @@ -154,6 +156,11 @@ func (v *version) DevPodWorkspaceInstances() DevPodWorkspaceInstanceInformer { return &devPodWorkspaceInstanceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// DevPodWorkspacePresets returns a DevPodWorkspacePresetInformer. +func (v *version) DevPodWorkspacePresets() DevPodWorkspacePresetInformer { + return &devPodWorkspacePresetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // DevPodWorkspaceTemplates returns a DevPodWorkspaceTemplateInformer. func (v *version) DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInformer { return &devPodWorkspaceTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/pkg/informers/externalversions/storage/v1/devpodworkspacepreset.go b/pkg/informers/externalversions/storage/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..2ed8915 --- /dev/null +++ b/pkg/informers/externalversions/storage/v1/devpodworkspacepreset.go @@ -0,0 +1,73 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + versioned "github.com/loft-sh/api/v4/pkg/clientset/versioned" + internalinterfaces "github.com/loft-sh/api/v4/pkg/informers/externalversions/internalinterfaces" + v1 "github.com/loft-sh/api/v4/pkg/listers/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DevPodWorkspacePresetInformer provides access to a shared informer and lister for +// DevPodWorkspacePresets. +type DevPodWorkspacePresetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DevPodWorkspacePresetLister +} + +type devPodWorkspacePresetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDevPodWorkspacePresetInformer constructs a new informer for DevPodWorkspacePreset type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDevPodWorkspacePresetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDevPodWorkspacePresetInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDevPodWorkspacePresetInformer constructs a new informer for DevPodWorkspacePreset type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDevPodWorkspacePresetInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().DevPodWorkspacePresets().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().DevPodWorkspacePresets().Watch(context.TODO(), options) + }, + }, + &storagev1.DevPodWorkspacePreset{}, + resyncPeriod, + indexers, + ) +} + +func (f *devPodWorkspacePresetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDevPodWorkspacePresetInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *devPodWorkspacePresetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&storagev1.DevPodWorkspacePreset{}, f.defaultInformer) +} + +func (f *devPodWorkspacePresetInformer) Lister() v1.DevPodWorkspacePresetLister { + return v1.NewDevPodWorkspacePresetLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/storage/v1/interface.go b/pkg/informers/externalversions/storage/v1/interface.go index d2f36b8..1c2b075 100644 --- a/pkg/informers/externalversions/storage/v1/interface.go +++ b/pkg/informers/externalversions/storage/v1/interface.go @@ -22,6 +22,8 @@ type Interface interface { DevPodEnvironmentTemplates() DevPodEnvironmentTemplateInformer // DevPodWorkspaceInstances returns a DevPodWorkspaceInstanceInformer. DevPodWorkspaceInstances() DevPodWorkspaceInstanceInformer + // DevPodWorkspacePresets returns a DevPodWorkspacePresetInformer. + DevPodWorkspacePresets() DevPodWorkspacePresetInformer // DevPodWorkspaceTemplates returns a DevPodWorkspaceTemplateInformer. DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInformer // NetworkPeers returns a NetworkPeerInformer. @@ -94,6 +96,11 @@ func (v *version) DevPodWorkspaceInstances() DevPodWorkspaceInstanceInformer { return &devPodWorkspaceInstanceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// DevPodWorkspacePresets returns a DevPodWorkspacePresetInformer. +func (v *version) DevPodWorkspacePresets() DevPodWorkspacePresetInformer { + return &devPodWorkspacePresetInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // DevPodWorkspaceTemplates returns a DevPodWorkspaceTemplateInformer. func (v *version) DevPodWorkspaceTemplates() DevPodWorkspaceTemplateInformer { return &devPodWorkspaceTemplateInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/pkg/listers/management/v1/devpodworkspacepreset.go b/pkg/listers/management/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..8a1b33e --- /dev/null +++ b/pkg/listers/management/v1/devpodworkspacepreset.go @@ -0,0 +1,32 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/loft-sh/api/v4/pkg/apis/management/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" +) + +// DevPodWorkspacePresetLister helps list DevPodWorkspacePresets. +// All objects returned here must be treated as read-only. +type DevPodWorkspacePresetLister interface { + // List lists all DevPodWorkspacePresets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DevPodWorkspacePreset, err error) + // Get retrieves the DevPodWorkspacePreset from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DevPodWorkspacePreset, error) + DevPodWorkspacePresetListerExpansion +} + +// devPodWorkspacePresetLister implements the DevPodWorkspacePresetLister interface. +type devPodWorkspacePresetLister struct { + listers.ResourceIndexer[*v1.DevPodWorkspacePreset] +} + +// NewDevPodWorkspacePresetLister returns a new DevPodWorkspacePresetLister. +func NewDevPodWorkspacePresetLister(indexer cache.Indexer) DevPodWorkspacePresetLister { + return &devPodWorkspacePresetLister{listers.New[*v1.DevPodWorkspacePreset](indexer, v1.Resource("devpodworkspacepreset"))} +} diff --git a/pkg/listers/management/v1/expansion_generated.go b/pkg/listers/management/v1/expansion_generated.go index 534e225..7870d44 100644 --- a/pkg/listers/management/v1/expansion_generated.go +++ b/pkg/listers/management/v1/expansion_generated.go @@ -50,6 +50,10 @@ type DevPodWorkspaceInstanceListerExpansion interface{} // DevPodWorkspaceInstanceNamespaceLister. type DevPodWorkspaceInstanceNamespaceListerExpansion interface{} +// DevPodWorkspacePresetListerExpansion allows custom methods to be added to +// DevPodWorkspacePresetLister. +type DevPodWorkspacePresetListerExpansion interface{} + // DevPodWorkspaceTemplateListerExpansion allows custom methods to be added to // DevPodWorkspaceTemplateLister. type DevPodWorkspaceTemplateListerExpansion interface{} diff --git a/pkg/listers/storage/v1/devpodworkspacepreset.go b/pkg/listers/storage/v1/devpodworkspacepreset.go new file mode 100644 index 0000000..ca47505 --- /dev/null +++ b/pkg/listers/storage/v1/devpodworkspacepreset.go @@ -0,0 +1,32 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" +) + +// DevPodWorkspacePresetLister helps list DevPodWorkspacePresets. +// All objects returned here must be treated as read-only. +type DevPodWorkspacePresetLister interface { + // List lists all DevPodWorkspacePresets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.DevPodWorkspacePreset, err error) + // Get retrieves the DevPodWorkspacePreset from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.DevPodWorkspacePreset, error) + DevPodWorkspacePresetListerExpansion +} + +// devPodWorkspacePresetLister implements the DevPodWorkspacePresetLister interface. +type devPodWorkspacePresetLister struct { + listers.ResourceIndexer[*v1.DevPodWorkspacePreset] +} + +// NewDevPodWorkspacePresetLister returns a new DevPodWorkspacePresetLister. +func NewDevPodWorkspacePresetLister(indexer cache.Indexer) DevPodWorkspacePresetLister { + return &devPodWorkspacePresetLister{listers.New[*v1.DevPodWorkspacePreset](indexer, v1.Resource("devpodworkspacepreset"))} +} diff --git a/pkg/listers/storage/v1/expansion_generated.go b/pkg/listers/storage/v1/expansion_generated.go index a609945..dd70675 100644 --- a/pkg/listers/storage/v1/expansion_generated.go +++ b/pkg/listers/storage/v1/expansion_generated.go @@ -34,6 +34,10 @@ type DevPodWorkspaceInstanceListerExpansion interface{} // DevPodWorkspaceInstanceNamespaceLister. type DevPodWorkspaceInstanceNamespaceListerExpansion interface{} +// DevPodWorkspacePresetListerExpansion allows custom methods to be added to +// DevPodWorkspacePresetLister. +type DevPodWorkspacePresetListerExpansion interface{} + // DevPodWorkspaceTemplateListerExpansion allows custom methods to be added to // DevPodWorkspaceTemplateLister. type DevPodWorkspaceTemplateListerExpansion interface{} diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index 7582087..24daa5d 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -176,6 +176,11 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceState(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceStateList": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStateList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceStatus": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset": schema_pkg_apis_management_v1_DevPodWorkspacePreset(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetList": schema_pkg_apis_management_v1_DevPodWorkspacePresetList(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSource": schema_pkg_apis_management_v1_DevPodWorkspacePresetSource(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSpec": schema_pkg_apis_management_v1_DevPodWorkspacePresetSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetStatus": schema_pkg_apis_management_v1_DevPodWorkspacePresetStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate": schema_pkg_apis_management_v1_DevPodWorkspaceTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateList": schema_pkg_apis_management_v1_DevPodWorkspaceTemplateList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplateSpec": schema_pkg_apis_management_v1_DevPodWorkspaceTemplateSpec(ref), @@ -192,7 +197,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.FeatureList": schema_pkg_apis_management_v1_FeatureList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.FeatureSpec": schema_pkg_apis_management_v1_FeatureSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.FeatureStatus": schema_pkg_apis_management_v1_FeatureStatus(ref), - "github.com/loft-sh/api/v4/pkg/apis/management/v1.GitEnvironmentTemplate": schema_pkg_apis_management_v1_GitEnvironmentTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.GroupResources": schema_pkg_apis_management_v1_GroupResources(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.IngressAuthToken": schema_pkg_apis_management_v1_IngressAuthToken(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.IngressAuthTokenList": schema_pkg_apis_management_v1_IngressAuthTokenList(ref), @@ -421,8 +425,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodCommandStopOptions": schema_pkg_apis_storage_v1_DevPodCommandStopOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodCommandUpOptions": schema_pkg_apis_storage_v1_DevPodCommandUpOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplate": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplate(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateDefinition(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateList": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateList(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateSpec": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateStatus": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion": schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateVersion(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec": schema_pkg_apis_storage_v1_DevPodProjectSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProviderOption": schema_pkg_apis_storage_v1_DevPodProviderOption(ref), @@ -433,6 +439,12 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceSpec": schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceStatus": schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceInstanceTemplateDefinition": schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceTemplateDefinition(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePreset": schema_pkg_apis_storage_v1_DevPodWorkspacePreset(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetList": schema_pkg_apis_storage_v1_DevPodWorkspacePresetList(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource": schema_pkg_apis_storage_v1_DevPodWorkspacePresetSource(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSpec": schema_pkg_apis_storage_v1_DevPodWorkspacePresetSpec(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetStatus": schema_pkg_apis_storage_v1_DevPodWorkspacePresetStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion": schema_pkg_apis_storage_v1_DevPodWorkspacePresetVersion(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceProvider": schema_pkg_apis_storage_v1_DevPodWorkspaceProvider(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplate": schema_pkg_apis_storage_v1_DevPodWorkspaceTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition": schema_pkg_apis_storage_v1_DevPodWorkspaceTemplateDefinition(ref), @@ -469,6 +481,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeerStatus": schema_pkg_apis_storage_v1_NetworkPeerStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ObjectsStatus": schema_pkg_apis_storage_v1_ObjectsStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PodSelector": schema_pkg_apis_storage_v1_PodSelector(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef": schema_pkg_apis_storage_v1_PresetRef(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Project": schema_pkg_apis_storage_v1_Project(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ProjectList": schema_pkg_apis_storage_v1_ProjectList(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ProjectSpec": schema_pkg_apis_storage_v1_ProjectSpec(ref), @@ -481,6 +494,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas": schema_pkg_apis_storage_v1_Quotas(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec": schema_pkg_apis_storage_v1_RancherIntegrationSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherProjectRef": schema_pkg_apis_storage_v1_RancherProjectRef(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset": schema_pkg_apis_storage_v1_RequirePreset(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate": schema_pkg_apis_storage_v1_RequireTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Runner": schema_pkg_apis_storage_v1_Runner(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerClusterRef": schema_pkg_apis_storage_v1_RunnerClusterRef(ref), @@ -559,6 +573,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VirtualClusterTemplateSpec": schema_pkg_apis_storage_v1_VirtualClusterTemplateSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VirtualClusterTemplateStatus": schema_pkg_apis_storage_v1_VirtualClusterTemplateStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VirtualClusterTemplateVersion": schema_pkg_apis_storage_v1_VirtualClusterTemplateVersion(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.WorkspaceRef": schema_pkg_apis_storage_v1_WorkspaceRef(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.WorkspaceStatusResult": schema_pkg_apis_storage_v1_WorkspaceStatusResult(ref), "github.com/loft-sh/api/v4/pkg/apis/ui/v1.NavBarButton": schema_pkg_apis_ui_v1_NavBarButton(ref), "github.com/loft-sh/api/v4/pkg/apis/ui/v1.UISettings": schema_pkg_apis_ui_v1_UISettings(ref), @@ -8931,11 +8946,11 @@ func schema_pkg_apis_management_v1_DevPodEnvironmentTemplateSpec(ref common.Refe Format: "", }, }, - "git": { + "description": { SchemaProps: spec.SchemaProps{ - Description: "Git holds configuration for git environment spec source", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"), + Description: "Description describes the environment template", + Type: []string{"string"}, + Format: "", }, }, "owner": { @@ -8958,6 +8973,12 @@ func schema_pkg_apis_management_v1_DevPodEnvironmentTemplateSpec(ref common.Refe }, }, }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the inline template to use for DevPod environments", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition"), + }, + }, "versions": { SchemaProps: spec.SchemaProps{ Description: "Versions are different versions of the template that can be referenced as well", @@ -8976,7 +8997,7 @@ func schema_pkg_apis_management_v1_DevPodEnvironmentTemplateSpec(ref common.Refe }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -9458,6 +9479,12 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceSpec(ref common.Refere Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), }, }, + "presetRef": { + SchemaProps: spec.SchemaProps{ + Description: "PresetRef holds the DevPodWorkspacePreset template reference", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef"), + }, + }, "templateRef": { SchemaProps: spec.SchemaProps{ Description: "TemplateRef holds the DevPod machine template reference", @@ -9467,7 +9494,6 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceSpec(ref common.Refere "environmentRef": { SchemaProps: spec.SchemaProps{ Description: "EnvironmentRef is the reference to DevPodEnvironmentTemplate that should be used", - Default: map[string]interface{}{}, Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), }, }, @@ -9516,7 +9542,7 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceSpec(ref common.Refere }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -9691,6 +9717,221 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStatus(ref common.Refe } } +func schema_pkg_apis_management_v1_DevPodWorkspacePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePreset", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSpec", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_management_v1_DevPodWorkspacePresetList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_management_v1_DevPodWorkspacePresetSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresetSource", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "git": { + SchemaProps: spec.SchemaProps{ + Description: "Git stores path to git repo to use as workspace source", + Type: []string{"string"}, + Format: "", + }, + }, + "image": { + SchemaProps: spec.SchemaProps{ + Description: "Image stores container image to use as workspace source", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_DevPodWorkspacePresetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresetSpec holds the specification", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "displayName": { + SchemaProps: spec.SchemaProps{ + Description: "DisplayName is the name that should be displayed in the UI", + Type: []string{"string"}, + Format: "", + }, + }, + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source stores inline path of project source", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource"), + }, + }, + "infrastructureRef": { + SchemaProps: spec.SchemaProps{ + Description: "InfrastructureRef stores reference to DevPodWorkspaceTemplate to use", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"), + }, + }, + "environmentRef": { + SchemaProps: spec.SchemaProps{ + Description: "EnvironmentRef stores reference to DevPodEnvironmentTemplate", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), + }, + }, + "useProjectGitCredentials": { + SchemaProps: spec.SchemaProps{ + Description: "UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment", + Type: []string{"boolean"}, + Format: "", + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Owner holds the owner of this object", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), + }, + }, + "access": { + SchemaProps: spec.SchemaProps{ + Description: "Access to the DevPod machine instance object itself", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access"), + }, + }, + }, + }, + }, + "versions": { + SchemaProps: spec.SchemaProps{ + Description: "Versions are different versions of the template that can be referenced as well", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion"), + }, + }, + }, + }, + }, + }, + Required: []string{"source", "infrastructureRef"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + } +} + +func schema_pkg_apis_management_v1_DevPodWorkspacePresetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresetStatus holds the status", + Type: []string{"object"}, + }, + }, + } +} + func schema_pkg_apis_management_v1_DevPodWorkspaceTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -10469,42 +10710,6 @@ func schema_pkg_apis_management_v1_FeatureStatus(ref common.ReferenceCallback) c } } -func schema_pkg_apis_management_v1_GitEnvironmentTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GitEnvironmentTemplate stores configuration of Git environment template source", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "repository": { - SchemaProps: spec.SchemaProps{ - Description: "Repository stores repository URL for Git environment spec source", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "revision": { - SchemaProps: spec.SchemaProps{ - Description: "Revision stores revision to checkout in repository", - Type: []string{"string"}, - Format: "", - }, - }, - "subpath": { - SchemaProps: spec.SchemaProps{ - Description: "SubPath stores subpath within Repositor where environment spec is", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"repository"}, - }, - }, - } -} - func schema_pkg_apis_management_v1_GroupResources(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -13275,6 +13480,13 @@ func schema_pkg_apis_management_v1_ProjectSpec(ref common.ReferenceCallback) com Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate"), }, }, + "requirePreset": { + SchemaProps: spec.SchemaProps{ + Description: "RequirePreset configures if a preset is required for instance creation.", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset"), + }, + }, "members": { SchemaProps: spec.SchemaProps{ Description: "Members are the users and teams that are part of this project", @@ -13337,7 +13549,7 @@ func schema_pkg_apis_management_v1_ProjectSpec(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedCluster", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedRunner", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ArgoIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedCluster", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedRunner", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ArgoIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec"}, } } @@ -13479,6 +13691,20 @@ func schema_pkg_apis_management_v1_ProjectTemplates(ref common.ReferenceCallback }, }, }, + "devPodWorkspacePresets": { + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresets holds all the allowed workspace presets", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset"), + }, + }, + }, + }, + }, "defaultDevPodEnvironmentTemplate": { SchemaProps: spec.SchemaProps{ Description: "DefaultDevPodEnvironmentTemplate", @@ -13490,7 +13716,7 @@ func schema_pkg_apis_management_v1_ProjectTemplates(ref common.ReferenceCallback }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodEnvironmentTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.SpaceTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodEnvironmentTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset", "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.SpaceTemplate", "github.com/loft-sh/api/v4/pkg/apis/management/v1.VirtualClusterTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -21636,11 +21862,44 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplate(ref common.ReferenceCa Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateSpec"), }, }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateStatus"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "git": { + SchemaProps: spec.SchemaProps{ + Description: "Git holds configuration for git environment spec source", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"), + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline holds an inline devcontainer.json definition", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"}, } } @@ -21706,11 +21965,11 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref common.Referen Format: "", }, }, - "git": { + "description": { SchemaProps: spec.SchemaProps{ - Description: "Git holds configuration for git environment spec source", - Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"), + Description: "Description describes the environment template", + Type: []string{"string"}, + Format: "", }, }, "owner": { @@ -21733,6 +21992,12 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref common.Referen }, }, }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the inline template to use for DevPod environments", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition"), + }, + }, "versions": { SchemaProps: spec.SchemaProps{ Description: "Versions are different versions of the template that can be referenced as well", @@ -21751,7 +22016,18 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateSpec(ref common.Referen }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodEnvironmentTemplateStatus holds the status", + Type: []string{"object"}, + }, + }, } } @@ -21761,11 +22037,11 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateVersion(ref common.Refe SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "git": { + "template": { SchemaProps: spec.SchemaProps{ - Description: "Git holds the GitEnvironmentTemplate", + Description: "Template holds the environment template definition", Default: map[string]interface{}{}, - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"), + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition"), }, }, "version": { @@ -21779,7 +22055,7 @@ func schema_pkg_apis_storage_v1_DevPodEnvironmentTemplateVersion(ref common.Refe }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.GitEnvironmentTemplate"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodEnvironmentTemplateDefinition"}, } } @@ -22024,6 +22300,12 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref common.Reference Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), }, }, + "presetRef": { + SchemaProps: spec.SchemaProps{ + Description: "PresetRef holds the DevPodWorkspacePreset template reference", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef"), + }, + }, "templateRef": { SchemaProps: spec.SchemaProps{ Description: "TemplateRef holds the DevPod machine template reference", @@ -22033,7 +22315,6 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref common.Reference "environmentRef": { SchemaProps: spec.SchemaProps{ Description: "EnvironmentRef is the reference to DevPodEnvironmentTemplate that should be used", - Default: map[string]interface{}{}, Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), }, }, @@ -22082,7 +22363,7 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceSpec(ref common.Reference }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplateDefinition", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RunnerRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -22182,6 +22463,266 @@ func schema_pkg_apis_storage_v1_DevPodWorkspaceInstanceTemplateDefinition(ref co } } +func schema_pkg_apis_storage_v1_DevPodWorkspacePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePreset", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresetList contains a list of DevPodWorkspacePreset objects", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePreset"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePreset", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "git": { + SchemaProps: spec.SchemaProps{ + Description: "Git stores path to git repo to use as workspace source", + Type: []string{"string"}, + Format: "", + }, + }, + "image": { + SchemaProps: spec.SchemaProps{ + Description: "Image stores container image to use as workspace source", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "displayName": { + SchemaProps: spec.SchemaProps{ + Description: "DisplayName is the name that should be displayed in the UI", + Type: []string{"string"}, + Format: "", + }, + }, + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source stores inline path of project source", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource"), + }, + }, + "infrastructureRef": { + SchemaProps: spec.SchemaProps{ + Description: "InfrastructureRef stores reference to DevPodWorkspaceTemplate to use", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"), + }, + }, + "environmentRef": { + SchemaProps: spec.SchemaProps{ + Description: "EnvironmentRef stores reference to DevPodEnvironmentTemplate", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), + }, + }, + "useProjectGitCredentials": { + SchemaProps: spec.SchemaProps{ + Description: "UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment", + Type: []string{"boolean"}, + Format: "", + }, + }, + "owner": { + SchemaProps: spec.SchemaProps{ + Description: "Owner holds the owner of this object", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"), + }, + }, + "access": { + SchemaProps: spec.SchemaProps{ + Description: "Access to the DevPod machine instance object itself", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access"), + }, + }, + }, + }, + }, + "versions": { + SchemaProps: spec.SchemaProps{ + Description: "Versions are different versions of the template that can be referenced as well", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion"), + }, + }, + }, + }, + }, + }, + Required: []string{"source", "infrastructureRef"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetVersion", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DevPodWorkspacePresetStatus holds the status", + Type: []string{"object"}, + }, + }, + } +} + +func schema_pkg_apis_storage_v1_DevPodWorkspacePresetVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version is the version. Needs to be in X.X.X format.", + Type: []string{"string"}, + Format: "", + }, + }, + "source": { + SchemaProps: spec.SchemaProps{ + Description: "Source stores inline path of project source", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource"), + }, + }, + "infrastructureRef": { + SchemaProps: spec.SchemaProps{ + Description: "InfrastructureRef stores reference to DevPodWorkspaceTemplate to use", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"), + }, + }, + "environmentRef": { + SchemaProps: spec.SchemaProps{ + Description: "EnvironmentRef stores reference to DevPodEnvironmentTemplate", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef"), + }, + }, + "useProjectGitCredentials": { + SchemaProps: spec.SchemaProps{ + Description: "UseProjectGitCredentials specifies if the project git credentials should be used instead of local ones for this environment", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspacePresetSource", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.EnvironmentRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.TemplateRef"}, + } +} + func schema_pkg_apis_storage_v1_DevPodWorkspaceProvider(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -22673,6 +23214,13 @@ func schema_pkg_apis_storage_v1_EnvironmentRef(ref common.ReferenceCallback) com Format: "", }, }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version is the version of DevPodEnvironmentTemplate this references", + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"name"}, }, @@ -23954,6 +24502,34 @@ func schema_pkg_apis_storage_v1_PodSelector(ref common.ReferenceCallback) common } } +func schema_pkg_apis_storage_v1_PresetRef(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of DevPodWorkspacePreset", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version holds the preset version to use. Version is expected to be in semantic versioning format. Alternatively, you can also exchange major, minor or patch with an 'x' to tell Loft to automatically select the latest major, minor or patch version.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + func schema_pkg_apis_storage_v1_Project(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -24132,6 +24708,13 @@ func schema_pkg_apis_storage_v1_ProjectSpec(ref common.ReferenceCallback) common Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate"), }, }, + "requirePreset": { + SchemaProps: spec.SchemaProps{ + Description: "RequirePreset configures if a preset is required for instance creation.", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset"), + }, + }, "members": { SchemaProps: spec.SchemaProps{ Description: "Members are the users and teams that are part of this project", @@ -24194,7 +24777,7 @@ func schema_pkg_apis_storage_v1_ProjectSpec(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedCluster", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedRunner", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ArgoIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedCluster", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedRunner", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.AllowedTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ArgoIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodProjectSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Quotas", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RancherIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequirePreset", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.RequireTemplate", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec"}, } } @@ -24571,6 +25154,25 @@ func schema_pkg_apis_storage_v1_RancherProjectRef(ref common.ReferenceCallback) } } +func schema_pkg_apis_storage_v1_RequirePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "disabled": { + SchemaProps: spec.SchemaProps{ + Description: "If true, all users within the project will not be allowed to create a new instance without a preset. By default, all users are allowed to create a new instance without a preset.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_storage_v1_RequireTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -28336,6 +28938,27 @@ func schema_pkg_apis_storage_v1_VirtualClusterTemplateVersion(ref common.Referen } } +func schema_pkg_apis_storage_v1_WorkspaceRef(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of DevPodWorkspaceTemplate this references", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + func schema_pkg_apis_storage_v1_WorkspaceStatusResult(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -29445,10 +30068,9 @@ func schema_k8sio_api_admissionregistration_v1_NamedRuleWithOperations(ref commo }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -29610,10 +30232,9 @@ func schema_k8sio_api_admissionregistration_v1_Rule(ref common.ReferenceCallback }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -29712,10 +30333,9 @@ func schema_k8sio_api_admissionregistration_v1_RuleWithOperations(ref common.Ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -31113,10 +31733,9 @@ func schema_k8sio_api_admissionregistration_v1beta1_NamedRuleWithOperations(ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", Type: []string{"string"}, Format: "", - Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, From 6e8daf3fbcb7f97576d2c40a08fab56a66d4f679 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:07:36 +0000 Subject: [PATCH 06/11] [skip ci] repo-sync --- go.mod | 2 +- go.sum | 4 +- .../install/zz_generated.api.register.go | 1 + ...podworkspaceinstance_troubleshoot_types.go | 41 +++++ .../v1/devpodworkspaceinstance_types.go | 1 + .../v1/zz_generated.api.register.go | 14 ++ .../management/v1/zz_generated.conversion.go | 75 ++++++++ .../management/v1/zz_generated.deepcopy.go | 89 ++++++++++ .../management/v1/zz_generated.defaults.go | 163 ++++++++++++++++++ .../management/zz_generated.api.register.go | 35 +++- pkg/apis/management/zz_generated.deepcopy.go | 89 ++++++++++ pkg/apis/management/zz_generated.defaults.go | 163 ++++++++++++++++++ .../v1/devpodworkspaceinstance_types.go | 4 + pkg/openapi/zz_generated.openapi.go | 146 ++++++++++++++++ 14 files changed, 822 insertions(+), 5 deletions(-) create mode 100644 pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go diff --git a/go.mod b/go.mod index 9092aa3..d959ab3 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0 - github.com/loft-sh/agentapi/v4 v4.2.0-alpha.5 + github.com/loft-sh/agentapi/v4 v4.2.0-alpha.6 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 3f56f01..ed77eb0 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 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.2.0-alpha.5 h1:tyBxgUjW/JmV9CL4GxNBrLTPNcrd6r7jFmO+/wjHYTw= -github.com/loft-sh/agentapi/v4 v4.2.0-alpha.5/go.mod h1:yqbIMmyXqbzZcK0DlwldRLy0xb3lYnH4NoI3K+iETlM= +github.com/loft-sh/agentapi/v4 v4.2.0-alpha.6 h1:eVIzaW+EvIygxNXl5163c1+WcUr8c95OP6lj8FcJHUc= +github.com/loft-sh/agentapi/v4 v4.2.0-alpha.6/go.mod h1:yqbIMmyXqbzZcK0DlwldRLy0xb3lYnH4NoI3K+iETlM= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/pkg/apis/management/install/zz_generated.api.register.go b/pkg/apis/management/install/zz_generated.api.register.go index f4ddc32..0c6d75e 100644 --- a/pkg/apis/management/install/zz_generated.api.register.go +++ b/pkg/apis/management/install/zz_generated.api.register.go @@ -59,6 +59,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &management.DevPodSshOptions{}, &management.DevPodWorkspaceInstanceState{}, &management.DevPodStopOptions{}, + &management.DevPodWorkspaceInstanceTroubleshoot{}, &management.DevPodUpOptions{}, &management.DevPodWorkspacePreset{}, &management.DevPodWorkspacePresetList{}, diff --git a/pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go b/pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go new file mode 100644 index 0000000..33edb58 --- /dev/null +++ b/pkg/apis/management/v1/devpodworkspaceinstance_troubleshoot_types.go @@ -0,0 +1,41 @@ +package v1 + +import ( + storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// +subresource-request +type DevPodWorkspaceInstanceTroubleshoot struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // State holds the workspaces state as given by 'devpod export' + // +optional + State string `json:"state,omitempty"` + + // Workspace holds the workspace's instance object data + // +optional + Workspace *DevPodWorkspaceInstance `json:"workspace,omitempty"` + + // Template holds the workspace instance's template used to create it. + // This is the raw template, not the rendered one. + // +optional + Template *storagev1.DevPodWorkspaceTemplate `json:"template,omitempty"` + + // Pods is a list of pod objects that are linked to the workspace. + // +optional + Pods []corev1.Pod `json:"pods,omitempty"` + + // PVCs is a list of PVC objects that are linked to the workspace. + // +optional + PVCs []corev1.PersistentVolumeClaim `json:"pvcs,omitempty"` + + // Errors is a list of errors that occurred while trying to collect + // informations for troubleshooting. + // +optional + Errors []string `json:"errors,omitempty"` +} diff --git a/pkg/apis/management/v1/devpodworkspaceinstance_types.go b/pkg/apis/management/v1/devpodworkspaceinstance_types.go index a77b549..eed9e59 100644 --- a/pkg/apis/management/v1/devpodworkspaceinstance_types.go +++ b/pkg/apis/management/v1/devpodworkspaceinstance_types.go @@ -22,6 +22,7 @@ import ( // +subresource:request=DevPodStopOptions,path=stop,kind=DevPodStopOptions,rest=DevPodStopOptionsREST // +subresource:request=DevPodStatusOptions,path=getstatus,kind=DevPodStatusOptions,rest=DevPodStatusOptionsREST // +subresource:request=DevPodWorkspaceInstanceState,path=state,kind=DevPodWorkspaceInstanceState,rest=DevPodWorkspaceInstanceStateREST +// +subresource:request=DevPodWorkspaceInstanceTroubleshoot,path=troubleshoot,kind=DevPodWorkspaceInstanceTroubleshoot,rest=DevPodWorkspaceInstanceTroubleshootREST type DevPodWorkspaceInstance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/management/v1/zz_generated.api.register.go b/pkg/apis/management/v1/zz_generated.api.register.go index 6f1d2d3..338ceda 100644 --- a/pkg/apis/management/v1/zz_generated.api.register.go +++ b/pkg/apis/management/v1/zz_generated.api.register.go @@ -50,6 +50,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &DevPodSshOptions{}, &DevPodWorkspaceInstanceState{}, &DevPodStopOptions{}, + &DevPodWorkspaceInstanceTroubleshoot{}, &DevPodUpOptions{}, &DevPodWorkspacePreset{}, &DevPodWorkspacePresetList{}, @@ -226,6 +227,11 @@ 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 @@ -632,6 +638,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"` diff --git a/pkg/apis/management/v1/zz_generated.conversion.go b/pkg/apis/management/v1/zz_generated.conversion.go index 225988f..07aabbe 100644 --- a/pkg/apis/management/v1/zz_generated.conversion.go +++ b/pkg/apis/management/v1/zz_generated.conversion.go @@ -16,6 +16,7 @@ import ( management "github.com/loft-sh/api/v4/pkg/apis/management" storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" uiv1 "github.com/loft-sh/api/v4/pkg/apis/ui/v1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" @@ -1019,6 +1020,26 @@ 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 { @@ -5591,6 +5612,60 @@ 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 { diff --git a/pkg/apis/management/v1/zz_generated.deepcopy.go b/pkg/apis/management/v1/zz_generated.deepcopy.go index 13aaa5d..5bebc5a 100644 --- a/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -12,6 +12,7 @@ import ( auditv1 "github.com/loft-sh/api/v4/pkg/apis/audit/v1" storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" uiv1 "github.com/loft-sh/api/v4/pkg/apis/ui/v1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -2742,6 +2743,94 @@ 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 diff --git a/pkg/apis/management/v1/zz_generated.defaults.go b/pkg/apis/management/v1/zz_generated.defaults.go index d7e4331..dcd0a96 100644 --- a/pkg/apis/management/v1/zz_generated.defaults.go +++ b/pkg/apis/management/v1/zz_generated.defaults.go @@ -14,6 +14,12 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&DevPodWorkspaceInstanceTroubleshoot{}, func(obj interface{}) { + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(obj.(*DevPodWorkspaceInstanceTroubleshoot)) + }) + scheme.AddTypeDefaultingFunc(&DevPodWorkspaceInstanceTroubleshootList{}, func(obj interface{}) { + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshootList(obj.(*DevPodWorkspaceInstanceTroubleshootList)) + }) scheme.AddTypeDefaultingFunc(&ProjectClusters{}, func(obj interface{}) { SetObjectDefaults_ProjectClusters(obj.(*ProjectClusters)) }) scheme.AddTypeDefaultingFunc(&ProjectClustersList{}, func(obj interface{}) { SetObjectDefaults_ProjectClustersList(obj.(*ProjectClustersList)) }) scheme.AddTypeDefaultingFunc(&ProjectRunners{}, func(obj interface{}) { SetObjectDefaults_ProjectRunners(obj.(*ProjectRunners)) }) @@ -23,6 +29,163 @@ func RegisterDefaults(scheme *runtime.Scheme) error { return nil } +func SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(in *DevPodWorkspaceInstanceTroubleshoot) { + for i := range in.Pods { + a := &in.Pods[i] + for j := range a.Spec.Volumes { + b := &a.Spec.Volumes[j] + if b.VolumeSource.ISCSI != nil { + if b.VolumeSource.ISCSI.ISCSIInterface == "" { + b.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if b.VolumeSource.RBD != nil { + if b.VolumeSource.RBD.RBDPool == "" { + b.VolumeSource.RBD.RBDPool = "rbd" + } + if b.VolumeSource.RBD.RadosUser == "" { + b.VolumeSource.RBD.RadosUser = "admin" + } + if b.VolumeSource.RBD.Keyring == "" { + b.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if b.VolumeSource.AzureDisk != nil { + if b.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + b.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if b.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + b.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if b.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + b.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if b.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + b.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if b.VolumeSource.ScaleIO != nil { + if b.VolumeSource.ScaleIO.StorageMode == "" { + b.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if b.VolumeSource.ScaleIO.FSType == "" { + b.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + for j := range a.Spec.InitContainers { + b := &a.Spec.InitContainers[j] + for k := range b.Ports { + c := &b.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.LivenessProbe != nil { + if b.LivenessProbe.ProbeHandler.GRPC != nil { + if b.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.ReadinessProbe != nil { + if b.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.StartupProbe != nil { + if b.StartupProbe.ProbeHandler.GRPC != nil { + if b.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for j := range a.Spec.Containers { + b := &a.Spec.Containers[j] + for k := range b.Ports { + c := &b.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.LivenessProbe != nil { + if b.LivenessProbe.ProbeHandler.GRPC != nil { + if b.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.ReadinessProbe != nil { + if b.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.StartupProbe != nil { + if b.StartupProbe.ProbeHandler.GRPC != nil { + if b.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for j := range a.Spec.EphemeralContainers { + b := &a.Spec.EphemeralContainers[j] + for k := range b.EphemeralContainerCommon.Ports { + c := &b.EphemeralContainerCommon.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.EphemeralContainerCommon.LivenessProbe != nil { + if b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.EphemeralContainerCommon.ReadinessProbe != nil { + if b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.EphemeralContainerCommon.StartupProbe != nil { + if b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + } +} + +func SetObjectDefaults_DevPodWorkspaceInstanceTroubleshootList(in *DevPodWorkspaceInstanceTroubleshootList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(a) + } +} + func SetObjectDefaults_ProjectClusters(in *ProjectClusters) { for i := range in.Runners { a := &in.Runners[i] diff --git a/pkg/apis/management/zz_generated.api.register.go b/pkg/apis/management/zz_generated.api.register.go index 902b93b..1c1b28e 100644 --- a/pkg/apis/management/zz_generated.api.register.go +++ b/pkg/apis/management/zz_generated.api.register.go @@ -15,6 +15,7 @@ import ( "github.com/loft-sh/api/v4/pkg/managerfactory" "github.com/loft-sh/apiserver/pkg/builders" authorizationv1 "k8s.io/api/authorization/v1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/apis/meta/internalversion" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -700,8 +701,16 @@ 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{} }, ) @@ -1292,6 +1301,7 @@ var ( InternalDevPodSshOptionsREST, InternalDevPodWorkspaceInstanceStateREST, InternalDevPodStopOptionsREST, + InternalDevPodWorkspaceInstanceTroubleshootREST, InternalDevPodUpOptionsREST, InternalDevPodWorkspacePreset, InternalDevPodWorkspacePresetStatus, @@ -1968,6 +1978,19 @@ 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 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -4208,6 +4231,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"` diff --git a/pkg/apis/management/zz_generated.deepcopy.go b/pkg/apis/management/zz_generated.deepcopy.go index ae1dfd1..5da053f 100644 --- a/pkg/apis/management/zz_generated.deepcopy.go +++ b/pkg/apis/management/zz_generated.deepcopy.go @@ -12,6 +12,7 @@ import ( v1 "github.com/loft-sh/api/v4/pkg/apis/audit/v1" storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" uiv1 "github.com/loft-sh/api/v4/pkg/apis/ui/v1" + corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -2717,6 +2718,94 @@ 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 diff --git a/pkg/apis/management/zz_generated.defaults.go b/pkg/apis/management/zz_generated.defaults.go index 619605f..228a30c 100644 --- a/pkg/apis/management/zz_generated.defaults.go +++ b/pkg/apis/management/zz_generated.defaults.go @@ -14,6 +14,12 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&DevPodWorkspaceInstanceTroubleshoot{}, func(obj interface{}) { + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(obj.(*DevPodWorkspaceInstanceTroubleshoot)) + }) + scheme.AddTypeDefaultingFunc(&DevPodWorkspaceInstanceTroubleshootList{}, func(obj interface{}) { + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshootList(obj.(*DevPodWorkspaceInstanceTroubleshootList)) + }) scheme.AddTypeDefaultingFunc(&ProjectClusters{}, func(obj interface{}) { SetObjectDefaults_ProjectClusters(obj.(*ProjectClusters)) }) scheme.AddTypeDefaultingFunc(&ProjectClustersList{}, func(obj interface{}) { SetObjectDefaults_ProjectClustersList(obj.(*ProjectClustersList)) }) scheme.AddTypeDefaultingFunc(&ProjectRunners{}, func(obj interface{}) { SetObjectDefaults_ProjectRunners(obj.(*ProjectRunners)) }) @@ -23,6 +29,163 @@ func RegisterDefaults(scheme *runtime.Scheme) error { return nil } +func SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(in *DevPodWorkspaceInstanceTroubleshoot) { + for i := range in.Pods { + a := &in.Pods[i] + for j := range a.Spec.Volumes { + b := &a.Spec.Volumes[j] + if b.VolumeSource.ISCSI != nil { + if b.VolumeSource.ISCSI.ISCSIInterface == "" { + b.VolumeSource.ISCSI.ISCSIInterface = "default" + } + } + if b.VolumeSource.RBD != nil { + if b.VolumeSource.RBD.RBDPool == "" { + b.VolumeSource.RBD.RBDPool = "rbd" + } + if b.VolumeSource.RBD.RadosUser == "" { + b.VolumeSource.RBD.RadosUser = "admin" + } + if b.VolumeSource.RBD.Keyring == "" { + b.VolumeSource.RBD.Keyring = "/etc/ceph/keyring" + } + } + if b.VolumeSource.AzureDisk != nil { + if b.VolumeSource.AzureDisk.CachingMode == nil { + ptrVar1 := v1.AzureDataDiskCachingMode(v1.AzureDataDiskCachingReadWrite) + b.VolumeSource.AzureDisk.CachingMode = &ptrVar1 + } + if b.VolumeSource.AzureDisk.FSType == nil { + var ptrVar1 string = "ext4" + b.VolumeSource.AzureDisk.FSType = &ptrVar1 + } + if b.VolumeSource.AzureDisk.ReadOnly == nil { + var ptrVar1 bool = false + b.VolumeSource.AzureDisk.ReadOnly = &ptrVar1 + } + if b.VolumeSource.AzureDisk.Kind == nil { + ptrVar1 := v1.AzureDataDiskKind(v1.AzureSharedBlobDisk) + b.VolumeSource.AzureDisk.Kind = &ptrVar1 + } + } + if b.VolumeSource.ScaleIO != nil { + if b.VolumeSource.ScaleIO.StorageMode == "" { + b.VolumeSource.ScaleIO.StorageMode = "ThinProvisioned" + } + if b.VolumeSource.ScaleIO.FSType == "" { + b.VolumeSource.ScaleIO.FSType = "xfs" + } + } + } + for j := range a.Spec.InitContainers { + b := &a.Spec.InitContainers[j] + for k := range b.Ports { + c := &b.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.LivenessProbe != nil { + if b.LivenessProbe.ProbeHandler.GRPC != nil { + if b.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.ReadinessProbe != nil { + if b.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.StartupProbe != nil { + if b.StartupProbe.ProbeHandler.GRPC != nil { + if b.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for j := range a.Spec.Containers { + b := &a.Spec.Containers[j] + for k := range b.Ports { + c := &b.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.LivenessProbe != nil { + if b.LivenessProbe.ProbeHandler.GRPC != nil { + if b.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.ReadinessProbe != nil { + if b.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.StartupProbe != nil { + if b.StartupProbe.ProbeHandler.GRPC != nil { + if b.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + for j := range a.Spec.EphemeralContainers { + b := &a.Spec.EphemeralContainers[j] + for k := range b.EphemeralContainerCommon.Ports { + c := &b.EphemeralContainerCommon.Ports[k] + if c.Protocol == "" { + c.Protocol = "TCP" + } + } + if b.EphemeralContainerCommon.LivenessProbe != nil { + if b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.EphemeralContainerCommon.ReadinessProbe != nil { + if b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + if b.EphemeralContainerCommon.StartupProbe != nil { + if b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil { + if b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil { + var ptrVar1 string = "" + b.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 + } + } + } + } + } +} + +func SetObjectDefaults_DevPodWorkspaceInstanceTroubleshootList(in *DevPodWorkspaceInstanceTroubleshootList) { + for i := range in.Items { + a := &in.Items[i] + SetObjectDefaults_DevPodWorkspaceInstanceTroubleshoot(a) + } +} + func SetObjectDefaults_ProjectClusters(in *ProjectClusters) { for i := range in.Runners { a := &in.Runners[i] diff --git a/pkg/apis/storage/v1/devpodworkspaceinstance_types.go b/pkg/apis/storage/v1/devpodworkspaceinstance_types.go index 3063847..c6e86c3 100644 --- a/pkg/apis/storage/v1/devpodworkspaceinstance_types.go +++ b/pkg/apis/storage/v1/devpodworkspaceinstance_types.go @@ -17,6 +17,10 @@ var ( // DevPodWorkspaceUIDLabel holds the actual workspace uid of the devpod workspace DevPodWorkspaceUIDLabel = "loft.sh/workspace-uid" + // DevPodKubernetesProviderWorkspaceUIDLabel holds the actual workspace uid of the devpod workspace on resources + // created by the DevPod Kubernetes provider. + DevPodKubernetesProviderWorkspaceUIDLabel = "devpod.sh/workspace-uid" + // DevPodWorkspacePictureAnnotation holds the workspace picture url of the devpod workspace DevPodWorkspacePictureAnnotation = "loft.sh/workspace-picture" diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index 24daa5d..9ac4319 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -176,6 +176,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceState(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceStateList": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStateList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceStatus": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceTroubleshoot(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshootList": schema_pkg_apis_management_v1_DevPodWorkspaceInstanceTroubleshootList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePreset": schema_pkg_apis_management_v1_DevPodWorkspacePreset(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetList": schema_pkg_apis_management_v1_DevPodWorkspacePresetList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspacePresetSource": schema_pkg_apis_management_v1_DevPodWorkspacePresetSource(ref), @@ -9717,6 +9719,150 @@ func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceStatus(ref common.Refe } } +func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceTroubleshoot(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "state": { + SchemaProps: spec.SchemaProps{ + Description: "State holds the workspaces state as given by 'devpod export'", + Type: []string{"string"}, + Format: "", + }, + }, + "workspace": { + SchemaProps: spec.SchemaProps{ + Description: "Workspace holds the workspace's instance object data", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstance"), + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template holds the workspace instance's template used to create it. This is the raw template, not the rendered one.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplate"), + }, + }, + "pods": { + SchemaProps: spec.SchemaProps{ + Description: "Pods is a list of pod objects that are linked to the workspace.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.Pod"), + }, + }, + }, + }, + }, + "pvcs": { + SchemaProps: spec.SchemaProps{ + Description: "PVCs is a list of PVC objects that are linked to the workspace.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaim"), + }, + }, + }, + }, + }, + "errors": { + SchemaProps: spec.SchemaProps{ + Description: "Errors is a list of errors that occurred while trying to collect informations for troubleshooting.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstance", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.DevPodWorkspaceTemplate", "k8s.io/api/core/v1.PersistentVolumeClaim", "k8s.io/api/core/v1.Pod", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_management_v1_DevPodWorkspaceInstanceTroubleshootList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + func schema_pkg_apis_management_v1_DevPodWorkspacePreset(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ From a24d4104d586e7261007a7b9bf50b0b4a6c496c7 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Fri, 29 Nov 2024 07:49:10 +0000 Subject: [PATCH 07/11] [skip ci] repo-sync --- go.mod | 4 +- go.sum | 12 +- pkg/apis/management/v1/cluster_types.go | 11 +- pkg/apis/management/v1/config_types.go | 44 +++- .../v1/devpodworkspaceinstance_types.go | 1 + .../v1/zz_generated.api.register.go | 5 + .../management/v1/zz_generated.conversion.go | 106 ++++++++ .../management/v1/zz_generated.deepcopy.go | 92 ++++++- .../management/zz_generated.api.register.go | 26 +- pkg/apis/management/zz_generated.deepcopy.go | 92 ++++++- pkg/apis/storage/v1/cluster_types.go | 49 ++++ pkg/apis/storage/v1/zz_generated.deepcopy.go | 52 +++- .../management/v1/devpodworkspaceinstance.go | 15 ++ .../v1/fake/fake_devpodworkspaceinstance.go | 12 + pkg/openapi/zz_generated.openapi.go | 226 +++++++++++++++++- 15 files changed, 723 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index d959ab3..cc25fe1 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 - github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0 + github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 github.com/loft-sh/agentapi/v4 v4.2.0-alpha.6 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 @@ -61,7 +61,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect diff --git a/go.sum b/go.sum index ed77eb0..bd9ffab 100644 --- a/go.sum +++ b/go.sum @@ -107,10 +107,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/loft-sh/admin-apis v0.0.0-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.2.0-alpha.6 h1:eVIzaW+EvIygxNXl5163c1+WcUr8c95OP6lj8FcJHUc= -github.com/loft-sh/agentapi/v4 v4.2.0-alpha.6/go.mod h1:yqbIMmyXqbzZcK0DlwldRLy0xb3lYnH4NoI3K+iETlM= +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-alpha.6 h1:uwEMDiehtTJhRjE42HaaNT+7k6vBH6RMaZyn7UfQ0z8= +github.com/loft-sh/agentapi/v4 v4.2.0-alpha.6/go.mod h1:np3oo4gi1fYJvhXAYLk+SY6bVy2iqsxoAf8ebZNMnXU= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -135,8 +135,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA= diff --git a/pkg/apis/management/v1/cluster_types.go b/pkg/apis/management/v1/cluster_types.go index af31486..228c2f2 100644 --- a/pkg/apis/management/v1/cluster_types.go +++ b/pkg/apis/management/v1/cluster_types.go @@ -1,6 +1,7 @@ package v1 import ( + agentstoragev1 "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1" storagev1 "github.com/loft-sh/api/v4/pkg/apis/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -16,7 +17,7 @@ import ( // Cluster holds the cluster information // +k8s:openapi-gen=true -// +resource:path=clusters,rest=ClusterREST +// +resource:path=clusters,rest=ClusterREST,statusRest=ClusterStatusREST // +subresource:request=ClusterMemberAccess,path=memberaccess,kind=ClusterMemberAccess,rest=ClusterMemberAccessREST // +subresource:request=ClusterReset,path=reset,kind=ClusterReset,rest=ClusterResetREST // +subresource:request=ClusterDomain,path=domain,kind=ClusterDomain,rest=ClusterDomainREST @@ -63,3 +64,11 @@ func (a *Cluster) GetAccess() []storagev1.Access { func (a *Cluster) SetAccess(access []storagev1.Access) { a.Spec.Access = access } + +func (a *Cluster) GetConditions() agentstoragev1.Conditions { + return a.Status.Conditions +} + +func (a *Cluster) SetConditions(conditions agentstoragev1.Conditions) { + a.Status.Conditions = conditions +} diff --git a/pkg/apis/management/v1/config_types.go b/pkg/apis/management/v1/config_types.go index 3015b11..86a9e10 100644 --- a/pkg/apis/management/v1/config_types.go +++ b/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,42 @@ 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"` + + // GlobalMetrics are settings for the global metrics backend. This aggregates metrics for the Cost Control Dashboard + // across all connected clusters + GlobalMetrics *storagev1.Metrics `json:"globalMetrics,omitempty"` + + // ClusterMetrics are settings for each cluster's metrics backend. These settings apply all connected clusters + // unless overridden by modifying the Cluster's spec. + ClusterMetrics *storagev1.Metrics `json:"clusterMetrics,omitempty"` + + // Settings specify price-related settings that are taken into account for the ROI dashboard calculations. + Settings *CostControlSettings `json:"settings,omitempty"` +} + +type CostControlSettings struct { + // PriceCurrency specifies the currency. + PriceCurrency string `json:"priceCurrency,omitempty"` + + // AvgCPUPricePerNode specifies the average CPU price per node. + AvgCPUPricePerNode *CostControlResourcePrice `json:"averageCPUPricePerNode,omitempty"` + + // AvgRAMPricePerNode specifies the average RAM price per node. + AvgRAMPricePerNode *CostControlResourcePrice `json:"averageRAMPricePerNode,omitempty"` + + // ControlPlanePricePerCluster specifies the price of one physical cluster. + ControlPlanePricePerCluster *CostControlResourcePrice `json:"controlPlanePricePerCluster,omitempty"` +} + +type CostControlResourcePrice struct { + // Price specifies the price. + Price float64 `json:"price,omitempty"` + + // TimePeriod specifies the time period for the price. + TimePeriod string `json:"timePeriod,omitempty"` +} diff --git a/pkg/apis/management/v1/devpodworkspaceinstance_types.go b/pkg/apis/management/v1/devpodworkspaceinstance_types.go index eed9e59..08db551 100644 --- a/pkg/apis/management/v1/devpodworkspaceinstance_types.go +++ b/pkg/apis/management/v1/devpodworkspaceinstance_types.go @@ -11,6 +11,7 @@ import ( // +genclient:noStatus // +genclient:method=GetState,verb=get,subresource=state,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState // +genclient:method=SetState,verb=create,subresource=state,input=github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceState +// +genclient:method=Troubleshoot,verb=get,subresource=troubleshoot,result=github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodWorkspaceInstanceTroubleshoot // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DevPodWorkspaceInstance holds the DevPodWorkspaceInstance information diff --git a/pkg/apis/management/v1/zz_generated.api.register.go b/pkg/apis/management/v1/zz_generated.api.register.go index 338ceda..4167021 100644 --- a/pkg/apis/management/v1/zz_generated.api.register.go +++ b/pkg/apis/management/v1/zz_generated.api.register.go @@ -156,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 diff --git a/pkg/apis/management/v1/zz_generated.conversion.go b/pkg/apis/management/v1/zz_generated.conversion.go index 07aabbe..9118c73 100644 --- a/pkg/apis/management/v1/zz_generated.conversion.go +++ b/pkg/apis/management/v1/zz_generated.conversion.go @@ -820,6 +820,36 @@ 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((*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 { @@ -4865,6 +4895,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 } @@ -4887,6 +4918,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 } @@ -5053,6 +5085,80 @@ 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)) + out.GlobalMetrics = (*storagev1.Metrics)(unsafe.Pointer(in.GlobalMetrics)) + out.ClusterMetrics = (*storagev1.Metrics)(unsafe.Pointer(in.ClusterMetrics)) + 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)) + out.GlobalMetrics = (*storagev1.Metrics)(unsafe.Pointer(in.GlobalMetrics)) + out.ClusterMetrics = (*storagev1.Metrics)(unsafe.Pointer(in.ClusterMetrics)) + 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_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 diff --git a/pkg/apis/management/v1/zz_generated.deepcopy.go b/pkg/apis/management/v1/zz_generated.deepcopy.go index 5bebc5a..2122c05 100644 --- a/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -1019,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 } @@ -1835,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 } @@ -2034,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 } @@ -2210,6 +2215,89 @@ 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 + } + if in.GlobalMetrics != nil { + in, out := &in.GlobalMetrics, &out.GlobalMetrics + *out = new(storagev1.Metrics) + (*in).DeepCopyInto(*out) + } + if in.ClusterMetrics != nil { + in, out := &in.ClusterMetrics, &out.ClusterMetrics + *out = new(storagev1.Metrics) + (*in).DeepCopyInto(*out) + } + 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 *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 diff --git a/pkg/apis/management/zz_generated.api.register.go b/pkg/apis/management/zz_generated.api.register.go index 1c1b28e..b462165 100644 --- a/pkg/apis/management/zz_generated.api.register.go +++ b/pkg/apis/management/zz_generated.api.register.go @@ -77,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 @@ -1855,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 { @@ -1894,6 +1899,25 @@ type ConvertVirtualClusterConfigStatus struct { Converted bool `json:"converted"` } +type CostControl struct { + Enabled *bool `json:"enabled,omitempty"` + GlobalMetrics *storagev1.Metrics `json:"globalMetrics,omitempty"` + ClusterMetrics *storagev1.Metrics `json:"clusterMetrics,omitempty"` + Settings *CostControlSettings `json:"settings,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 { diff --git a/pkg/apis/management/zz_generated.deepcopy.go b/pkg/apis/management/zz_generated.deepcopy.go index 5da053f..59bf659 100644 --- a/pkg/apis/management/zz_generated.deepcopy.go +++ b/pkg/apis/management/zz_generated.deepcopy.go @@ -994,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 } @@ -1810,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 } @@ -2009,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 } @@ -2185,6 +2190,89 @@ 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 + } + if in.GlobalMetrics != nil { + in, out := &in.GlobalMetrics, &out.GlobalMetrics + *out = new(storagev1.Metrics) + (*in).DeepCopyInto(*out) + } + if in.ClusterMetrics != nil { + in, out := &in.ClusterMetrics, &out.ClusterMetrics + *out = new(storagev1.Metrics) + (*in).DeepCopyInto(*out) + } + 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 *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 diff --git a/pkg/apis/storage/v1/cluster_types.go b/pkg/apis/storage/v1/cluster_types.go index e814511..8834123 100644 --- a/pkg/apis/storage/v1/cluster_types.go +++ b/pkg/apis/storage/v1/cluster_types.go @@ -2,9 +2,28 @@ 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" 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 +54,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 +99,9 @@ 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"` } type AllowedClusterAccountTemplate struct { @@ -90,6 +120,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 +207,18 @@ type Chart struct { // +optional Password string `json:"password,omitempty"` } + +type Metrics struct { + // 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"` +} diff --git a/pkg/apis/storage/v1/zz_generated.deepcopy.go b/pkg/apis/storage/v1/zz_generated.deepcopy.go index 0412cfa..c498bf4 100644 --- a/pkg/apis/storage/v1/zz_generated.deepcopy.go +++ b/pkg/apis/storage/v1/zz_generated.deepcopy.go @@ -943,7 +943,7 @@ func (in *Cluster) DeepCopyInto(out *Cluster) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) return } @@ -1302,6 +1302,11 @@ 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) + } return } @@ -1318,6 +1323,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 } @@ -2677,6 +2689,23 @@ 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 + 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 @@ -4132,6 +4161,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 diff --git a/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go b/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go index 4a1d6d9..23f8a7e 100644 --- a/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/devpodworkspaceinstance.go @@ -31,6 +31,7 @@ type DevPodWorkspaceInstanceInterface interface { Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DevPodWorkspaceInstance, err error) GetState(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (*v1.DevPodWorkspaceInstanceState, error) SetState(ctx context.Context, devPodWorkspaceInstanceName string, devPodWorkspaceInstanceState *v1.DevPodWorkspaceInstanceState, opts metav1.CreateOptions) (*v1.DevPodWorkspaceInstanceState, error) + Troubleshoot(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (*v1.DevPodWorkspaceInstanceTroubleshoot, error) DevPodWorkspaceInstanceExpansion } @@ -81,3 +82,17 @@ func (c *devPodWorkspaceInstances) SetState(ctx context.Context, devPodWorkspace Into(result) return } + +// Troubleshoot takes name of the devPodWorkspaceInstance, and returns the corresponding v1.DevPodWorkspaceInstanceTroubleshoot object, and an error if there is any. +func (c *devPodWorkspaceInstances) Troubleshoot(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstanceTroubleshoot, err error) { + result = &v1.DevPodWorkspaceInstanceTroubleshoot{} + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). + Resource("devpodworkspaceinstances"). + Name(devPodWorkspaceInstanceName). + SubResource("troubleshoot"). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go index 759bff6..78b9596 100644 --- a/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go +++ b/pkg/clientset/versioned/typed/management/v1/fake/fake_devpodworkspaceinstance.go @@ -140,3 +140,15 @@ func (c *FakeDevPodWorkspaceInstances) SetState(ctx context.Context, devPodWorks } return obj.(*v1.DevPodWorkspaceInstanceState), err } + +// Troubleshoot takes name of the devPodWorkspaceInstance, and returns the corresponding devPodWorkspaceInstanceTroubleshoot object, and an error if there is any. +func (c *FakeDevPodWorkspaceInstances) Troubleshoot(ctx context.Context, devPodWorkspaceInstanceName string, options metav1.GetOptions) (result *v1.DevPodWorkspaceInstanceTroubleshoot, err error) { + emptyResult := &v1.DevPodWorkspaceInstanceTroubleshoot{} + obj, err := c.Fake. + Invokes(testing.NewGetSubresourceActionWithOptions(devpodworkspaceinstancesResource, c.ns, "troubleshoot", devPodWorkspaceInstanceName, options), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1.DevPodWorkspaceInstanceTroubleshoot), err +} diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index 9ac4319..895a497 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -156,6 +156,9 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.ConvertVirtualClusterConfigList": schema_pkg_apis_management_v1_ConvertVirtualClusterConfigList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ConvertVirtualClusterConfigSpec": schema_pkg_apis_management_v1_ConvertVirtualClusterConfigSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ConvertVirtualClusterConfigStatus": schema_pkg_apis_management_v1_ConvertVirtualClusterConfigStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControl": schema_pkg_apis_management_v1_CostControl(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice": schema_pkg_apis_management_v1_CostControlResourcePrice(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings": schema_pkg_apis_management_v1_CostControlSettings(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodDeleteOptions": schema_pkg_apis_management_v1_DevPodDeleteOptions(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodDeleteOptionsList": schema_pkg_apis_management_v1_DevPodDeleteOptionsList(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodEnvironmentTemplate": schema_pkg_apis_management_v1_DevPodEnvironmentTemplate(ref), @@ -476,6 +479,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.LocalClusterRoleTemplate": schema_pkg_apis_storage_v1_LocalClusterRoleTemplate(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.LocalClusterRoleTemplateSpec": schema_pkg_apis_storage_v1_LocalClusterRoleTemplateSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Member": schema_pkg_apis_storage_v1_Member(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics": schema_pkg_apis_storage_v1_Metrics(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NamespacePattern": schema_pkg_apis_storage_v1_NamespacePattern(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeer": schema_pkg_apis_storage_v1_NetworkPeer(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeerList": schema_pkg_apis_storage_v1_NetworkPeerList(ref), @@ -527,6 +531,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SpaceTemplateSpec": schema_pkg_apis_storage_v1_SpaceTemplateSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SpaceTemplateStatus": schema_pkg_apis_storage_v1_SpaceTemplateStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SpaceTemplateVersion": schema_pkg_apis_storage_v1_SpaceTemplateVersion(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Storage": schema_pkg_apis_storage_v1_Storage(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.StreamContainer": schema_pkg_apis_storage_v1_StreamContainer(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SyncMembersSpec": schema_pkg_apis_storage_v1_SyncMembersSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Target": schema_pkg_apis_storage_v1_Target(ref), @@ -8121,11 +8126,17 @@ func schema_pkg_apis_management_v1_ClusterSpec(ref common.ReferenceCallback) com }, }, }, + "metrics": { + SchemaProps: spec.SchemaProps{ + Description: "Metrics holds the cluster's metrics backend configuration", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -8154,6 +8165,20 @@ func schema_pkg_apis_management_v1_ClusterStatus(ref common.ReferenceCallback) c Format: "", }, }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "Conditions holds several conditions the cluster might be in", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"), + }, + }, + }, + }, + }, "online": { SchemaProps: spec.SchemaProps{ Description: "Online is whether the cluster is currently connected to the coordination server.", @@ -8164,6 +8189,8 @@ func schema_pkg_apis_management_v1_ClusterStatus(ref common.ReferenceCallback) c }, }, }, + Dependencies: []string{ + "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"}, } } @@ -8465,15 +8492,21 @@ func schema_pkg_apis_management_v1_ConfigStatus(ref common.ReferenceCallback) co }, "cloud": { SchemaProps: spec.SchemaProps{ - Description: "Cloud holkds the settings to be used exclusively in vCluster Cloud based environments and deployments.", + Description: "Cloud holds the settings to be used exclusively in vCluster Cloud based environments and deployments.", Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud"), }, }, + "costControl": { + SchemaProps: spec.SchemaProps{ + Description: "CostControl holds the settings related to the Cost Control ROI dashboard and its metrics gathering infrastructure", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControl"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.Apps", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Audit", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Authentication", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud", "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDC", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/ui/v1.UISettingsConfig"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.Apps", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Audit", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Authentication", "github.com/loft-sh/api/v4/pkg/apis/management/v1.Cloud", "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControl", "github.com/loft-sh/api/v4/pkg/apis/management/v1.OIDC", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.VaultIntegrationSpec", "github.com/loft-sh/api/v4/pkg/apis/ui/v1.UISettingsConfig"}, } } @@ -8758,6 +8791,110 @@ func schema_pkg_apis_management_v1_ConvertVirtualClusterConfigStatus(ref common. } } +func schema_pkg_apis_management_v1_CostControl(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "enabled": { + SchemaProps: spec.SchemaProps{ + Description: "Enabled specifies whether the ROI dashboard should be available in the UI, and if the metrics infrastructure that provides dashboard data is deployed", + Type: []string{"boolean"}, + Format: "", + }, + }, + "globalMetrics": { + SchemaProps: spec.SchemaProps{ + Description: "GlobalMetrics are settings for the global metrics backend. This aggregates metrics for the Cost Control Dashboard across all connected clusters", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, + "clusterMetrics": { + SchemaProps: spec.SchemaProps{ + Description: "ClusterMetrics are settings for each cluster's metrics backend. These settings apply all connected clusters unless overridden by modifying the Cluster's spec.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, + "settings": { + SchemaProps: spec.SchemaProps{ + Description: "Settings specify price-related settings that are taken into account for the ROI dashboard calculations.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"}, + } +} + +func schema_pkg_apis_management_v1_CostControlResourcePrice(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "price": { + SchemaProps: spec.SchemaProps{ + Description: "Price specifies the price.", + Type: []string{"number"}, + Format: "double", + }, + }, + "timePeriod": { + SchemaProps: spec.SchemaProps{ + Description: "TimePeriod specifies the time period for the price.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_management_v1_CostControlSettings(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "priceCurrency": { + SchemaProps: spec.SchemaProps{ + Description: "PriceCurrency specifies the currency.", + Type: []string{"string"}, + Format: "", + }, + }, + "averageCPUPricePerNode": { + SchemaProps: spec.SchemaProps{ + Description: "AvgCPUPricePerNode specifies the average CPU price per node.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice"), + }, + }, + "averageRAMPricePerNode": { + SchemaProps: spec.SchemaProps{ + Description: "AvgRAMPricePerNode specifies the average RAM price per node.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice"), + }, + }, + "controlPlanePricePerCluster": { + SchemaProps: spec.SchemaProps{ + Description: "ControlPlanePricePerCluster specifies the price of one physical cluster.", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice"}, + } +} + func schema_pkg_apis_management_v1_DevPodDeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -21709,11 +21846,17 @@ func schema_pkg_apis_storage_v1_ClusterSpec(ref common.ReferenceCallback) common }, }, }, + "metrics": { + SchemaProps: spec.SchemaProps{ + Description: "Metrics holds the cluster's metrics backend configuration", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -21742,9 +21885,25 @@ func schema_pkg_apis_storage_v1_ClusterStatus(ref common.ReferenceCallback) comm Format: "", }, }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "Conditions holds several conditions the cluster might be in", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"), + }, + }, + }, + }, + }, }, }, }, + Dependencies: []string{ + "github.com/loft-sh/agentapi/v4/pkg/apis/loft/storage/v1.Condition"}, } } @@ -24180,6 +24339,27 @@ func schema_pkg_apis_storage_v1_Member(ref common.ReferenceCallback) common.Open } } +func schema_pkg_apis_storage_v1_Metrics(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "storage": { + SchemaProps: spec.SchemaProps{ + Description: "Storage contains settings related to the metrics backend's persistent volume configuration", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Storage"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Storage"}, + } +} + func schema_pkg_apis_storage_v1_NamespacePattern(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -26740,6 +26920,32 @@ func schema_pkg_apis_storage_v1_SpaceTemplateVersion(ref common.ReferenceCallbac } } +func schema_pkg_apis_storage_v1_Storage(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "storageClass": { + SchemaProps: spec.SchemaProps{ + Description: "StorageClass the storage class to use when provisioning the metrics backend's persistent volume If set to \"-\" or \"\" dynamic provisioning is disabled If set to undefined or null (the default), the cluster's default storage class is used for provisioning", + Type: []string{"string"}, + Format: "", + }, + }, + "size": { + SchemaProps: spec.SchemaProps{ + Description: "Size the size of the metrics backend's persistent volume", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_pkg_apis_storage_v1_StreamContainer(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -30214,9 +30420,10 @@ func schema_k8sio_api_admissionregistration_v1_NamedRuleWithOperations(ref commo }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -30378,9 +30585,10 @@ func schema_k8sio_api_admissionregistration_v1_Rule(ref common.ReferenceCallback }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -30479,9 +30687,10 @@ func schema_k8sio_api_admissionregistration_v1_RuleWithOperations(ref common.Ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, @@ -31879,9 +32088,10 @@ func schema_k8sio_api_admissionregistration_v1beta1_NamedRuleWithOperations(ref }, "scope": { SchemaProps: spec.SchemaProps{ - Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".", + Description: "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".\n\n\nPossible enum values:\n - `\"*\"` means that all scopes are included.\n - `\"Cluster\"` means that scope is limited to cluster-scoped objects. Namespace objects are cluster-scoped.\n - `\"Namespaced\"` means that scope is limited to namespaced objects.", Type: []string{"string"}, Format: "", + Enum: []interface{}{"*", "Cluster", "Namespaced"}, }, }, }, From 32cadd49c56805206b42f710430b57aa322b6e3f Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:11:29 +0000 Subject: [PATCH 08/11] [skip ci] repo-sync --- go.mod | 2 +- go.sum | 4 +- pkg/apis/management/v1/config_types.go | 26 +++- .../management/v1/zz_generated.conversion.go | 78 ++++++++++- .../management/v1/zz_generated.deepcopy.go | 59 ++++++-- .../management/zz_generated.api.register.go | 19 ++- pkg/apis/management/zz_generated.deepcopy.go | 59 ++++++-- pkg/apis/storage/v1/cluster_types.go | 22 ++- pkg/apis/storage/v1/zz_generated.deepcopy.go | 41 ++++++ pkg/openapi/zz_generated.openapi.go | 130 ++++++++++++++++-- 10 files changed, 391 insertions(+), 49 deletions(-) diff --git a/go.mod b/go.mod index cc25fe1..bd7fb35 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 - github.com/loft-sh/agentapi/v4 v4.2.0-alpha.6 + github.com/loft-sh/agentapi/v4 v4.2.0-alpha.7 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index bd9ffab..01049f9 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= 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-alpha.6 h1:uwEMDiehtTJhRjE42HaaNT+7k6vBH6RMaZyn7UfQ0z8= -github.com/loft-sh/agentapi/v4 v4.2.0-alpha.6/go.mod h1:np3oo4gi1fYJvhXAYLk+SY6bVy2iqsxoAf8ebZNMnXU= +github.com/loft-sh/agentapi/v4 v4.2.0-alpha.7 h1:GcaxOAbutQjv0tTKHonVyt/aX3zplJ2Att/uoFXEgsY= +github.com/loft-sh/agentapi/v4 v4.2.0-alpha.7/go.mod h1:np3oo4gi1fYJvhXAYLk+SY6bVy2iqsxoAf8ebZNMnXU= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= diff --git a/pkg/apis/management/v1/config_types.go b/pkg/apis/management/v1/config_types.go index 86a9e10..6b4a528 100644 --- a/pkg/apis/management/v1/config_types.go +++ b/pkg/apis/management/v1/config_types.go @@ -725,18 +725,32 @@ type CostControl struct { // that provides dashboard data is deployed Enabled *bool `json:"enabled,omitempty"` - // GlobalMetrics are settings for the global metrics backend. This aggregates metrics for the Cost Control Dashboard - // across all connected clusters - GlobalMetrics *storagev1.Metrics `json:"globalMetrics,omitempty"` + // Global are settings for globally managed components + Global CostControlGlobalConfig `json:"global,omitempty"` - // ClusterMetrics are settings for each cluster's metrics backend. These settings apply all connected clusters - // unless overridden by modifying the Cluster's spec. - ClusterMetrics *storagev1.Metrics `json:"clusterMetrics,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"` diff --git a/pkg/apis/management/v1/zz_generated.conversion.go b/pkg/apis/management/v1/zz_generated.conversion.go index 9118c73..e5f3f90 100644 --- a/pkg/apis/management/v1/zz_generated.conversion.go +++ b/pkg/apis/management/v1/zz_generated.conversion.go @@ -830,6 +830,26 @@ func RegisterConversions(s *runtime.Scheme) error { }); 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 { @@ -5087,8 +5107,12 @@ func Convert_management_ConvertVirtualClusterConfigStatus_To_v1_ConvertVirtualCl func autoConvert_v1_CostControl_To_management_CostControl(in *CostControl, out *management.CostControl, s conversion.Scope) error { out.Enabled = (*bool)(unsafe.Pointer(in.Enabled)) - out.GlobalMetrics = (*storagev1.Metrics)(unsafe.Pointer(in.GlobalMetrics)) - out.ClusterMetrics = (*storagev1.Metrics)(unsafe.Pointer(in.ClusterMetrics)) + 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 } @@ -5100,8 +5124,12 @@ func Convert_v1_CostControl_To_management_CostControl(in *CostControl, out *mana func autoConvert_management_CostControl_To_v1_CostControl(in *management.CostControl, out *CostControl, s conversion.Scope) error { out.Enabled = (*bool)(unsafe.Pointer(in.Enabled)) - out.GlobalMetrics = (*storagev1.Metrics)(unsafe.Pointer(in.GlobalMetrics)) - out.ClusterMetrics = (*storagev1.Metrics)(unsafe.Pointer(in.ClusterMetrics)) + 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 } @@ -5111,6 +5139,48 @@ func Convert_management_CostControl_To_v1_CostControl(in *management.CostControl 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 diff --git a/pkg/apis/management/v1/zz_generated.deepcopy.go b/pkg/apis/management/v1/zz_generated.deepcopy.go index 2122c05..dbcf7a9 100644 --- a/pkg/apis/management/v1/zz_generated.deepcopy.go +++ b/pkg/apis/management/v1/zz_generated.deepcopy.go @@ -2223,16 +2223,8 @@ func (in *CostControl) DeepCopyInto(out *CostControl) { *out = new(bool) **out = **in } - if in.GlobalMetrics != nil { - in, out := &in.GlobalMetrics, &out.GlobalMetrics - *out = new(storagev1.Metrics) - (*in).DeepCopyInto(*out) - } - if in.ClusterMetrics != nil { - in, out := &in.ClusterMetrics, &out.ClusterMetrics - *out = new(storagev1.Metrics) - (*in).DeepCopyInto(*out) - } + in.Global.DeepCopyInto(&out.Global) + in.Cluster.DeepCopyInto(&out.Cluster) if in.Settings != nil { in, out := &in.Settings, &out.Settings *out = new(CostControlSettings) @@ -2251,6 +2243,53 @@ func (in *CostControl) DeepCopy() *CostControl { 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 diff --git a/pkg/apis/management/zz_generated.api.register.go b/pkg/apis/management/zz_generated.api.register.go index b462165..0489151 100644 --- a/pkg/apis/management/zz_generated.api.register.go +++ b/pkg/apis/management/zz_generated.api.register.go @@ -1900,10 +1900,19 @@ type ConvertVirtualClusterConfigStatus struct { } type CostControl struct { - Enabled *bool `json:"enabled,omitempty"` - GlobalMetrics *storagev1.Metrics `json:"globalMetrics,omitempty"` - ClusterMetrics *storagev1.Metrics `json:"clusterMetrics,omitempty"` - Settings *CostControlSettings `json:"settings,omitempty"` + 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 { @@ -2016,7 +2025,7 @@ type DevPodWorkspaceInstanceTroubleshoot struct { } // +genclient -// +genclient +// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type DevPodWorkspacePreset struct { diff --git a/pkg/apis/management/zz_generated.deepcopy.go b/pkg/apis/management/zz_generated.deepcopy.go index 59bf659..2df2d32 100644 --- a/pkg/apis/management/zz_generated.deepcopy.go +++ b/pkg/apis/management/zz_generated.deepcopy.go @@ -2198,16 +2198,8 @@ func (in *CostControl) DeepCopyInto(out *CostControl) { *out = new(bool) **out = **in } - if in.GlobalMetrics != nil { - in, out := &in.GlobalMetrics, &out.GlobalMetrics - *out = new(storagev1.Metrics) - (*in).DeepCopyInto(*out) - } - if in.ClusterMetrics != nil { - in, out := &in.ClusterMetrics, &out.ClusterMetrics - *out = new(storagev1.Metrics) - (*in).DeepCopyInto(*out) - } + in.Global.DeepCopyInto(&out.Global) + in.Cluster.DeepCopyInto(&out.Cluster) if in.Settings != nil { in, out := &in.Settings, &out.Settings *out = new(CostControlSettings) @@ -2226,6 +2218,53 @@ func (in *CostControl) DeepCopy() *CostControl { 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 diff --git a/pkg/apis/storage/v1/cluster_types.go b/pkg/apis/storage/v1/cluster_types.go index 8834123..520207a 100644 --- a/pkg/apis/storage/v1/cluster_types.go +++ b/pkg/apis/storage/v1/cluster_types.go @@ -3,6 +3,7 @@ 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" ) @@ -102,6 +103,9 @@ type ClusterSpec struct { // 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 { @@ -207,8 +211,16 @@ 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"` } @@ -222,3 +234,11 @@ type Storage struct { // Size the size of the metrics backend's persistent volume Size string `json:"size,omitempty"` } + +type OpenCost struct { + // Replicas is the number of desired replicas. + Replicas *int32 `json:"replicas,omitempty"` + + // Resources are compute resource required by the OpenCost backend + Resources *corev1.ResourceRequirements `json:"resources,omitempty"` +} diff --git a/pkg/apis/storage/v1/zz_generated.deepcopy.go b/pkg/apis/storage/v1/zz_generated.deepcopy.go index c498bf4..f6c13ca 100644 --- a/pkg/apis/storage/v1/zz_generated.deepcopy.go +++ b/pkg/apis/storage/v1/zz_generated.deepcopy.go @@ -1307,6 +1307,11 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { *out = new(Metrics) (*in).DeepCopyInto(*out) } + if in.OpenCost != nil { + in, out := &in.OpenCost, &out.OpenCost + *out = new(OpenCost) + (*in).DeepCopyInto(*out) + } return } @@ -2692,6 +2697,16 @@ func (in *Member) DeepCopy() *Member { // 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 } @@ -2856,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 diff --git a/pkg/openapi/zz_generated.openapi.go b/pkg/openapi/zz_generated.openapi.go index 895a497..cfadf0f 100644 --- a/pkg/openapi/zz_generated.openapi.go +++ b/pkg/openapi/zz_generated.openapi.go @@ -157,6 +157,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/management/v1.ConvertVirtualClusterConfigSpec": schema_pkg_apis_management_v1_ConvertVirtualClusterConfigSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.ConvertVirtualClusterConfigStatus": schema_pkg_apis_management_v1_ConvertVirtualClusterConfigStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControl": schema_pkg_apis_management_v1_CostControl(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlClusterConfig": schema_pkg_apis_management_v1_CostControlClusterConfig(ref), + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlGlobalConfig": schema_pkg_apis_management_v1_CostControlGlobalConfig(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlResourcePrice": schema_pkg_apis_management_v1_CostControlResourcePrice(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings": schema_pkg_apis_management_v1_CostControlSettings(ref), "github.com/loft-sh/api/v4/pkg/apis/management/v1.DevPodDeleteOptions": schema_pkg_apis_management_v1_DevPodDeleteOptions(ref), @@ -486,6 +488,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeerSpec": schema_pkg_apis_storage_v1_NetworkPeerSpec(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.NetworkPeerStatus": schema_pkg_apis_storage_v1_NetworkPeerStatus(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.ObjectsStatus": schema_pkg_apis_storage_v1_ObjectsStatus(ref), + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost": schema_pkg_apis_storage_v1_OpenCost(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PodSelector": schema_pkg_apis_storage_v1_PodSelector(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.PresetRef": schema_pkg_apis_storage_v1_PresetRef(ref), "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Project": schema_pkg_apis_storage_v1_Project(ref), @@ -8132,11 +8135,17 @@ func schema_pkg_apis_management_v1_ClusterSpec(ref common.ReferenceCallback) com Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), }, }, + "opencost": { + SchemaProps: spec.SchemaProps{ + Description: "OpenCost holds the cluster's OpenCost backend configuration", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -8804,16 +8813,18 @@ func schema_pkg_apis_management_v1_CostControl(ref common.ReferenceCallback) com Format: "", }, }, - "globalMetrics": { + "global": { SchemaProps: spec.SchemaProps{ - Description: "GlobalMetrics are settings for the global metrics backend. This aggregates metrics for the Cost Control Dashboard across all connected clusters", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + Description: "Global are settings for globally managed components", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlGlobalConfig"), }, }, - "clusterMetrics": { + "cluster": { SchemaProps: spec.SchemaProps{ - Description: "ClusterMetrics are settings for each cluster's metrics backend. These settings apply all connected clusters unless overridden by modifying the Cluster's spec.", - Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + Description: "Cluster are settings for each cluster's managed components. These settings apply to all connected clusters unless overridden by modifying the Cluster's spec", + Default: map[string]interface{}{}, + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlClusterConfig"), }, }, "settings": { @@ -8826,7 +8837,53 @@ func schema_pkg_apis_management_v1_CostControl(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"}, + "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlClusterConfig", "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlGlobalConfig", "github.com/loft-sh/api/v4/pkg/apis/management/v1.CostControlSettings"}, + } +} + +func schema_pkg_apis_management_v1_CostControlClusterConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metrics": { + SchemaProps: spec.SchemaProps{ + Description: "Metrics are settings applied to metric infrastructure in each connected cluster. These can be overridden in individual clusters by modifying the Cluster's spec", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, + "opencost": { + SchemaProps: spec.SchemaProps{ + Description: "OpenCost are settings applied to OpenCost deployments in each connected cluster. These can be overridden in individual clusters by modifying the Cluster's spec", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost"}, + } +} + +func schema_pkg_apis_management_v1_CostControlGlobalConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metrics": { + SchemaProps: spec.SchemaProps{ + Description: "Metrics these settings apply to metric infrastructure used to aggregate metrics across all connected clusters", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"}, } } @@ -21852,11 +21909,17 @@ func schema_pkg_apis_storage_v1_ClusterSpec(ref common.ReferenceCallback) common Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics"), }, }, + "opencost": { + SchemaProps: spec.SchemaProps{ + Description: "OpenCost holds the cluster's OpenCost backend configuration", + Ref: ref("github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost"), + }, + }, }, }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Access", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Metrics", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.OpenCost", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.SecretRef", "github.com/loft-sh/api/v4/pkg/apis/storage/v1.UserOrTeam"}, } } @@ -24345,6 +24408,26 @@ func schema_pkg_apis_storage_v1_Metrics(ref common.ReferenceCallback) common.Ope SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the number of desired replicas.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "resources": { + SchemaProps: spec.SchemaProps{ + Description: "Resources are compute resource required by the metrics backend", + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + "retention": { + SchemaProps: spec.SchemaProps{ + Description: "Retention is the metrics data retention period. Default is 1y", + Type: []string{"string"}, + Format: "", + }, + }, "storage": { SchemaProps: spec.SchemaProps{ Description: "Storage contains settings related to the metrics backend's persistent volume configuration", @@ -24356,7 +24439,7 @@ func schema_pkg_apis_storage_v1_Metrics(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Storage"}, + "github.com/loft-sh/api/v4/pkg/apis/storage/v1.Storage", "k8s.io/api/core/v1.ResourceRequirements"}, } } @@ -24800,6 +24883,33 @@ func schema_pkg_apis_storage_v1_ObjectsStatus(ref common.ReferenceCallback) comm } } +func schema_pkg_apis_storage_v1_OpenCost(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the number of desired replicas.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "resources": { + SchemaProps: spec.SchemaProps{ + Description: "Resources are compute resource required by the OpenCost backend", + Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ResourceRequirements"}, + } +} + func schema_pkg_apis_storage_v1_PodSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ From e266730e09c0669c198f752519796860579cd84e Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:47:37 +0000 Subject: [PATCH 09/11] [skip ci] repo-sync --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bd7fb35..6b773e9 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 - github.com/loft-sh/agentapi/v4 v4.2.0-alpha.7 + github.com/loft-sh/agentapi/v4 v4.2.2-beta.0 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 01049f9..aea4658 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= 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-alpha.7 h1:GcaxOAbutQjv0tTKHonVyt/aX3zplJ2Att/uoFXEgsY= -github.com/loft-sh/agentapi/v4 v4.2.0-alpha.7/go.mod h1:np3oo4gi1fYJvhXAYLk+SY6bVy2iqsxoAf8ebZNMnXU= +github.com/loft-sh/agentapi/v4 v4.2.2-beta.0 h1:5WNUioE4XMEelkmngHqWqWTLz9vonVJd64HJEi9zA8Q= +github.com/loft-sh/agentapi/v4 v4.2.2-beta.0/go.mod h1:np3oo4gi1fYJvhXAYLk+SY6bVy2iqsxoAf8ebZNMnXU= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= From 681b66b070259c6014a543b8a847bf81ce511e96 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Wed, 29 Jan 2025 13:43:42 +0000 Subject: [PATCH 10/11] [skip ci] repo-sync --- go.mod | 53 +++++++++++++-------------- go.sum | 111 +++++++++++++++++++++++++++++---------------------------- 2 files changed, 83 insertions(+), 81 deletions(-) diff --git a/go.mod b/go.mod index 6b773e9..44d25ab 100644 --- a/go.mod +++ b/go.mod @@ -1,20 +1,20 @@ module github.com/loft-sh/api/v4 -go 1.22.5 +go 1.23.1 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 - github.com/loft-sh/agentapi/v4 v4.2.2-beta.0 + github.com/loft-sh/agentapi/v4 v4.2.2-rc.5 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 k8s.io/apiserver v0.31.1 k8s.io/client-go v0.31.1 k8s.io/klog/v2 v2.130.1 - k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a - sigs.k8s.io/controller-runtime v0.19.0 - sigs.k8s.io/controller-tools v0.16.3 + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f + sigs.k8s.io/controller-runtime v0.19.4 + sigs.k8s.io/controller-tools v0.16.4 ) require ( @@ -38,7 +38,7 @@ require ( github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect - github.com/gobuffalo/flect v1.0.2 // indirect + github.com/gobuffalo/flect v1.0.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -54,7 +54,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.10 // indirect + github.com/klauspost/compress v1.17.11 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -72,41 +72,42 @@ require ( go.etcd.io/etcd/api/v3 v3.5.16 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect go.etcd.io/etcd/client/v3 v3.5.16 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect - go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect + go.opentelemetry.io/otel v1.33.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 // indirect - go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.33.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect - go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.33.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.27.0 // indirect - golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect - golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/term v0.24.0 // indirect - golang.org/x/text v0.18.0 // indirect - golang.org/x/time v0.6.0 // indirect - golang.org/x/tools v0.25.0 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/oauth2 v0.25.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.29.1-0.20250107080300-1c14dcadc3ab // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/time v0.9.0 // indirect + golang.org/x/tools v0.29.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240930140551-af27646dc61f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f // indirect google.golang.org/grpc v1.67.1 // indirect - google.golang.org/protobuf v1.34.2 // indirect + google.golang.org/protobuf v1.35.1 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect 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/apiextensions-apiserver v0.31.1 // indirect k8s.io/component-base v0.31.1 // indirect - k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 // indirect + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index aea4658..49c72fc 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= -github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= +github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= +github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -99,8 +99,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0= -github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 h1:Sq6qEsKSiZHYTzWbnFvnWrzMBFIC3XxFoXtnHdJE9P8= github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.2.2-beta.0 h1:5WNUioE4XMEelkmngHqWqWTLz9vonVJd64HJEi9zA8Q= -github.com/loft-sh/agentapi/v4 v4.2.2-beta.0/go.mod h1:np3oo4gi1fYJvhXAYLk+SY6bVy2iqsxoAf8ebZNMnXU= +github.com/loft-sh/agentapi/v4 v4.2.2-rc.5 h1:5LM2M3a6lCvRElAldMK9FOnzcWs9mAXcgkbf7aLpRhU= +github.com/loft-sh/agentapi/v4 v4.2.2-rc.5/go.mod h1:F655LajEWXxo7RqHJrTbw1GaJ1Lk+zGVzYGAjoUeLMk= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -143,8 +143,8 @@ github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJN github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -163,8 +163,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= @@ -189,22 +189,24 @@ go.etcd.io/etcd/raft/v3 v3.5.13 h1:7r/NKAOups1YnKcfro2RvGGo2PTuizF/xh26Z2CTAzA= go.etcd.io/etcd/raft/v3 v3.5.13/go.mod h1:uUFibGLn2Ksm2URMxN1fICGhk8Wu96EfDQyuLhAcAmw= go.etcd.io/etcd/server/v3 v3.5.13 h1:V6KG+yMfMSqWt+lGnhFpP5z5dRUj1BDRJ5k1fQ9DFok= go.etcd.io/etcd/server/v3 v3.5.13/go.mod h1:K/8nbsGupHqmr5MkgaZpLlH1QdX1pcNQLAkODy44XcQ= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 h1:hCq2hNMwsegUvPzI7sPOvtO9cqyy5GbWt/Ybp2xrx8Q= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0/go.mod h1:LqaApwGx/oUmzsbqxkzuBvyoPpkxk3JQWnqfVrJ3wCA= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 h1:ZIg3ZT/aQ7AfKqdwp7ECpOK6vHqquXXuyTjIO8ZdmPs= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI= -go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= -go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= +go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 h1:lsInsfvhVIfOI6qHVyysXMNDnjO9Npvl7tlDPJFBVd4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0/go.mod h1:KQsVNh4OjgjTG0G6EiNi1jVpnaeeKsKMRwbLN+f1+8M= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0 h1:m0yTiGDLUvVYaTFbAvCkVYIYcvwKt3G7OLoN77NUs/8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0/go.mod h1:wBQbT4UekBfegL2nx0Xk1vBcnzyBPsIVm9hRG4fYcr4= -go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= -go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= +go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= +go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= go.opentelemetry.io/otel/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= -go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= -go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= +go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= +go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -216,46 +218,46 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= -golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= -golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA= +golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= -golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= -golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= +golang.org/x/sys v0.29.1-0.20250107080300-1c14dcadc3ab h1:BMkEEWYOjkvOX7+YKOGbp6jCyQ5pR2j0Ah47p1Vdsx4= +golang.org/x/sys v0.29.1-0.20250107080300-1c14dcadc3ab/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= -golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= +golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -270,8 +272,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -283,7 +285,6 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -303,19 +304,19 @@ k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a h1:zD1uj3Jf+mD4zmA7W+goE5TxDkI7OGJjBNBzq5fJtLA= -k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc= -k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY9mD9fNT47QO6HI= -k8s.io/utils v0.0.0-20240921022957-49e7df575cb6/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= -sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= -sigs.k8s.io/controller-tools v0.16.3 h1:z48C5/d4jCVQQvtiSBL5MYyZ3EO2eFIOXrIKMgHVhFY= -sigs.k8s.io/controller-tools v0.16.3/go.mod h1:AEj6k+w1kYpLZv2einOH3mj52ips4W/6FUjnB5tkJGs= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/controller-runtime v0.19.4 h1:SUmheabttt0nx8uJtoII4oIP27BVVvAKFvdvGFwV/Qo= +sigs.k8s.io/controller-runtime v0.19.4/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-tools v0.16.4 h1:VXmar78eDXbx1by/H09ikEq1hiq3bqInxuV3lMr3GmQ= +sigs.k8s.io/controller-tools v0.16.4/go.mod h1:kcsZyYMXiOFuBhofSPtkB90zTSxVRxVVyvtKQcx3q1A= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= +sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From 69f0c0646cfca59c869c0b32bd3acf3c4c4a2b42 Mon Sep 17 00:00:00 2001 From: Loft Bot <73976634+loft-bot@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:36:41 +0000 Subject: [PATCH 11/11] [skip ci] repo-sync --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 44d25ab..836f408 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.1 require ( github.com/ghodss/yaml v1.0.0 github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 - github.com/loft-sh/agentapi/v4 v4.2.2-rc.5 + github.com/loft-sh/agentapi/v4 v4.2.2-rc.6 github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d k8s.io/api v0.31.1 k8s.io/apimachinery v0.31.1 diff --git a/go.sum b/go.sum index 49c72fc..3564e15 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44 h1:Sq6qEsKSiZHYTzWbnFvnWrzMBFIC3XxFoXtnHdJE9P8= github.com/loft-sh/admin-apis v0.0.0-20241127134028-9cfb6b23ec44/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U= -github.com/loft-sh/agentapi/v4 v4.2.2-rc.5 h1:5LM2M3a6lCvRElAldMK9FOnzcWs9mAXcgkbf7aLpRhU= -github.com/loft-sh/agentapi/v4 v4.2.2-rc.5/go.mod h1:F655LajEWXxo7RqHJrTbw1GaJ1Lk+zGVzYGAjoUeLMk= +github.com/loft-sh/agentapi/v4 v4.2.2-rc.6 h1:88XxfDcfV8nSUycWw3O3MHx5lg4VcGvq3PMV4UfcKFA= +github.com/loft-sh/agentapi/v4 v4.2.2-rc.6/go.mod h1:F655LajEWXxo7RqHJrTbw1GaJ1Lk+zGVzYGAjoUeLMk= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d h1:73wE8wtsnJm4bXtFbTDRG1EgN4LonpPdgzF3HFhP7kA= github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d/go.mod h1:jmxtfco3FHrInOVcVcUH0TjE76M6bsNgin5B+84D7IQ= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=