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

chore: back port agent changes to develop #3995

Merged
merged 1 commit into from
Jun 8, 2023
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
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