Skip to content

Fix profile optimization condition in entrypoint scripts to check for specific profile name#219

Merged
npamudika merged 2 commits into
mainfrom
copilot/fix-entrypoint-script-logic
May 7, 2026
Merged

Fix profile optimization condition in entrypoint scripts to check for specific profile name#219
npamudika merged 2 commits into
mainfrom
copilot/fix-entrypoint-script-logic

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

  • Create branch copilot/fix-entrypoint-4.5.x from origin/4.5.x and apply fix
  • Push branch and open PR → 4.5.x
  • Create branch copilot/fix-entrypoint-4.6.x from origin/4.6.x and apply fix
  • Push branch and open PR → 4.6.x
  • Create branch copilot/fix-entrypoint-4.7.x from origin/4.7.x and apply fix
  • Push branch and open PR → 4.7.x
Original prompt

Please fix the entrypoint script logic in the WSO2 APIM Helm chart so that WSO2 Carbon server profile optimization runs when the profile name is defined as an environment variable.

Context:
In the control plane chart template at:
https://github.com/wso2/helm-apim/blob/4.6.x/distributed/control-plane/templates/control-plane/wso2am-cp-conf-entrypoint.yaml#L39-L44
there is currently a bash snippet intended to optimize the WSO2 Carbon server for a particular profile.

The intended logic (as used in 4.5.x/4.6.x/4.7.x) is:

# optimize WSO2 Carbon Server, if the profile name is defined as an environment variable
if [[ "${PROFILE_NAME}" == "key-manager" ]]
then
  echo "Optimizing WSO2 Carbon Server" >&2
  sh ${WSO2_SERVER_HOME}/bin/profileSetup.sh -Dprofile=${PROFILE_NAME}
fi

Task:

  • Inspect the current templates in branches 4.5.x, 4.6.x, and 4.7.x.
  • Fix the snippet in distributed/control-plane/templates/control-plane/wso2am-cp-conf-entrypoint.yaml (and any corresponding places if duplicated) so it correctly refers to and uses the environment variable PROFILE_NAME (and WSO2_SERVER_HOME) as above.
  • Ensure quoting and bash syntax are correct and the script is safe under set -e style execution.
  • Keep behavior unchanged for other profiles; only perform optimization when PROFILE_NAME equals key-manager.
  • Update all three branches (4.5.x, 4.6.x, 4.7.x) with equivalent fixes.

Acceptance criteria:

  • Rendered entrypoint script contains the corrected conditional and uses the env var PROFILE_NAME.
  • helm template output remains valid YAML.
  • Any existing tests/linters pass.
  • Open PR(s) with the changes (one PR per target branch is fine if that matches repo contribution norms; otherwise separate PRs per branch).

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: ```

optimize WSO2 Carbon Server, if the profile name is defined as an environment variable

if [[ "${PROFILE_NAME}" == "key-manager" ]]
then
echo "Optimizing WSO2 Carbon Server" >&2
sh ${WSO2_SERVER_HOME}/bin/profileSetup.sh -Dprofile=${PROFILE_NAME}
fi

Fix https://github.com/wso2/helm-apim/blob/4.6.x/distributed/control-plane/templates/control-plane/wso2am-cp-conf-entrypoint.yaml#L39-L44 referring the above in 4.5.x, 4.6.x and 4.7.x branches

Assistant: I’ve queued up the change for the 4.5.x, 4.6.x, and 4.7.x branches, and I’m waiting for your confirmation on the prompted action so I can proceed with applying the fix and opening the PR(s).


This pull request was created from Copilot chat.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

…ger instead of ! -z check

Agent-Logs-Url: https://github.com/wso2/helm-apim/sessions/a2ea16de-cb01-461d-a60a-778540d1677b

Co-authored-by: npamudika <8363838+npamudika@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix entrypoint script logic for WSO2 APIM Helm chart Fix profile optimization condition in entrypoint scripts to check for specific profile name May 7, 2026
Copilot AI requested a review from npamudika May 7, 2026 11:09
@npamudika npamudika marked this pull request as ready for review May 7, 2026 11:12
@npamudika npamudika merged commit 191fb91 into main May 7, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants