Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 1 addition & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ includes:
operator:
taskfile: ./cmd/thv-operator/Taskfile.yml
flatten: true
registry-api:
taskfile: ./cmd/thv-registry-api/Taskfile.yml
flatten: true

tasks:
docs:
Expand All @@ -15,7 +12,7 @@ tasks:
cmds:
- rm -rf docs/cli/*
- go run cmd/help/main.go --dir docs/cli
- swag init -g pkg/api/server.go --v3.1 -o docs/server --exclude ./cmd/thv-registry-api
- swag init -g pkg/api/server.go --v3.1 -o docs/server

swagger-install:
desc: Install the swag tool for OpenAPI/Swagger generation
Expand Down
2 changes: 1 addition & 1 deletion cmd/help/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ diff -Naur -I "^ date:" "$tmpdir" docs/cli/
# Generate API docs in temp directory that mimics the final structure
api_tmpdir=$(mktemp -d)
mkdir -p "$api_tmpdir/server"
swag init -g pkg/api/server.go --v3.1 -o "$api_tmpdir/server" --exclude ./cmd/thv-registry-api
swag init -g pkg/api/server.go --v3.1 -o "$api_tmpdir/server"
# Exclude README.md from diff as it's manually maintained
diff -Naur --exclude="README.md" "$api_tmpdir/server" docs/server/

Expand Down
9 changes: 2 additions & 7 deletions cmd/thv-operator/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ tasks:
operator-deploy-local:
desc: |
Build the ToolHive runtime and Operator image locally and deploy it to the K8s cluster.
Set ENABLE_EXPERIMENTAL_FEATURES=true to enable experimental features in the operator
and automatically build and deploy the registry API image.
Set ENABLE_EXPERIMENTAL_FEATURES=true to enable experimental features in the operator.
Note: Registry API image is pulled from ghcr.io/stacklok/thv-registry-api:latest
Example: task operator-deploy-local ENABLE_EXPERIMENTAL_FEATURES=true
platforms: [linux, darwin]
vars:
Expand All @@ -135,21 +135,16 @@ tasks:
sh: KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/thv-operator | tail -n 1
TOOLHIVE_IMAGE:
sh: KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/thv-proxyrunner | tail -n 1
REGISTRY_API_IMAGE:
sh: KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/thv-registry-api | tail -n 1
cmds:
- echo "Loading toolhive operator image {{.OPERATOR_IMAGE}} into kind..."
- kind load docker-image --name toolhive {{.OPERATOR_IMAGE}}
- echo "Loading toolhive image {{.TOOLHIVE_IMAGE}} into kind..."
- kind load docker-image --name toolhive {{.TOOLHIVE_IMAGE}}
- echo "Loading registry API image {{.REGISTRY_API_IMAGE}} into kind..."
- kind load docker-image --name toolhive {{.REGISTRY_API_IMAGE}}
- |
helm upgrade --install toolhive-operator deploy/charts/operator \
--set operator.image={{.OPERATOR_IMAGE}} \
--set operator.toolhiveRunnerImage={{.TOOLHIVE_IMAGE}} \
--set operator.features.experimental={{.ENABLE_EXPERIMENTAL_FEATURES}} \
--set registryAPI.image={{.REGISTRY_API_IMAGE}} \
--namespace toolhive-system \
--create-namespace \
--kubeconfig kconfig.yaml \
Expand Down
2 changes: 1 addition & 1 deletion cmd/thv-operator/pkg/registryapi/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func getRegistryAPIImageWithEnvGetter(envGetter func(string) string) string {
if img := envGetter("TOOLHIVE_REGISTRY_API_IMAGE"); img != "" {
return img
}
return "ghcr.io/stacklok/toolhive/thv-registry-api:latest"
return "ghcr.io/stacklok/thv-registry-api:latest"
}

// findContainerByName finds a container by name in a slice of containers
Expand Down
4 changes: 2 additions & 2 deletions cmd/thv-operator/pkg/registryapi/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,14 @@ func TestGetRegistryAPIImage(t *testing.T) {
{
name: "default image when env not set",
setEnv: false,
expected: "ghcr.io/stacklok/toolhive/thv-registry-api:latest",
expected: "ghcr.io/stacklok/thv-registry-api:latest",
description: "Should return default image when environment variable is not set",
},
{
name: "default image when env empty",
envValue: "",
setEnv: true,
expected: "ghcr.io/stacklok/toolhive/thv-registry-api:latest",
expected: "ghcr.io/stacklok/thv-registry-api:latest",
description: "Should return default image when environment variable is empty",
},
{
Expand Down
24 changes: 0 additions & 24 deletions cmd/thv-registry-api/Taskfile.yml

This file was deleted.

Loading
Loading