@@ -32,7 +32,7 @@ import (
3232)
3333
3434func InstallOrUpgradeAgent (ctx context.Context , client * client.Client , kubeconfig * common.Kubeconfig , kubeClient * common.KubeClient ,
35- repoUrl string , values * string , consoleUrl string , token string , d * diag.Diagnostics ) error {
35+ repoUrl string , values * string , consoleUrl string , token string , clusterId string , d * diag.Diagnostics ) error {
3636 workingDir , chartPath , err := fetchVendoredAgentChart (consoleUrl )
3737 if err != nil {
3838 d .AddWarning ("Client Warning" , fmt .Sprintf ("Could not fetch vendored agent chart, using chart from the registry: %s" , err ))
@@ -53,7 +53,7 @@ func InstallOrUpgradeAgent(ctx context.Context, client *client.Client, kubeconfi
5353 }
5454 }
5555
56- handler , err := NewOperatorHandler (ctx , client , kubeClient , repoUrl , chartPath , values , consoleUrl , token )
56+ handler , err := NewOperatorHandler (ctx , client , kubeClient , repoUrl , chartPath , values , consoleUrl , token , clusterId )
5757 if err != nil {
5858 return err
5959 }
@@ -82,7 +82,7 @@ func fetchVendoredAgentChart(consoleURL string) (string, string, error) {
8282}
8383
8484func NewOperatorHandler (ctx context.Context , client * client.Client , kubeClient * common.KubeClient ,
85- repoUrl , chartPath string , values * string , consoleUrl , token string ) (* OperatorHandler , error ) {
85+ repoUrl , chartPath string , values * string , consoleUrl , token string , clusterId string ) (* OperatorHandler , error ) {
8686 settings , err := client .GetDeploymentSettings (ctx )
8787 if err != nil {
8888 return nil , err
@@ -108,6 +108,7 @@ func NewOperatorHandler(ctx context.Context, client *client.Client, kubeClient *
108108 clientSet : clientSet ,
109109 vendoredChartPath : chartPath ,
110110 additionalValues : additionalValues ,
111+ clusterId : clusterId ,
111112 }
112113
113114 if err := handler .init (kubeClient , repoUrl ); err != nil {
@@ -123,6 +124,7 @@ type OperatorHandler struct {
123124 deployToken string
124125 settings * gqlclient.DeploymentSettingsFragment
125126 clientSet * kubernetes.Clientset
127+ clusterId string
126128
127129 // vendoredChartPath contains a local path to vendored agent chart if it was downloadable, it is empty otherwise.
128130 vendoredChartPath string
@@ -264,5 +266,6 @@ func (oh *OperatorHandler) values() (map[string]any, error) {
264266 return algorithms .Merge (map [string ]any {
265267 "secrets" : map [string ]string {"deployToken" : oh .deployToken },
266268 "consoleUrl" : console .NormalizeExtUrl (oh .consoleURL ),
269+ "clusterId" : oh .clusterId ,
267270 }, oh .additionalValues , settingsValues ), nil
268271}
0 commit comments