mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 18:09:57 +00:00
add grpc config into the bootstrap secret (#1194)
Some checks failed
Post / coverage (push) Failing after 27s
Post / images (amd64, addon-manager) (push) Failing after 21s
Post / images (amd64, placement) (push) Failing after 23s
Post / images (amd64, registration) (push) Failing after 18s
Post / images (amd64, registration-operator) (push) Failing after 22s
Post / images (amd64, work) (push) Failing after 23s
Post / images (arm64, addon-manager) (push) Failing after 25s
Post / images (arm64, placement) (push) Failing after 21s
Post / images (arm64, registration) (push) Failing after 27s
Post / images (arm64, registration-operator) (push) Failing after 28s
Post / images (arm64, work) (push) Failing after 21s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 33s
Close stale issues and PRs / stale (push) Failing after 31s
Some checks failed
Post / coverage (push) Failing after 27s
Post / images (amd64, addon-manager) (push) Failing after 21s
Post / images (amd64, placement) (push) Failing after 23s
Post / images (amd64, registration) (push) Failing after 18s
Post / images (amd64, registration-operator) (push) Failing after 22s
Post / images (amd64, work) (push) Failing after 23s
Post / images (arm64, addon-manager) (push) Failing after 25s
Post / images (arm64, placement) (push) Failing after 21s
Post / images (arm64, registration) (push) Failing after 27s
Post / images (arm64, registration-operator) (push) Failing after 28s
Post / images (arm64, work) (push) Failing after 21s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Scorecard supply-chain security / Scorecard analysis (push) Failing after 33s
Close stale issues and PRs / stale (push) Failing after 31s
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
This commit is contained in:
@@ -65,6 +65,10 @@ type KlusterletChartConfig struct {
|
||||
// BootstrapHubKubeConfig should be the kubeConfig file of the hub cluster via setting --set-file=<the kubeConfig file of hub cluster> optional
|
||||
BootstrapHubKubeConfig string `json:"bootstrapHubKubeConfig,omitempty"`
|
||||
|
||||
// GRPCConfig includes the information needed to build connect to gRPC server in the bootstrap secret for
|
||||
// cluster importing via setting --set-file=<the grpc config file> optional.
|
||||
GRPCConfig string `json:"grpcConfig,omitempty"`
|
||||
|
||||
// when MultipleHubs feature gate in klusterlet.registrationConfiguration is enabled, need to set multiple bootstrap hub kubeConfigs here.
|
||||
MultiHubBootstrapHubKubeConfigs []BootStrapKubeConfig `json:"multiHubBootstrapHubKubeConfigs,omitempty"`
|
||||
|
||||
@@ -81,6 +85,7 @@ type BootStrapKubeConfig struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// the kubeConfig file of the hub cluster
|
||||
KubeConfig string `json:"kubeConfig,omitempty"`
|
||||
// TODO: add grpcConfig to support multiHubBootstrapHubKubeConfigs
|
||||
}
|
||||
|
||||
type ImagesConfig struct {
|
||||
|
||||
@@ -411,6 +411,20 @@ func TestKlusterletConfig(t *testing.T) {
|
||||
},
|
||||
expectedObjCnt: 7,
|
||||
},
|
||||
{
|
||||
name: "create namespace with bootstrap secret and grpc config",
|
||||
namespace: "open-cluster-management-agent",
|
||||
chartConfig: func() *KlusterletChartConfig {
|
||||
config := NewDefaultKlusterletChartConfig()
|
||||
config.Klusterlet.ClusterName = "testCluster"
|
||||
config.Klusterlet.Mode = operatorv1.InstallModeSingleton
|
||||
config.CreateNamespace = true
|
||||
config.BootstrapHubKubeConfig = "kubeconfig"
|
||||
config.GRPCConfig = "grpcconfig"
|
||||
return config
|
||||
},
|
||||
expectedObjCnt: 7,
|
||||
},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
@@ -569,6 +583,13 @@ func TestKlusterletConfig(t *testing.T) {
|
||||
if base64.StdEncoding.EncodeToString(data) == "" {
|
||||
t.Errorf("failed to render kubeconfig")
|
||||
}
|
||||
|
||||
if config.GRPCConfig != "" {
|
||||
grpcConfig := object.Data["config.yaml"]
|
||||
if base64.StdEncoding.EncodeToString(grpcConfig) == "" {
|
||||
t.Errorf("failed to render grpc config")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user