Skip to content

Commit

Permalink
chore: bump vcluster version
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Feb 8, 2024
1 parent ba9476c commit d2dfb12
Show file tree
Hide file tree
Showing 58 changed files with 575 additions and 393 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
cancel-in-progress: true

env:
VCLUSTER_VERSION: v0.19.0-alpha.4
VCLUSTER_VERSION: v0.19.0-beta.2
VCLUSTER_SUFFIX: vcluster
VCLUSTER_NAME: vcluster
VCLUSTER_NAMESPACE: vcluster
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
run: |
set -x
sleep 1
kubectl wait --for=condition=ready pod -l app=${{ env.VCLUSTER_SUFFIX }} -n ${{ env.VCLUSTER_NAMESPACE }} --timeout=300s
kubectl wait --for=condition=ready pod -l app=${{ env.VCLUSTER_SUFFIX }} -n ${{ env.VCLUSTER_NAMESPACE }} --timeout=120s
continue-on-error: true

- name: Collect deployment information in case vcluster fails to start
Expand Down
40 changes: 39 additions & 1 deletion e2e/test_plugin/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
package main

import (
"fmt"
"os"

examplev1 "github.com/loft-sh/vcluster-sdk/e2e/test_plugin/apis/v1"
"github.com/loft-sh/vcluster-sdk/e2e/test_plugin/syncers"
"github.com/loft-sh/vcluster-sdk/plugin"
"github.com/loft-sh/vcluster/pkg/scheme"
"k8s.io/klog/v2"
)

type PluginConfig struct {
String string `json:"string,omitempty"`
Int int `json:"int,omitempty"`
Map map[string]string `json:"map,omitempty"`
Array []string `json:"array,omitempty"`
}

