Skip to content

Commit

Permalink
[skip ci] repo-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
loft-bot committed Oct 31, 2024
1 parent dd25a78 commit 3d049c6
Show file tree
Hide file tree
Showing 14 changed files with 592 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/management/install/zz_generated.api.register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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"`
}
2 changes: 2 additions & 0 deletions pkg/apis/management/v1/virtualclusterinstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"`
Expand Down
14 changes: 14 additions & 0 deletions pkg/apis/management/v1/zz_generated.api.register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 134 additions & 0 deletions pkg/apis/management/v1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3d049c6

Please sign in to comment.