Reintroduce demo scripts - #6181
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nimrodshn The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Reintroduces a set of demo/ helper scripts and request templates intended to create/manage ARO-HCP clusters against a local development setup by issuing ARM-like calls to the RP frontend.
Changes:
- Added
demo/common.shcurl-based helpers for RP GET/PUT/DELETE requests and request headers. - Added numbered demo scripts to register the subscription, create customer infra, create a cluster + nodepool, and query/delete the cluster.
- Added JSON request templates for cluster and node pool creation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| demo/01-register-sub.sh | Registers the RP via az or via a local RP call (currently calls undefined helpers). |
| demo/02-customer-infra.sh | Creates customer-side infra (RG/VNET/NSG/KV/key) for the demo flow. |
| demo/03-create-cluster.sh | Creates required UAMIs and sends the cluster create request built from a template. |
| demo/04-create-nodepool.sh | Builds a nodepool request from template and sends RP PUT. |
| demo/05-delete-cluster.sh | Deletes the cluster via RP DELETE. |
| demo/query-cluster-rp.sh | Fetches the cluster via RP GET. |
| demo/common.sh | Shared request/header helpers used by the demo scripts. |
| demo/cluster.tmpl.json | Cluster request template consumed by 03-create-cluster.sh. |
| demo/node_pool.tmpl.json | Node pool request template consumed by 04-create-nodepool.sh. |
| if is_int_testing_subscription || is_stg_testing_subscription; then | ||
| az provider register --namespace "Microsoft.RedHatOpenShift" | ||
| else | ||
| rp_put_request "${SUBSCRIPTION_RESOURCE_ID}" "{\"state\":\"Registered\", \"registrationDate\": \"now\", \"properties\": { \"tenantId\": \"${TENANT_ID}\"}}" "2.0" |
| if [ "$1" == "swift" ]; then | ||
| SWIFT=true | ||
| else | ||
| echo "$0 takes a single optional argument \"swift\"" | ||
| fi |
| UAMIS_JSON_MAP=$(echo -n ${UAMIS_JSON_MAP} | jq \ | ||
| --arg operator_name $curr_operator_name \ | ||
| --arg uami_resource_id $curr_uami_resource_id \ | ||
| ' |
| echo "creating azure user-assigned identity ${service_managed_identity_uami_name} in resource group ${CUSTOMER_RG_NAME}" | ||
| az identity create --name "${service_managed_identity_uami_name}" --resource-group "${CUSTOMER_RG_NAME}" | ||
| echo "user-assigned identity ${uami_name} created" |
| # control plane operator names required for OCP 4.19. | ||
| # TODO in the future the information of the required | ||
| # identities for a given OCP version will be provided | ||
| # via API. | ||
| CONTROL_PLANE_OPERATORS_NAMES=( |
| #!/bin/bash | ||
|
|
||
| source env_vars | ||
| source "$(dirname "$0")"/common.sh |
| #!/bin/bash | ||
|
|
||
| source env_vars | ||
| source "$(dirname "$0")"/common.sh |
| source env_vars | ||
|
|
||
| SWIFT=false | ||
| linked_resource_type=Microsoft.RedHatOpenShift/hcpOpenShiftClusters |
| source env_vars | ||
| source "$(dirname "$0")"/common.sh |
| source env_vars | ||
| source "$(dirname "$0")"/common.sh |
|
@nimrodshn: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What
Reintroduce a set of helpful scripts to deploy ARO-HCP clusters against a local development environment.
These were removed in !4874.
Why
These are very helpful for local testing and are missing from our
demodirectory, as the current bicep based script targets production environment.Testing
Testing is required for feature completion and tests should be part of the pull
request along with the feature changes.
Describe the testing provided. If you did not add tests, provide a clear
justification.
Special notes for your reviewer
PR Checklist
If E2E tests are included:
demonstrate that the test is able to detect a defect/error and fail with
proper error message and logs which communicates nature of the problem.