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

fix: [TKC-2774] use default cloud url #5946

Merged
merged 1 commit into from
Oct 21, 2024
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
4 changes: 4 additions & 0 deletions .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ jobs:
build_agent_image:
name: Build a Docker image for Testkube Agent
runs-on: ubuntu-latest
env:
TESTKUBE_CLOUD_URL: "agent.testkube.io:443"

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -163,6 +166,7 @@ jobs:
ga_id=${{secrets.TESTKUBE_CLI_GA_MEASUREMENT_ID}}
ga_secret=${{secrets.TESTKUBE_CLI_GA_MEASUREMENT_SECRET}}
docker_image_version=${{steps.tag.outputs.tag}}
cloud_url=${{ env.TESTKUBE_CLOUD_URL }}
context: build/kind
file: build/kind/kind.Dockerfile
platforms: linux/amd64,linux/arm64/v8
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ jobs:
build_agent_image:
name: Build a Docker image for Testkube Agent
runs-on: ubuntu-latest
env:
TESTKUBE_CLOUD_URL: "agent.testkube.io:443"

steps:
- name: Checkout
Expand Down Expand Up @@ -155,6 +157,7 @@ jobs:
ga_id=${{secrets.TESTKUBE_CLI_GA_MEASUREMENT_ID}}
ga_secret=${{secrets.TESTKUBE_CLI_GA_MEASUREMENT_SECRET}}
docker_image_version=${{steps.tag.outputs.tag}}
cloud_url=${{ env.TESTKUBE_CLOUD_URL }}
context: build/kind
file: build/kind/kind.Dockerfile
platforms: linux/amd64,linux/arm64
Expand Down
7 changes: 0 additions & 7 deletions build/kind/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,6 @@ if [ -z "$AGENT_KEY" ]; then
exit 1
fi

# Check if cloud url is provided
if [ -z "$CLOUD_URL" ]; then
log "Testkube installation failed. Please provide CLOUD_URL env var"
send_telenetry "docker_installation_failed" "parameter_not_found" "cloud url is empty"
exit 1
fi

# Step 1: Start docker service in background
/usr/local/bin/dockerd-entrypoint.sh &

Expand Down
2 changes: 2 additions & 0 deletions build/kind/kind.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ ARG ga_secret
ENV GA_SECRET=$ga_secret
ARG docker_image_version
ENV DOCKER_IMAGE_VERSION=$docker_image_version
ARG cloud_url
ENV CLOUD_URL=$cloud_url

# Step 8: Set Docker entry point for DIND (Docker-in-Docker)
ENTRYPOINT ["tini", "--", "/usr/local/bin/entrypoint.sh"]
11 changes: 8 additions & 3 deletions cmd/kubectl-testkube/commands/common/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func CreateVariables(cmd *cobra.Command, ignoreSecretVariable bool) (vars map[st
return
}

func PopulateMasterFlags(cmd *cobra.Command, opts *HelmOptions, optionalIds bool) {
func PopulateMasterFlags(cmd *cobra.Command, opts *HelmOptions, isDockerCmd bool) {
var (
apiURIPrefix, uiURIPrefix, agentURIPrefix, cloudRootDomain, proRootDomain string
insecure bool
Expand All @@ -85,11 +85,16 @@ func PopulateMasterFlags(cmd *cobra.Command, opts *HelmOptions, optionalIds bool
cmd.Flags().StringVar(&opts.Master.UiUrlPrefix, "ui-prefix", defaultUiPrefix, "usually don't need to be changed [required for custom cloud mode]")
cmd.Flags().StringVar(&opts.Master.RootDomain, "root-domain", defaultRootDomain, "usually don't need to be changed [required for custom cloud mode]")

cmd.Flags().StringVar(&opts.Master.URIs.Agent, "agent-uri", "", "Testkube Pro agent URI [required for centralized mode]")
agentURI := ""
if isDockerCmd {
agentURI = "agent.testkube.io:443"
}

cmd.Flags().StringVar(&opts.Master.URIs.Agent, "agent-uri", agentURI, "Testkube Pro agent URI [required for centralized mode]")
cmd.Flags().StringVar(&opts.Master.URIs.Logs, "logs-uri", "", "Testkube Pro logs URI [required for centralized mode]")
cmd.Flags().StringVar(&opts.Master.AgentToken, "agent-token", "", "Testkube Pro agent key [required for centralized mode]")
neededForLogin := ""
if optionalIds {
if isDockerCmd {
neededForLogin = ". It can be skipped for no login mode"
}

Expand Down
Loading