Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(platform): Added platform hook #1714

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/vcluster/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ func ExecuteStart(ctx context.Context, options *StartOptions) error {
}
}

if err := pro.ConnectToPlatform(
ctx,
controllerCtx.Config.ControlPlaneClient,
controllerCtx.VirtualManager.GetHTTPClient().Transport,
vConfig,
); err != nil {
return fmt.Errorf("connect to platform: %w", err)
}

// start leader election + controllers
err = StartLeaderElection(controllerCtx, func() error {
return setup.StartControllers(controllerCtx)
Expand Down
14 changes: 8 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/loft-sh/vcluster

go 1.22.1
go 1.22.2

require (
github.com/blang/semver v3.5.1+incompatible
Expand Down Expand Up @@ -75,14 +75,15 @@ require (
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/docker/cli v24.0.7+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/cli v25.0.0+incompatible // indirect
github.com/docker/docker v25.0.5+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.1 // indirect
github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960 // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/evanphx/json-patch/v5 v5.8.1 // indirect
github.com/fatih/camelcase v1.0.0 // indirect
github.com/fatih/color v1.12.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/frankban/quicktest v1.14.5 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/cel-go v0.17.7 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
Expand All @@ -98,6 +99,7 @@ require (
github.com/otiai10/copy v1.11.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
Expand All @@ -113,7 +115,7 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand Down
49 changes: 34 additions & 15 deletions go.sum

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions pkg/pro/platform.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package pro

import (
"context"
"net/http"

"github.com/loft-sh/vcluster/pkg/config"
"k8s.io/client-go/kubernetes"
)

var ConnectToPlatform = func(context.Context, kubernetes.Interface, http.RoundTripper, *config.VirtualClusterConfig) error {
return nil
}
2 changes: 1 addition & 1 deletion pkg/util/loghelper/klog.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func PrintKlogLine(line string, args []interface{}) {

// try to parse structured logging
line, extraArgs := parseStructuredLogging(line)
klog.InfoS(line, append(args, extraArgs...)...)
klog.InfoSDepth(1, line, append(args, extraArgs...)...)
}

func parseStructuredLogging(line string) (string, []interface{}) {
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/ProtonMail/go-crypto/bitcurves/bitcurve.go

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

2 changes: 1 addition & 1 deletion vendor/github.com/ProtonMail/go-crypto/brainpool/rcurve.go

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

4 changes: 2 additions & 2 deletions vendor/github.com/ProtonMail/go-crypto/eax/eax.go

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

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

10 changes: 5 additions & 5 deletions vendor/github.com/ProtonMail/go-crypto/ocb/ocb.go

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

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

23 changes: 15 additions & 8 deletions vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go

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

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

14 changes: 9 additions & 5 deletions vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go

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

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

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

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

24 changes: 24 additions & 0 deletions vendor/github.com/ProtonMail/go-crypto/openpgp/hash.go

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

Loading
Loading