func main() {
_ = examplev1.AddToScheme(scheme.Scheme)

ctx := plugin.MustInit()
err := validateConfig()
if err != nil {
klog.Fatalf("validate config: %v", err)
}
plugin.MustRegister(syncers.NewServiceHook())
plugin.MustRegister(syncers.NewPodHook())
plugin.MustRegister(syncers.NewSecretHook())
Expand All @@ -19,3 +33,27 @@ func main() {
plugin.MustRegister(syncers.NewImportSecrets(ctx))
plugin.MustStart()
}

func validateConfig() error {
// verify config
pConfig := &PluginConfig{}
klog.Info(os.Getenv("PLUGIN_CONFIG"))
err := plugin.UnmarshalConfig(pConfig)
if err != nil {
return fmt.Errorf("unmarshal config: %w", err)
}
if pConfig.Int != 123 {
return fmt.Errorf("expected int to be 123, got %v", pConfig.Int)
}
if pConfig.String != "string" {
return fmt.Errorf("expected string to be string, got %v", pConfig.String)
}
if len(pConfig.Map) != 1 || pConfig.Map["entry"] != "entry" {
return fmt.Errorf("expected map to contain entry, got %v", pConfig.Map)
}
if len(pConfig.Array) != 1 || pConfig.Array[0] != "entry" {
return fmt.Errorf("expected map to contain entry, got %v", pConfig.Map)
}

return nil
}
11 changes: 11 additions & 0 deletions e2e/test_plugin/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# Plugin Definition below. This is essentially a valid helm values file that will be merged
# with the other vcluster values during vcluster create or helm install.
plugin:
other-plugin:
version: v2
config:
my-other-config: "test"
test-plugin:
version: v2
image: ghcr.io/loft-sh/test-plugin:v1
imagePullPolicy: Never
config:
string: "string"
int: 123
map:
entry: "entry"
array:
- entry
rbac:
role:
extraRules:
Expand Down
2 changes: 1 addition & 1 deletion examples/bootstrap-with-deployment/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deployments:
chart:
name: vcluster
repo: https://charts.loft.sh
version: v0.19.0-alpha.4
version: v0.19.0-beta.2
values:
serviceAccount:
create: false
Expand Down
2 changes: 1 addition & 1 deletion examples/bootstrap-with-deployment/devspace_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COLOR_RESET="\033[0m"
if [ ! -f "/vcluster/syncer" ]; then
echo "Downloading vCluster syncer..."
mkdir -p /vcluster
curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.4/syncer-linux-$(go env GOARCH)"
curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-beta.2/syncer-linux-$(go env GOARCH)"
chmod +x /vcluster/syncer
echo "Successfully downloaded syncer"
fi
Expand Down
12 changes: 6 additions & 6 deletions examples/bootstrap-with-deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/loft-sh/vcluster-mydeployment-example
go 1.21.5

require (
github.com/loft-sh/vcluster v0.19.0-alpha.4.0.20240201171603-e3abc343e685
github.com/loft-sh/vcluster v0.19.0-beta.1.0.20240207101352-5dc198537487
github.com/loft-sh/vcluster-sdk v0.4.3-0.20240201185810-7d4d03e38701
k8s.io/klog/v2 v2.120.1
)
Expand Down Expand Up @@ -80,16 +80,16 @@ require (
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/loft-sh/admin-apis v0.0.0-20231102064836-7a6574be5f16 // indirect
github.com/loft-sh/agentapi/v3 v3.4.0-beta.11.0.20240123094803-669b6def4eb6 // indirect
github.com/loft-sh/analytics-client v0.0.0-20231127192707-f76e263f6c83 // indirect
github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 // indirect
github.com/loft-sh/agentapi/v3 v3.4.0-beta.12.0.20240207094449-7adc00ae1265 // indirect
github.com/loft-sh/analytics-client v0.0.0-20240206084604-1302688c3d4c // indirect
github.com/loft-sh/api/v3 v3.4.0-beta.11 // indirect
github.com/loft-sh/apiserver v0.0.0-20240122115656-e1a690b2e2d8 // indirect
github.com/loft-sh/apiserver v0.0.0-20240125143607-a106e2f2e0f1 // indirect
github.com/loft-sh/jspolicy v0.2.2 // indirect
github.com/loft-sh/loftctl/v3 v3.4.0-beta.11 // indirect
github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a // indirect
github.com/loft-sh/utils v0.0.29 // indirect
github.com/loft-sh/vcluster-values v0.0.0-20240131133548-d47237f9bcbe // indirect
github.com/loft-sh/vcluster-values v0.0.0-20240207093538-4bbb24e9f699 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand Down
26 changes: 12 additions & 14 deletions examples/bootstrap-with-deployment/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -610,16 +610,16 @@ github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0 h1:nHHjmvjitIiyP
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0/go.mod h1:YBCo4DoEeDndqvAn6eeu0vWM7QdXmHEeI9cFWplmBys=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
github.com/loft-sh/admin-apis v0.0.0-20231102064836-7a6574be5f16 h1:cDdBqGd2OSL9KW8HIhqEagu13VfUibUEfKt9qvdtfgM=
github.com/loft-sh/admin-apis v0.0.0-20231102064836-7a6574be5f16/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U=
github.com/loft-sh/agentapi/v3 v3.4.0-beta.11.0.20240123094803-669b6def4eb6 h1:HmTMqwL+bkgTjOdEAB9eSTBlf1VP3cbyd/ZL7Tuexik=
github.com/loft-sh/agentapi/v3 v3.4.0-beta.11.0.20240123094803-669b6def4eb6/go.mod h1:Cpyq+ENdPYHWay5OzCWhal4czSBPwr3OtAkVnIbHtSc=
github.com/loft-sh/analytics-client v0.0.0-20231127192707-f76e263f6c83 h1:2vLLPFmp0obR4pMUID0chRYHZ0nlBpxupIkiBo1BZOU=
github.com/loft-sh/analytics-client v0.0.0-20231127192707-f76e263f6c83/go.mod h1:FFWcGASyM2QlWTDTCG/WBVM/XYr8btqYt335TFNRCFg=
github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 h1:nuY9Vgvabh2FlaTYp9yhzh3cBzY6jjFEFSsOvw9ZAJw=
github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U=
github.com/loft-sh/agentapi/v3 v3.4.0-beta.12.0.20240207094449-7adc00ae1265 h1:SUAdOY4H2n04JlI2So/kyRaH/HEpnoH//cewI4C4vyY=
github.com/loft-sh/agentapi/v3 v3.4.0-beta.12.0.20240207094449-7adc00ae1265/go.mod h1:Ln2nKIXWwgCYqA+NflEu182x3r0Zb7KZnzJ4LHOMP7Y=
github.com/loft-sh/analytics-client v0.0.0-20240206084604-1302688c3d4c h1:WeOXXSGCdE6s0+fargq3Hs0aYx+TMZoF9Kb45fkubys=
github.com/loft-sh/analytics-client v0.0.0-20240206084604-1302688c3d4c/go.mod h1:FFWcGASyM2QlWTDTCG/WBVM/XYr8btqYt335TFNRCFg=
github.com/loft-sh/api/v3 v3.4.0-beta.11 h1:kh9oqGdco1YAUGjgw5LK9Z++4KLw561QANvGko312C8=
github.com/loft-sh/api/v3 v3.4.0-beta.11/go.mod h1:eTUHPQ6RdnC4w+xYUaIVLJME9s9OsO2svbcWDrGGXX8=
github.com/loft-sh/apiserver v0.0.0-20240122115656-e1a690b2e2d8 h1:3ABvaTlOBk+AdNqZCE6Vm5iItydFfhw4FcQA4AiyU/8=
github.com/loft-sh/apiserver v0.0.0-20240122115656-e1a690b2e2d8/go.mod h1:lX9CG5vj5kQ5mlSruMghnmpDjnWppWW1hxxOwJxukrU=
github.com/loft-sh/apiserver v0.0.0-20240125143607-a106e2f2e0f1 h1:pdT9I+6jg5YV9vTlG4b0RRao3EvwjSNmH0Cihv7bPUg=
github.com/loft-sh/apiserver v0.0.0-20240125143607-a106e2f2e0f1/go.mod h1:lX9CG5vj5kQ5mlSruMghnmpDjnWppWW1hxxOwJxukrU=
github.com/loft-sh/jspolicy v0.2.2 h1:+7QqVumYm225mSJsGOjnbCGYzh9XyKYQab6FgLiHYJU=
github.com/loft-sh/jspolicy v0.2.2/go.mod h1:kbXD1CS17Ie9dqcq5iXrOhpSLESkmQpy4+F80YXOfUM=
github.com/loft-sh/loftctl/v3 v3.4.0-beta.11 h1:6M1WKsXbq/LDj8jnHXLlOYCYbKXSBDOzIXK5jiYqjTU=
Expand All @@ -628,12 +628,10 @@ github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a h1:/gqqjKpcHEdFXIX41lx
github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a/go.mod h1:YImeRjXH34Yf5E79T7UHBQpDZl9fIaaFRgyZ/bkY+UQ=
github.com/loft-sh/utils v0.0.29 h1:P/MObccXToAZy2QoJSQDJ+OJx1qHitpFHEVj3QBSNJs=
github.com/loft-sh/utils v0.0.29/go.mod h1:9hlX9cGpWHg3mNi/oBlv3X4ePGDMK66k8MbOZGFMDTI=
github.com/loft-sh/vcluster v0.19.0-alpha.4.0.20240201171603-e3abc343e685 h1:GhwDFggNqnVy/G96p5Cfi2yw9/WVrYA2YNs55CHWfRA=
github.com/loft-sh/vcluster v0.19.0-alpha.4.0.20240201171603-e3abc343e685/go.mod h1:TS2klm4ta0hO5qiUbEUGQEZ06UBofgroSSOziY+P01E=
github.com/loft-sh/vcluster-sdk v0.4.3-0.20240201185810-7d4d03e38701 h1:2Sih+Ykm2AsfLIO6d4GG9CBtqMaJ0HNg3+dkOBjr1GQ=
github.com/loft-sh/vcluster-sdk v0.4.3-0.20240201185810-7d4d03e38701/go.mod h1:6jrgXdwfHS0lKcfkNQrl7vmpRqo8vv1Un7cpC0oONV4=
github.com/loft-sh/vcluster-values v0.0.0-20240131133548-d47237f9bcbe h1:F1jR+Gs8q2VH0MVVn5TFV8YuNvue/piLmg12zQlDYns=
github.com/loft-sh/vcluster-values v0.0.0-20240131133548-d47237f9bcbe/go.mod h1:J34xtWyMbjM+NRgVWxO0IVDB5XYUaX52jPQNqEAhu4M=
github.com/loft-sh/vcluster v0.19.0-beta.1.0.20240207101352-5dc198537487 h1:kW1HEIr6wHXueI8OmBN6DGzRhIy/P4u8hcOnbIzLE0c=
github.com/loft-sh/vcluster v0.19.0-beta.1.0.20240207101352-5dc198537487/go.mod h1:5PQdcVunYGZZKgkY1q8ibt0TLspMAFoVn3vNvczKNU8=
github.com/loft-sh/vcluster-values v0.0.0-20240207093538-4bbb24e9f699 h1:lbbIlSpl/sz1iY/Tl/VUOU8NtFe31uwvlUbANK04mDM=
github.com/loft-sh/vcluster-values v0.0.0-20240207093538-4bbb24e9f699/go.mod h1:J34xtWyMbjM+NRgVWxO0IVDB5XYUaX52jPQNqEAhu4M=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand Down
2 changes: 1 addition & 1 deletion examples/crd-sync/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deployments:
chart:
name: vcluster
repo: https://charts.loft.sh
version: v0.19.0-alpha.4
version: v0.19.0-beta.2
values:
plugin:
crd-sync:
Expand Down
2 changes: 1 addition & 1 deletion examples/crd-sync/devspace_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COLOR_RESET="\033[0m"
if [ ! -f "/vcluster/syncer" ]; then
echo "Downloading vCluster syncer..."
mkdir -p /vcluster
curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.4/syncer-linux-$(go env GOARCH)"
curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-beta.2/syncer-linux-$(go env GOARCH)"
chmod +x /vcluster/syncer
echo "Successfully downloaded syncer"
fi
Expand Down
2 changes: 1 addition & 1 deletion examples/hooks/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deployments:
chart:
name: vcluster
repo: https://charts.loft.sh
version: v0.19.0-alpha.4
version: v0.19.0-beta.2
values:
serviceAccount:
create: false
Expand Down
2 changes: 1 addition & 1 deletion examples/hooks/devspace_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COLOR_RESET="\033[0m"
if [ ! -f "/vcluster/syncer" ]; then
echo "Downloading vCluster syncer..."
mkdir -p /vcluster
curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.4/syncer-linux-$(go env GOARCH)"
curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-beta.2/syncer-linux-$(go env GOARCH)"
chmod +x /vcluster/syncer
echo "Successfully downloaded syncer"
fi
Expand Down
2 changes: 1 addition & 1 deletion examples/import-secrets/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deployments:
chart:
name: vcluster
repo: https://charts.loft.sh
version: v0.19.0-alpha.4
version: v0.19.0-beta.2
values:
plugin:
pull-secret-sync:
Expand Down
2 changes: 1 addition & 1 deletion examples/import-secrets/devspace_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COLOR_RESET="\033[0m"
if [ ! -f "/vcluster/syncer" ]; then
echo "Downloading vCluster syncer..."
mkdir -p /vcluster
curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-alpha.4/syncer-linux-$(go env GOARCH)"
curl -L -o /vcluster/syncer "https://github.com/loft-sh/vcluster/releases/download/v0.19.0-beta.2/syncer-linux-$(go env GOARCH)"
chmod +x /vcluster/syncer
echo "Successfully downloaded syncer"
fi
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/hashicorp/go-plugin v1.6.0
github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a
github.com/loft-sh/vcluster v0.19.0-alpha.4.0.20240201171603-e3abc343e685
github.com/loft-sh/vcluster v0.19.0-beta.2
github.com/onsi/ginkgo/v2 v2.14.0
github.com/onsi/gomega v1.30.0
github.com/pkg/errors v0.9.1
Expand Down Expand Up @@ -90,15 +90,15 @@ require (
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/loft-sh/admin-apis v0.0.0-20231102064836-7a6574be5f16 // indirect
github.com/loft-sh/agentapi/v3 v3.4.0-beta.11.0.20240123094803-669b6def4eb6 // indirect
github.com/loft-sh/analytics-client v0.0.0-20231127192707-f76e263f6c83 // indirect
github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 // indirect
github.com/loft-sh/agentapi/v3 v3.4.0-beta.12.0.20240207094449-7adc00ae1265 // indirect
github.com/loft-sh/analytics-client v0.0.0-20240206084604-1302688c3d4c // indirect
github.com/loft-sh/api/v3 v3.4.0-beta.11 // indirect
github.com/loft-sh/apiserver v0.0.0-20240122115656-e1a690b2e2d8 // indirect
github.com/loft-sh/apiserver v0.0.0-20240125143607-a106e2f2e0f1 // indirect
github.com/loft-sh/jspolicy v0.2.2 // indirect
github.com/loft-sh/loftctl/v3 v3.4.0-beta.11 // indirect
github.com/loft-sh/utils v0.0.29 // indirect
github.com/loft-sh/vcluster-values v0.0.0-20240131133548-d47237f9bcbe // indirect
github.com/loft-sh/vcluster-values v0.0.0-20240207093538-4bbb24e9f699 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -610,16 +610,16 @@ github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0 h1:nHHjmvjitIiyP
github.com/kubernetes-csi/external-snapshotter/client/v4 v4.2.0/go.mod h1:YBCo4DoEeDndqvAn6eeu0vWM7QdXmHEeI9cFWplmBys=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
github.com/loft-sh/admin-apis v0.0.0-20231102064836-7a6574be5f16 h1:cDdBqGd2OSL9KW8HIhqEagu13VfUibUEfKt9qvdtfgM=
github.com/loft-sh/admin-apis v0.0.0-20231102064836-7a6574be5f16/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U=
github.com/loft-sh/agentapi/v3 v3.4.0-beta.11.0.20240123094803-669b6def4eb6 h1:HmTMqwL+bkgTjOdEAB9eSTBlf1VP3cbyd/ZL7Tuexik=
github.com/loft-sh/agentapi/v3 v3.4.0-beta.11.0.20240123094803-669b6def4eb6/go.mod h1:Cpyq+ENdPYHWay5OzCWhal4czSBPwr3OtAkVnIbHtSc=
github.com/loft-sh/analytics-client v0.0.0-20231127192707-f76e263f6c83 h1:2vLLPFmp0obR4pMUID0chRYHZ0nlBpxupIkiBo1BZOU=
github.com/loft-sh/analytics-client v0.0.0-20231127192707-f76e263f6c83/go.mod h1:FFWcGASyM2QlWTDTCG/WBVM/XYr8btqYt335TFNRCFg=
github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 h1:nuY9Vgvabh2FlaTYp9yhzh3cBzY6jjFEFSsOvw9ZAJw=
github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8/go.mod h1:MWczNwKvWssHo1KaeZKaWDdRLYSNbWqQBGsTLoCNd7U=
github.com/loft-sh/agentapi/v3 v3.4.0-beta.12.0.20240207094449-7adc00ae1265 h1:SUAdOY4H2n04JlI2So/kyRaH/HEpnoH//cewI4C4vyY=
github.com/loft-sh/agentapi/v3 v3.4.0-beta.12.0.20240207094449-7adc00ae1265/go.mod h1:Ln2nKIXWwgCYqA+NflEu182x3r0Zb7KZnzJ4LHOMP7Y=
github.com/loft-sh/analytics-client v0.0.0-20240206084604-1302688c3d4c h1:WeOXXSGCdE6s0+fargq3Hs0aYx+TMZoF9Kb45fkubys=
github.com/loft-sh/analytics-client v0.0.0-20240206084604-1302688c3d4c/go.mod h1:FFWcGASyM2QlWTDTCG/WBVM/XYr8btqYt335TFNRCFg=
github.com/loft-sh/api/v3 v3.4.0-beta.11 h1:kh9oqGdco1YAUGjgw5LK9Z++4KLw561QANvGko312C8=
github.com/loft-sh/api/v3 v3.4.0-beta.11/go.mod h1:eTUHPQ6RdnC4w+xYUaIVLJME9s9OsO2svbcWDrGGXX8=
github.com/loft-sh/apiserver v0.0.0-20240122115656-e1a690b2e2d8 h1:3ABvaTlOBk+AdNqZCE6Vm5iItydFfhw4FcQA4AiyU/8=
github.com/loft-sh/apiserver v0.0.0-20240122115656-e1a690b2e2d8/go.mod h1:lX9CG5vj5kQ5mlSruMghnmpDjnWppWW1hxxOwJxukrU=
github.com/loft-sh/apiserver v0.0.0-20240125143607-a106e2f2e0f1 h1:pdT9I+6jg5YV9vTlG4b0RRao3EvwjSNmH0Cihv7bPUg=
github.com/loft-sh/apiserver v0.0.0-20240125143607-a106e2f2e0f1/go.mod h1:lX9CG5vj5kQ5mlSruMghnmpDjnWppWW1hxxOwJxukrU=
github.com/loft-sh/jspolicy v0.2.2 h1:+7QqVumYm225mSJsGOjnbCGYzh9XyKYQab6FgLiHYJU=
github.com/loft-sh/jspolicy v0.2.2/go.mod h1:kbXD1CS17Ie9dqcq5iXrOhpSLESkmQpy4+F80YXOfUM=
github.com/loft-sh/loftctl/v3 v3.4.0-beta.11 h1:6M1WKsXbq/LDj8jnHXLlOYCYbKXSBDOzIXK5jiYqjTU=
Expand All @@ -628,10 +628,10 @@ github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a h1:/gqqjKpcHEdFXIX41lx
github.com/loft-sh/log v0.0.0-20230824104949-bd516c25712a/go.mod h1:YImeRjXH34Yf5E79T7UHBQpDZl9fIaaFRgyZ/bkY+UQ=
github.com/loft-sh/utils v0.0.29 h1:P/MObccXToAZy2QoJSQDJ+OJx1qHitpFHEVj3QBSNJs=
github.com/loft-sh/utils v0.0.29/go.mod h1:9hlX9cGpWHg3mNi/oBlv3X4ePGDMK66k8MbOZGFMDTI=
github.com/loft-sh/vcluster v0.19.0-alpha.4.0.20240201171603-e3abc343e685 h1:GhwDFggNqnVy/G96p5Cfi2yw9/WVrYA2YNs55CHWfRA=
github.com/loft-sh/vcluster v0.19.0-alpha.4.0.20240201171603-e3abc343e685/go.mod h1:TS2klm4ta0hO5qiUbEUGQEZ06UBofgroSSOziY+P01E=
github.com/loft-sh/vcluster-values v0.0.0-20240131133548-d47237f9bcbe h1:F1jR+Gs8q2VH0MVVn5TFV8YuNvue/piLmg12zQlDYns=
github.com/loft-sh/vcluster-values v0.0.0-20240131133548-d47237f9bcbe/go.mod h1:J34xtWyMbjM+NRgVWxO0IVDB5XYUaX52jPQNqEAhu4M=
github.com/loft-sh/vcluster v0.19.0-beta.2 h1:fAHWadyS/8P7aUSbCPKujEAHbuTgaYBOVazkVhYyeS8=
github.com/loft-sh/vcluster v0.19.0-beta.2/go.mod h1:5PQdcVunYGZZKgkY1q8ibt0TLspMAFoVn3vNvczKNU8=
github.com/loft-sh/vcluster-values v0.0.0-20240207093538-4bbb24e9f699 h1:lbbIlSpl/sz1iY/Tl/VUOU8NtFe31uwvlUbANK04mDM=
github.com/loft-sh/vcluster-values v0.0.0-20240207093538-4bbb24e9f699/go.mod h1:J34xtWyMbjM+NRgVWxO0IVDB5XYUaX52jPQNqEAhu4M=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand Down
12 changes: 11 additions & 1 deletion plugin/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"github.com/loft-sh/log/logr"
"github.com/loft-sh/vcluster/pkg/controllers/syncer"
synccontext "github.com/loft-sh/vcluster/pkg/controllers/syncer/context"
"github.com/loft-sh/vcluster/pkg/options"
"github.com/loft-sh/vcluster/pkg/plugin/types"
v2 "github.com/loft-sh/vcluster/pkg/plugin/v2"
"github.com/loft-sh/vcluster/pkg/scheme"
"github.com/loft-sh/vcluster/pkg/setup"
"github.com/loft-sh/vcluster/pkg/setup/options"
syncertypes "github.com/loft-sh/vcluster/pkg/types"
"github.com/loft-sh/vcluster/pkg/util/clienthelper"
contextutil "github.com/loft-sh/vcluster/pkg/util/context"
Expand Down Expand Up @@ -43,6 +43,8 @@ type manager struct {
pluginServer server

syncers []syncertypes.Base

proConfig v2.InitConfigPro
}

func (m *manager) UnmarshalConfig(into interface{}) error {
Expand All @@ -54,6 +56,13 @@ func (m *manager) UnmarshalConfig(into interface{}) error {
return nil
}

func (m *manager) ProConfig() v2.InitConfigPro {
m.m.Lock()
defer m.m.Unlock()

return m.proConfig
}

func (m *manager) Init() (*synccontext.RegisterContext, error) {
return m.InitWithOptions(Options{})
}
Expand Down Expand Up @@ -143,6 +152,7 @@ func (m *manager) InitWithOptions(opts Options) (*synccontext.RegisterContext, e
}

m.context = contextutil.ToRegisterContext(controllerCtx)
m.proConfig = initConfig.Pro
return m.context, nil
}

Expand Down
Loading

0 comments on commit d2dfb12

Please sign in to comment.