Skip to content

Commit ada7305

Browse files
committed
refactor: Rename module from hyperfleet to hyperfleet-api
- Rename cmd/hyperfleet directory to cmd/hyperfleet-api - Update go.mod module path to github.com/openshift-hyperfleet/hyperfleet-api - Replace all 223 import path occurrences across 81 Go files - Update Makefile ldflags, binary, and install targets - Verify build compiles successfully with new module name This ensures naming consistency across: - Repository name: hyperfleet-api - Binary name: hyperfleet-api - Go module: github.com/openshift-hyperfleet/hyperfleet-api - Command directory: cmd/hyperfleet-api update
1 parent 80ae5d6 commit ada7305

File tree

97 files changed

+236
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+236
-225
lines changed

CLAUDE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ HyperFleet API is one component in the HyperFleet architecture:
1212

1313
- **HyperFleet API** (this service): Pure CRUD data layer with PostgreSQL
1414
- **Sentinel Service**: Centralized business logic and event publishing
15-
- **Adapters**: Execute operations (Hive, Hypershift, etc.) and report status back to API
15+
- **Adapters**: Execute operations (DNS, Hypershift, etc.) and report status back to API
1616

1717
The API's role is strictly limited to:
1818
1. Accept resource creation/update/delete requests
@@ -236,7 +236,7 @@ The API calculates aggregate status from adapter-specific conditions:
236236
**Adapter Status Structure**:
237237
```json
238238
{
239-
"adapter": "hive-adapter",
239+
"adapter": "dns-adapter",
240240
"observed_generation": 1,
241241
"conditions": [
242242
{
@@ -390,6 +390,11 @@ All subcommands support these logging flags:
390390

391391
```bash
392392
# Prerequisites: Go 1.24, Podman, PostgreSQL client tools
393+
394+
# Generate OpenAPI code (required before go mod download)
395+
make generate
396+
397+
# Install dependencies
393398
go install gotest.tools/gotestsum@latest
394399
go mod download
395400

