Skip to content

Make Clowder properties source more tolerant#5794

Open
awood wants to merge 1 commit intomainfrom
awood/SWATCH-4580-swatch-tally-independent
Open

Make Clowder properties source more tolerant#5794
awood wants to merge 1 commit intomainfrom
awood/SWATCH-4580-swatch-tally-independent

Conversation

@awood
Copy link
Collaborator

@awood awood commented Mar 4, 2026

Jira issue: SWATCH-4580

Description

If a property value is prefixed with "clowder.", the ClowderJsonPropertySource is engaged. It examines the cdappconfig.json file and extracts the necessary information for an endpoint. However, if the endpoint is not present in the ClowdApp, there is no corresponding entry in the cdappconfig.json file. The previous behavior was for ClowderJsonPropertySource to throw an exception in this case.

When we are doing component testing, we intentionally remove endpoints that would normally be present in order to reduce the deployment footprint. This commit makes ClowderJsonPropertySource tolerate that case and print a warning instead of throwing an exception.

This commit also creates a template parameter for the swatch-contracts hostname and sets an appropriate default for it. In a component testing deployment, we'll want to set that hostname to point to the wiremock container. This commit also sets the swatch-contracts certificate truststore to default to the empty string. This value will cause the TlsProperties class to avoid loading a truststore (since there is no truststore in this deployment scenario).

Finally, this commit also sets environment variables for several template parameters. The parameters existed previously but were never dereferenced anywhere which made them unusable.

Testing

Setup

  1. bin/build-images.sh rhsm-subscriptions

Steps

  1. Do a limited deployment of swatch-tally. Note that the dependency on swatch-contracts is being removed.
    VER=$(git rev-parse --short=7 HEAD) ;
    REPO=$(podman login quay.io --get-login) ; \
    bonfire deploy rhsm \
    --source=appsre \
    --ref-env insights-production \
    --optional-deps-method none \
    --frontends false \
    --no-remove-resources app:rhsm \
    -i quay.io/$REPO/rhsm-subscriptions=$VER \
    -p swatch-tally/IMAGE=quay.io/$REPO/rhsm-subscriptions \
    -p swatch-tally/RHSM_CONTRACTS_URL=http://wiremock-service:8000 \
    --remove-dependencies swatch-tally/swatch-contracts \
    --component wiremock \
    --component rhsm \
    --component artemis \
    --component swatch-kafka-bridge \
    --component swatch-tally
    

Verification

  1. oc logs -f $(oc get pods | grep swatch-tally-service | cut -f1 -d' ') to monitor for a successful deployment of swatch-tally-service.

If a property value is prefixed with "clowder.", the
ClowderJsonPropertySource is engaged.  It examines the cdappconfig.json
file and extracts the necessary information for an endpoint.  However,
if the endpoint is not present in the ClowdApp, there is no
corresponding entry in the cdappconfig.json file.  The previous
behavior was for ClowderJsonPropertySource to throw an exception in this
case.

When we are doing component testing, we intentionally remove endpoints
that would normally be present in order to reduce the deployment
footprint.  This commit makes ClowderJsonPropertySource tolerate that
case and print a warning instead of throwing an exception.

This commit also creates a template parameter for the swatch-contracts
hostname and sets an appropriate default for it.  In a component
testing deployment, we'll want to set that hostname to point to the
wiremock container.  This commit also sets the swatch-contracts
certificate truststore to default to the empty string.  This value will
cause the TlsProperties class to avoid loading a truststore (since there
is no truststore in this deployment scenario).

Finally, this commit also sets environment variables for several
template parameters.  The parameters existed previously but were never
dereferenced anywhere which made them unusable.
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

⛏️ Workflow Run

🧹 Checkstyle

🧪 JUnit

TestsPassed ✅Skipped ⚠️Failed
JUnit Test Report1916 ran1911 passed5 skipped0 failed
Details
TestResult
No test annotations available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant