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 Nov 12, 2024
1 parent dd25a78 commit bfaf522
Show file tree
Hide file tree
Showing 15 changed files with 836 additions and 11 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.22.5

require (
github.com/ghodss/yaml v1.0.0
github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354
github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17
github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0
github.com/loft-sh/agentapi/v4 v4.1.0
github.com/loft-sh/apiserver v0.0.0-20241008120650-f17d504a4d0d
k8s.io/api v0.31.1
k8s.io/apimachinery v0.31.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354 h1:aqT1UeosCYB+3DEzfxW0evhcYHxhoBVAEWtkXLXFimI=
github.com/loft-sh/admin-apis v0.0.0-20240814093917-dc663916b354/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U=
github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17 h1:yoTwfLkurXmA7ENb8YWQePIVK42vZVSeV4unngNc8c8=
github.com/loft-sh/agentapi/v4 v4.1.0-alpha.17/go.mod h1:CXweRDab9ZcSzcaitULFagYGgSzW8Q12W3cBdKMjR8k=
github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0 h1:fAn1LUVsxpkRasDJcSq7wRncxET+zeA8MVtGyxL2rSU=
github.com/loft-sh/admin-apis v0.0.0-20241105163154-88dd686aaba0/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U=
github.com/loft-sh/agentapi/v4 v4.1.0 h1:2uwBHLy6Aiy6VlTudsWZxSRQ4GEwGL5X87+j+eiOeVE=
github.com/loft-sh/agentapi/v4 v4.1.0/go.mod h1:yqbIMmyXqbzZcK0DlwldRLy0xb3lYnH4NoI3K+iETlM=
github.com/loft-sh/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.

24 changes: 24 additions & 0 deletions pkg/apis/management/v1/config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`
}
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.

Loading

0 comments on commit bfaf522

Please sign in to comment.