Skip to content

Commit

Permalink
chore: back port agent changes to develop
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv committed Jun 8, 2023
1 parent 938da8f commit 8c07bb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/kubectl-testkube/commands/common/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func HelmUpgradeOrInstallTestkubeCloud(options HelmOptions, cfg config.Data) err
"--namespace", options.Namespace,
"--set", "testkube-api.cloud.url=" + options.CloudUris.Agent,
"--set", "testkube-api.cloud.key=" + options.CloudAgentToken,
"--set", "testkube-api.cloud.migrate=true",
}

args = append(args, "--set", fmt.Sprintf("testkube-dashboard.enabled=%t", !options.NoDashboard))
Expand Down
3 changes: 3 additions & 0 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"math"
"os"
"time"

"github.com/kubeshop/testkube/pkg/executor/output"
Expand All @@ -27,6 +28,7 @@ import (
const (
apiKeyMeta = "api-key"
clusterIDMeta = "cluster-id"
cloudMigrate = "migrate"
healthcheckCommand = "healthcheck"
)

Expand Down Expand Up @@ -200,6 +202,7 @@ func (ag *Agent) runCommandLoop(ctx context.Context) error {
ctx = AddAPIKeyMeta(ctx, ag.apiKey)

ctx = metadata.AppendToOutgoingContext(ctx, clusterIDMeta, ag.clusterID)
ctx = metadata.AppendToOutgoingContext(ctx, cloudMigrate, os.Getenv("TESTKUBE_CLOUD_MIGRATE"))

ag.logger.Infow("initiating streaming connection with Cloud API")
// creates a new Stream from the client side. ctx is used for the lifetime of the stream.
Expand Down

0 comments on commit 8c07bb8

Please sign in to comment.