Dockerfile.openapi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ RUN bash /usr/local/bin/docker-entrypoint.sh generate -i /local/openapi/openapi.
3131
RUN rm /local/pkg/api/openapi/go.mod /local/pkg/api/openapi/go.sum
3232
RUN rm -r /local/pkg/api/openapi/test
3333
# Run go generate
34-
RUN go generate /local/cmd/hyperfleet/main.go
34+
RUN go generate /local/cmd/hyperfleet-api/main.go
3535
RUN gofmt -w /local/pkg/api/openapi

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ git_sha:=$(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
6464
git_dirty:=$(shell git diff --quiet 2>/dev/null || echo "-modified")
6565
build_version:=$(git_sha)$(git_dirty)
6666
build_time:=$(shell date -u '+%Y-%m-%d %H:%M:%S UTC')
67-
ldflags=-X github.com/openshift-hyperfleet/hyperfleet/pkg/api.Version=$(build_version) -X 'github.com/openshift-hyperfleet/hyperfleet/pkg/api.BuildTime=$(build_time)'
67+
ldflags=-X github.com/openshift-hyperfleet/hyperfleet-api/pkg/api.Version=$(build_version) -X 'github.com/openshift-hyperfleet/hyperfleet-api/pkg/api.BuildTime=$(build_time)'
6868

6969
### Envrionment-sourced variables with defaults
7070
# Can be overriden by setting environment var before running
@@ -122,12 +122,12 @@ lint:
122122
# NOTE it may be necessary to use CGO_ENABLED=0 for backwards compatibility with centos7 if not using centos7
123123
binary: check-gopath
124124
echo "Building version: ${build_version}"
125-
${GO} build -ldflags="$(ldflags)" -o hyperfleet-api ./cmd/hyperfleet
125+
${GO} build -ldflags="$(ldflags)" -o hyperfleet-api ./cmd/hyperfleet-api
126126
.PHONY: binary
127127

128128
# Install
129129
install: check-gopath
130-
CGO_ENABLED=$(CGO_ENABLED) GOEXPERIMENT=boringcrypto ${GO} install -ldflags="$(ldflags)" ./cmd/hyperfleet
130+
CGO_ENABLED=$(CGO_ENABLED) GOEXPERIMENT=boringcrypto ${GO} install -ldflags="$(ldflags)" ./cmd/hyperfleet-api
131131
@ ${GO} version | grep -q "$(GO_VERSION)" || \
132132
( \
133133
printf '\033[41m\033[97m\n'; \
@@ -246,6 +246,7 @@ clean:
246246
rm -rf \
247247
$(binary) \
248248
data/generated/openapi/*.json \
249+
secrets \
249250
.PHONY: clean
250251

251252
.PHONY: cmds
@@ -260,7 +261,7 @@ cmds:
260261

261262

262263
.PHONY: db/setup
263-
db/setup:
264+
db/setup: secrets
264265
@echo $(db_password) > $(db_password_file)
265266
$(container_tool) run --name psql-hyperfleet -e POSTGRES_DB=$(db_name) -e POSTGRES_USER=$(db_user) -e POSTGRES_PASSWORD=$(db_password) -p $(db_port):5432 -d $(db_image)
266267

PREREQUISITES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ ocm version # OCM CLI (production auth only)
7676
Once all prerequisites are installed, follow the development workflow in README.md:
7777

7878
```bash
79+
# Generate OpenAPI code (required before go mod download)
80+
make generate
81+
7982
# Install Go dependencies
8083
go mod download
8184
go install gotest.tools/gotestsum@latest

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ Resources report status through adapter-specific condition sets following Kubern
137137
**Structure:**
138138
```json
139139
{
140-
"adapter": "hive-adapter",
140+
"adapter": "dns-adapter",
141141
"observed_generation": 1,
142142
"conditions": [
143143
{
144-
"adapter": "hive-adapter",
144+
"adapter": "dns-adapter",
145145
"type": "Ready",
146146
"status": "True",
147147
"observed_generation": 1,
@@ -196,13 +196,13 @@ Before running hyperfleet-api, ensure these prerequisites are installed. See [PR
196196
### Initial Setup
197197

198198
```bash
199-
# 1. Install dependencies
199+
# 1. Generate OpenAPI code (must run first as pkg/api/openapi is required by go.mod)
200+
make generate
201+
202+
# 2. Install dependencies
200203
go install gotest.tools/gotestsum@latest
201204
go mod download
202205

203-
# 2. Generate OpenAPI code
204-
make generate
205-
206206
# 3. Build the binary
207207
make binary
208208

@@ -480,16 +480,18 @@ curl -X POST http://localhost:8000/api/hyperfleet/v1/clusters/$CLUSTER_ID/nodepo
480480
curl -X POST http://localhost:8000/api/hyperfleet/v1/clusters/$CLUSTER_ID/statuses \
481481
-H "Content-Type: application/json" \
482482
-d '{
483-
"adapter": "hive-adapter",
483+
"adapter": "dns-adapter",
484484
"observed_generation": 1,
485485
"conditions": [
486486
{
487-
"adapter": "hive-adapter",
487+
"adapter": "dns-adapter",
488488
"type": "Ready",
489489
"status": "True",
490490
"observed_generation": 1,
491491
"reason": "ClusterProvisioned",
492-
"message": "Cluster successfully provisioned"
492+
"message": "Cluster successfully provisioned",
493+
"created_at": "2025-11-17T15:04:05Z",
494+
"updated_at": "2025-11-17T15:04:05Z"
493495
}
494496
]
495497
}' | jq

cmd/hyperfleet/environments/e_development.go renamed to cmd/hyperfleet-api/environments/e_development.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package environments
22

33
import (
4-
"github.com/openshift-hyperfleet/hyperfleet/pkg/config"
5-
"github.com/openshift-hyperfleet/hyperfleet/pkg/db/db_session"
4+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/config"
5+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/db/db_session"
66
)
77

88
// devEnvImpl environment is intended for local use while developing features

cmd/hyperfleet/environments/e_integration_testing.go renamed to cmd/hyperfleet-api/environments/e_integration_testing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package environments
33
import (
44
"os"
55

6-
"github.com/openshift-hyperfleet/hyperfleet/pkg/config"
7-
"github.com/openshift-hyperfleet/hyperfleet/pkg/db/db_session"
6+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/config"
7+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/db/db_session"
88
)
99

1010
var _ EnvironmentImpl = &integrationTestingEnvImpl{}

cmd/hyperfleet/environments/e_production.go renamed to cmd/hyperfleet-api/environments/e_production.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package environments
22

33
import (
4-
"github.com/openshift-hyperfleet/hyperfleet/pkg/config"
5-
"github.com/openshift-hyperfleet/hyperfleet/pkg/db/db_session"
4+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/config"
5+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/db/db_session"
66
)
77

88
var _ EnvironmentImpl = &productionEnvImpl{}

cmd/hyperfleet/environments/e_unit_testing.go renamed to cmd/hyperfleet-api/environments/e_unit_testing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package environments
33
import (
44
"os"
55

6-
"github.com/openshift-hyperfleet/hyperfleet/pkg/config"
7-
dbmocks "github.com/openshift-hyperfleet/hyperfleet/pkg/db/mocks"
6+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/config"
7+
dbmocks "github.com/openshift-hyperfleet/hyperfleet-api/pkg/db/mocks"
88
)
99

1010
var _ EnvironmentImpl = &unitTestingEnvImpl{}

cmd/hyperfleet/environments/framework.go renamed to cmd/hyperfleet-api/environments/framework.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
"github.com/golang/glog"
88
"github.com/spf13/pflag"
99

10-
"github.com/openshift-hyperfleet/hyperfleet/cmd/hyperfleet/environments/registry"
11-
"github.com/openshift-hyperfleet/hyperfleet/pkg/client/ocm"
12-
"github.com/openshift-hyperfleet/hyperfleet/pkg/config"
13-
"github.com/openshift-hyperfleet/hyperfleet/pkg/errors"
10+
"github.com/openshift-hyperfleet/hyperfleet-api/cmd/hyperfleet-api/environments/registry"
11+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/client/ocm"
12+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/config"
13+
"github.com/openshift-hyperfleet/hyperfleet-api/pkg/errors"
1414
)
1515

1616
func init() {

0 commit comments

Comments
 (0)