Skip to content

Commit a82ceaa

Browse files
committed
HYPERFLEET-551 - feat: use configuration standard
1 parent 7bfce2d commit a82ceaa

68 files changed

Lines changed: 4691 additions & 6044 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cd hyperfleet-adapter
3434
### Install Dependencies
3535

3636
```bash
37-
make tidy
37+
make mod-tidy
3838
```
3939

4040
### Build
@@ -128,9 +128,9 @@ hyperfleet-adapter/
128128
| `make image-push` | Build and push container image to registry |
129129
| `make image-dev` | Build and push to personal Quay registry (requires QUAY_USER) |
130130
| `make fmt` | Format code |
131-
| `make tidy` | Tidy Go module dependencies |
131+
| `make mod-tidy` | Tidy Go module dependencies |
132132
| `make clean` | Clean build artifacts |
133-
| `make verify` | Run format check and go vet |
133+
| `make verify` | Run lint and test |
134134

135135
💡 **Tip:** Use `make help` to see all available targets with descriptions
136136

@@ -169,7 +169,7 @@ A HyperFleet Adapter requires several files for configuration:
169169
- **Adapter Task config**: Configures the adapter task steps that will create resources
170170
- **Broker configuration**: Configures the specific broker to use by the adapter framework to receive CloudEvents
171171

172-
To see all configuration options read [configuration.md](configuration.md) file
172+
To see all configuration options read [configuration.md](docs/configuration.md) file
173173

174174
#### Adapter configuration
175175

@@ -178,14 +178,16 @@ settings for the adapter process, such as client connections, retries, and broke
178178
subscription details. It is loaded with Viper, so values can be overridden by CLI flags
179179
and environment variables in this priority order: CLI flags > env vars > file > defaults.
180180

181+
Fields use **snake_case** naming.
182+
181183
- **Path**: `HYPERFLEET_ADAPTER_CONFIG` (required)
182-
- **Common fields**: `spec.adapter.version`, `spec.debugConfig`, `spec.clients.*`
183-
(HyperFleet API, Maestro, broker, Kubernetes)
184+
- **Common fields**: `adapter.name`, `adapter.version`, `debug_config`, `clients.*`
185+
(HyperFleet API: `clients.hyperfleet_api`, Maestro: `clients.maestro`, broker: `clients.broker`, Kubernetes: `clients.kubernetes`)
184186

185187
Reference examples:
186188

187189
- `configs/adapter-deployment-config.yaml` (full reference with env/flag notes)
188-
- `charts/examples/adapter-config.yaml` (minimal deployment example)
190+
- `charts/examples/kubernetes/adapter-config.yaml` (minimal deployment example)
189191

190192
#### Adapter task configuration
191193

@@ -194,12 +196,12 @@ processing events: parameters, preconditions, resources to create, and post-acti
194196
This file is loaded as **static YAML** (no Viper overrides) and is required at runtime.
195197

196198
- **Path**: `HYPERFLEET_TASK_CONFIG` (required)
197-
- **Key sections**: `spec.params`, `spec.preconditions`, `spec.resources`, `spec.post`
199+
- **Key sections**: `params`, `preconditions`, `resources`, `post`
198200
- **Resource manifests**: inline YAML or external file via `manifest.ref`
199201

200202
Reference examples:
201203

202-
- `charts/examples/adapter-task-config.yaml` (worked example)
204+
- `charts/examples/kubernetes/adapter-task-config.yaml` (worked example)
203205
- `configs/adapter-task-config-template.yaml` (complete schema reference)
204206

205207
### Broker Configuration

charts/examples/README.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ This directory contains example configurations for deploying the HyperFleet Adap
88
|-----------|-----------|-------------|
99
| [`kubernetes/`](./kubernetes/) | Kubernetes only | Creates resources directly in the local cluster using the Kubernetes client |
1010
| [`maestro/`](./maestro/) | Maestro only | Deploys resources to a remote cluster via Maestro using ManifestWork |
11-
| [`maestro-kubernetes/`](./maestro-kubernetes/) | Maestro + Kubernetes | Hybrid example combining both transport clients in a single task |
1211

1312
---
1413

@@ -22,6 +21,7 @@ Creates the following resources directly in the local cluster via the Kubernetes
2221
- An Nginx Deployment in the adapter's own namespace
2322

2423
**Key features demonstrated:**
24+
2525
- Inline manifests and external file references (`ref:`)
2626
- Preconditions with Hyperfleet API calls and CEL expressions
2727
- Resource discovery by name and label selectors
@@ -42,6 +42,7 @@ Deploys resources to a remote cluster through Maestro (Open Cluster Management)
4242
- Nested resource discovery within the ManifestWork result
4343

4444
**Key features demonstrated:**
45+
4546
- Maestro transport client configuration (gRPC + HTTP)
4647
- ManifestWork template with external file reference (`ref:`)
4748
- Resource discovery by name and by label selectors (`nestedDiscoveries`)
@@ -52,20 +53,6 @@ See [`maestro/README.md`](./maestro/README.md) for full details.
5253

5354
---
5455

55-
### `maestro-kubernetes/` — Hybrid Maestro + Kubernetes
56-
57-
Combines both transport clients in a single adapter task:
58-
59-
- A ManifestWork delivered via Maestro to a remote cluster (Namespace + ConfigMap)
60-
- A Namespace created directly in the local cluster via the Kubernetes client
61-
62-
**Key features demonstrated:**
63-
- Using multiple transport clients (`maestro` and `kubernetes`) within the same task
64-
- Per-resource transport selection via the `transport.client` field
65-
- Kubernetes transport as the default fallback when `transport` is omitted
66-
67-
---
68-
6956
## Common Configuration
7057

7158
All examples share the same broker and image placeholders that must be updated before deployment.
Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
11
# Example HyperFleet Adapter deployment configuration
2-
apiVersion: hyperfleet.redhat.com/v1alpha1
3-
kind: AdapterConfig
4-
metadata:
2+
adapter:
53
name: kubernetes-example
6-
labels:
7-
hyperfleet.io/adapter-type: kubernetes-example
8-
hyperfleet.io/component: adapter
9-
spec:
10-
adapter:
11-
version: "0.1.0"
4+
#version: "0.1.0"
125

13-
# Log the full merged configuration after load (default: false)
14-
debugConfig: true
15-
log:
16-
level: debug
6+
# Log the full merged configuration after load (default: false)
7+
debug_config: true
8+
log:
9+
level: debug
1710

18-
clients:
19-
hyperfleetApi:
20-
baseUrl: http://hyperfleet-api:8000
21-
version: v1
22-
timeout: 2s
23-
retryAttempts: 3
24-
retryBackoff: exponential
11+
clients:
12+
hyperfleet_api:
13+
base_url: http://hyperfleet-api:8000
14+
version: v1
15+
timeout: 2s
16+
retry_attempts: 3
17+
retry_backoff: exponential
2518

26-
broker:
27-
subscriptionId: "CHANGE_ME"
28-
topic: "CHANGE_ME"
19+
broker:
20+
subscription_id: "CHANGE_ME"
21+
topic: "CHANGE_ME"
2922

30-
kubernetes:
31-
apiVersion: "v1"
32-
#kubeConfigPath: PATH_TO_KUBECONFIG # for local development
23+
kubernetes:
24+
api_version: "v1"
25+
#kube_config_path: PATH_TO_KUBECONFIG # for local development

0 commit comments

Comments
 (0)