Skip to content

Commit 42a3251

Browse files
authored
Complete the move of cmd/thv-registry-api outside of toolhive (#2244)
* Complete the move of cmd/thv-registry-api outside of toolhive Signed-off-by: Radoslav Dimitrov <[email protected]> * Bump operator Helm chart version to 0.2.24 Signed-off-by: Radoslav Dimitrov <[email protected]> * Restore registry-api RBAC templates and fix local dev workflow Signed-off-by: Radoslav Dimitrov <[email protected]> --------- Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent becb6f5 commit 42a3251

31 files changed

+15
-5337
lines changed

Taskfile.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ includes:
44
operator:
55
taskfile: ./cmd/thv-operator/Taskfile.yml
66
flatten: true
7-
registry-api:
8-
taskfile: ./cmd/thv-registry-api/Taskfile.yml
9-
flatten: true
107

118
tasks:
129
docs:
@@ -15,7 +12,7 @@ tasks:
1512
cmds:
1613
- rm -rf docs/cli/*
1714
- go run cmd/help/main.go --dir docs/cli
18-
- swag init -g pkg/api/server.go --v3.1 -o docs/server --exclude ./cmd/thv-registry-api
15+
- swag init -g pkg/api/server.go --v3.1 -o docs/server
1916

2017
swagger-install:
2118
desc: Install the swag tool for OpenAPI/Swagger generation

cmd/help/verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ diff -Naur -I "^ date:" "$tmpdir" docs/cli/
99
# Generate API docs in temp directory that mimics the final structure
1010
api_tmpdir=$(mktemp -d)
1111
mkdir -p "$api_tmpdir/server"
12-
swag init -g pkg/api/server.go --v3.1 -o "$api_tmpdir/server" --exclude ./cmd/thv-registry-api
12+
swag init -g pkg/api/server.go --v3.1 -o "$api_tmpdir/server"
1313
# Exclude README.md from diff as it's manually maintained
1414
diff -Naur --exclude="README.md" "$api_tmpdir/server" docs/server/
1515

cmd/thv-operator/Taskfile.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,24 +125,24 @@ tasks:
125125
operator-deploy-local:
126126
desc: |
127127
Build the ToolHive runtime and Operator image locally and deploy it to the K8s cluster.
128-
Set ENABLE_EXPERIMENTAL_FEATURES=true to enable experimental features in the operator
129-
and automatically build and deploy the registry API image.
128+
Set ENABLE_EXPERIMENTAL_FEATURES=true to enable experimental features in the operator.
129+
Registry API image is pulled from ghcr.io/stacklok/thv-registry-api:latest
130130
Example: task operator-deploy-local ENABLE_EXPERIMENTAL_FEATURES=true
131131
platforms: [linux, darwin]
132132
vars:
133133
ENABLE_EXPERIMENTAL_FEATURES: '{{.ENABLE_EXPERIMENTAL_FEATURES | default "false"}}'
134+
REGISTRY_API_IMAGE: '{{.REGISTRY_API_IMAGE | default "ghcr.io/stacklok/thv-registry-api:latest"}}'
134135
OPERATOR_IMAGE:
135136
sh: KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/thv-operator | tail -n 1
136137
TOOLHIVE_IMAGE:
137138
sh: KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/thv-proxyrunner | tail -n 1
138-
REGISTRY_API_IMAGE:
139-
sh: KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/thv-registry-api | tail -n 1
140139
cmds:
141140
- echo "Loading toolhive operator image {{.OPERATOR_IMAGE}} into kind..."
142141
- kind load docker-image --name toolhive {{.OPERATOR_IMAGE}}
143142
- echo "Loading toolhive image {{.TOOLHIVE_IMAGE}} into kind..."
144143
- kind load docker-image --name toolhive {{.TOOLHIVE_IMAGE}}
145-
- echo "Loading registry API image {{.REGISTRY_API_IMAGE}} into kind..."
144+
- echo "Pulling and loading registry API image {{.REGISTRY_API_IMAGE}} into kind..."
145+
- docker pull {{.REGISTRY_API_IMAGE}}
146146
- kind load docker-image --name toolhive {{.REGISTRY_API_IMAGE}}
147147
- |
148148
helm upgrade --install toolhive-operator deploy/charts/operator \

cmd/thv-operator/pkg/registryapi/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func getRegistryAPIImageWithEnvGetter(envGetter func(string) string) string {
249249
if img := envGetter("TOOLHIVE_REGISTRY_API_IMAGE"); img != "" {
250250
return img
251251
}
252-
return "ghcr.io/stacklok/toolhive/thv-registry-api:latest"
252+
return "ghcr.io/stacklok/thv-registry-api:latest"
253253
}
254254

255255
// findContainerByName finds a container by name in a slice of containers

cmd/thv-operator/pkg/registryapi/deployment_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,14 @@ func TestGetRegistryAPIImage(t *testing.T) {
208208
{
209209
name: "default image when env not set",
210210
setEnv: false,
211-
expected: "ghcr.io/stacklok/toolhive/thv-registry-api:latest",
211+
expected: "ghcr.io/stacklok/thv-registry-api:latest",
212212
description: "Should return default image when environment variable is not set",
213213
},
214214
{
215215
name: "default image when env empty",
216216
envValue: "",
217217
setEnv: true,
218-
expected: "ghcr.io/stacklok/toolhive/thv-registry-api:latest",
218+
expected: "ghcr.io/stacklok/thv-registry-api:latest",
219219
description: "Should return default image when environment variable is empty",
220220
},
221221
{

cmd/thv-registry-api/Taskfile.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)