Skip to content
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

ZSS does not respect HA config #737

Open
1000TurquoisePogs opened this issue Nov 14, 2024 · 1 comment
Open

ZSS does not respect HA config #737

1000TurquoisePogs opened this issue Nov 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@1000TurquoisePogs
Copy link
Member

Consider the following config:

components:
  zss:
    port: 123

haInstances:
  first:
    components:
      zss:
        port: 456
  second:
    components:
      zss:
        port: 567

cfgGet functions such as here

zss/c/zss.c

Line 1124 in 940ad1a

getStatus = cfgGetIntC(configmgr,ZSS_CFGNAME,port,3,"components","zss","port");

Do not check for HA. They just read the section they want, without considering the haInstances is an override.

In other servers, the haInstances section is respected by having the env vars they read be the result of a merge of haInstances over the standard config.

I expect that cfgGet functions should do the right thing rather than rely upon developers to remember this rule.
So, I think something should be doing this merge prior to zss reading values.

To apply an ha override, you must know the ha instance name.
That is captured as $ZWE_haInstance_id

I suggest a solution in zwe to create a file which has the HA override done, and place that in workspace/.env
There are other such HA-overridden temp files there in .env and .json format, but not for .yaml
Provided we have one, then zss can use it instead of the current ".zowe-merged.yaml" file which leaves the haInst as-is.

@1000TurquoisePogs 1000TurquoisePogs added the bug Something isn't working label Nov 14, 2024
@1000TurquoisePogs
Copy link
Member Author

I do not see a way to make configmgr functions be the writer of the HA yaml.
They appear to function upon files, whereas the yaml that needs to be created is done by edits of a javascript object derived from the yaml on disk. There would need to be a way to load configmgr via string rather than file.

In absense of that, I find the yaml library on npm works in quickjs and can do yaml writes. It however would bypass configmgr to do so, so such a library should not be widely used to avoid misuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant