-
Notifications
You must be signed in to change notification settings - Fork 6
HYPERFLEET-620 - test: add clusters namespace adapter configurations and remove unused file #23
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
Merged
openshift-merge-bot
merged 2 commits into
openshift-hyperfleet:main
from
86254860:HYPERFLEET-620-add-clusters-namespace
Feb 10, 2026
+213
−220
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
148 changes: 148 additions & 0 deletions
148
testdata/adapter-configs/clusters-cl-namespace/adapter-task-config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| # Simple valid HyperFleet Adapter Configuration for testing | ||
|
|
||
| apiVersion: hyperfleet.redhat.com/v1alpha1 | ||
| kind: AdapterTaskConfig | ||
| metadata: | ||
| name: cl-namespace | ||
| labels: | ||
| hyperfleet.io/adapter-type: cl-namespace | ||
| hyperfleet.io/component: adapter | ||
| spec: | ||
| # Parameters with all required variables | ||
| params: | ||
| - name: "clusterId" | ||
| source: "event.id" | ||
| type: "string" | ||
| required: true | ||
| - name: "testRunId" | ||
| source: "env.TEST_RUN_ID" | ||
| type: "string" | ||
| required: false | ||
| default: "TEST_RUN_ID" | ||
| - name: "ci" | ||
| source: "env.CI" | ||
| type: "string" | ||
| required: false | ||
| default: "false" | ||
|
|
||
| # Preconditions with valid operators and CEL expressions | ||
| preconditions: | ||
| - name: "clusterStatus" | ||
| apiCall: | ||
| method: "GET" | ||
| url: "/clusters/{{ .clusterId }}" | ||
| timeout: 10s | ||
| retryAttempts: 3 | ||
| retryBackoff: "exponential" | ||
| capture: | ||
| - name: "clusterName" | ||
| field: "name" | ||
| - name: "generationSpec" | ||
| field: "generation" | ||
| - name: "readyConditionStatus" | ||
| expression: | | ||
| status.conditions.filter(c, c.type == "Ready").size() > 0 | ||
| ? status.conditions.filter(c, c.type == "Ready")[0].status | ||
| : "False" | ||
| # Structured conditions with valid operators | ||
| conditions: | ||
| - field: "readyConditionStatus" | ||
| operator: "equals" | ||
| value: "False" | ||
|
|
||
| - name: "validationCheck" | ||
| # Valid CEL expression | ||
| expression: | | ||
| readyConditionStatus == "False" | ||
|
|
||
| # Resources with valid K8s manifests | ||
| resources: | ||
| - name: "clusterNamespace" | ||
| manifest: | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: "{{ .clusterId }}" | ||
| labels: | ||
| hyperfleet.io/cluster-id: "{{ .clusterId }}" | ||
| hyperfleet.io/cluster-name: "{{ .clusterName }}" | ||
| e2e.hyperfleet.io/test-run-id: "{{ .testRunId }}" | ||
| e2e.hyperfleet.io/ci: "{{ .ci }}" | ||
| e2e.hyperfleet.io/managed-by: "test-framework" | ||
| annotations: | ||
| hyperfleet.io/generation: "{{ .generationSpec }}" | ||
| discovery: | ||
| namespace: "*" # Cluster-scoped resource (Namespace) | ||
| bySelectors: | ||
| labelSelector: | ||
| hyperfleet.io/cluster-id: "{{ .clusterId }}" | ||
| hyperfleet.io/cluster-name: "{{ .clusterName }}" | ||
|
|
||
| # Post-processing with valid CEL expressions | ||
| # This example contains multiple resources, we will only report on the conditions of the jobNamespace not to overcomplicate the example | ||
| post: | ||
| payloads: | ||
| - name: "clusterStatusPayload" | ||
| build: | ||
| adapter: "{{ .metadata.name }}" | ||
| conditions: | ||
| # Applied: Job successfully created | ||
| - type: "Applied" | ||
| status: | ||
| expression: | | ||
| resources.?clusterNamespace.?status.?phase.orValue("") == "Active" ? "True" : "False" | ||
| reason: | ||
| expression: | | ||
| resources.?clusterNamespace.?status.?phase.orValue("") == "Active" | ||
| ? "NamespaceCreated" | ||
| : "NamespacePending" | ||
| message: | ||
| expression: | | ||
| resources.?clusterNamespace.?status.?phase.orValue("") == "Active" | ||
| ? "Namespace created successfully" | ||
| : "Namespace creation in progress" | ||
| # Available: Check job status conditions | ||
| - type: "Available" | ||
| status: | ||
| expression: | | ||
| resources.?clusterNamespace.?status.?phase.orValue("") == "Active" ? "True" : "False" | ||
| reason: | ||
| expression: | | ||
| resources.?clusterNamespace.?status.?phase.orValue("") == "Active" ? "NamespaceReady" : "NamespaceNotReady" | ||
| message: | ||
| expression: | | ||
| resources.?clusterNamespace.?status.?phase.orValue("") == "Active" ? "Namespace is active and ready" : "Namespace is not active and ready" | ||
| # Health: Adapter execution status (runtime) | ||
| - type: "Health" | ||
| status: | ||
| expression: | | ||
| adapter.?executionStatus.orValue("") == "success" ? "True" : "False" | ||
| reason: | ||
| expression: | | ||
| adapter.?errorReason.orValue("") != "" ? adapter.?errorReason.orValue("") : "Healthy" | ||
| message: | ||
| expression: | | ||
| adapter.?errorMessage.orValue("") != "" ? adapter.?errorMessage.orValue("") : "All adapter operations in progress or completed successfully" | ||
| # Event generation ID metadata field needs to use expression to avoid interpolation issues | ||
| observed_generation: | ||
| expression: "generationSpec" | ||
| observed_time: "{{ now | date \"2006-01-02T15:04:05Z07:00\" }}" | ||
|
|
||
| data: | ||
| namespace: | ||
| name: | ||
| expression: | | ||
| resources.?clusterNamespace.?metadata.?name.orValue("") | ||
| status: | ||
| expression: | | ||
| resources.?clusterNamespace.?status.?phase.orValue("") | ||
|
|
||
| postActions: | ||
| - name: "reportClusterStatus" | ||
| apiCall: | ||
| method: "POST" | ||
| url: "/clusters/{{ .clusterId }}/statuses" | ||
| headers: | ||
| - name: "Content-Type" | ||
| value: "application/json" | ||
| body: "{{ .clusterStatusPayload }}" | ||
28 changes: 28 additions & 0 deletions
28
testdata/adapter-configs/clusters-cl-namespace/adapterconfig.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| apiVersion: hyperfleet.redhat.com/v1alpha1 | ||
| kind: AdapterConfig | ||
| metadata: | ||
| name: cl-namespace | ||
| labels: | ||
| hyperfleet.io/adapter-type: cl-namespace | ||
| hyperfleet.io/component: adapter | ||
| spec: | ||
| adapter: | ||
| version: "0.1.0" | ||
|
|
||
| # Log the full merged configuration after load (default: false) | ||
| debugConfig: false | ||
|
|
||
| clients: | ||
| hyperfleetApi: | ||
| baseUrl: CHANGE_ME | ||
| version: v1 | ||
| timeout: 2s | ||
| retryAttempts: 3 | ||
| retryBackoff: exponential | ||
|
|
||
| broker: | ||
| subscriptionId: CHANGE_ME | ||
| topic: CHANGE_ME | ||
|
|
||
| kubernetes: | ||
| apiVersion: "v1" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.