3scale-ops / saas-operator

3scale SaaS Operator - www.3scale.net
Apache License 2.0
8 stars 2 forks source link

Fix/System-console statefulset args #232

Closed slopezz closed 1 year ago

slopezz commented 1 year ago

System-console statefulset was not loading correct system config fils due to the command used, and the one in 3scale/porta entrypoint.

In other system pods (exept console) the active merchant configuration is correctly set as :test.

However in system-console the "extra" config files are not applied, so apparently it uses the configuration that is built into the container.

In this case the settings.yml file misses active_merchant_mode, so it's "calculated" based on the Rails env, so ends up being :production.

The reason for this is that the whole config symlinking happens in the container image entrypoint: https://github.com/3scale/porta/blob/2028c613de09c73de06d7c31406478d967976e37/openshift/system/entrypoint.sh#L8-L21

And this is not used in system-console where the command is overridden by sleep

system-app:

sh-4.2$ ls -al config
total 152
drwxrwsr-x. 1 default    root  4096 Nov 24 17:00 .
drwxrwxr-x. 1 default    root  4096 Nov 28 13:25 ..
drwxrwsr-x. 2 default    root   218 Oct 25 20:03 abilities
lrwxrwxrwx. 1 1000590000 root    39 Nov 24 17:00 amazon_s3.yml -> /opt/system-extra-configs/amazon_s3.yml
-rwxrwxr--. 1 default    root 13551 Oct 25 20:03 application.rb
lrwxrwxrwx. 1 1000590000 root    37 Nov 24 17:00 backend.yml -> /opt/system-extra-configs/backend.yml
lrwxrwxrwx. 1 1000590000 root    43 Nov 24 17:00 backend_redis.yml -> /opt/system-extra-configs/backend_redis.yml
lrwxrwxrwx. 1 1000590000 root    44 Nov 24 17:00 banned_domains.yml -> /opt/system-extra-configs/banned_domains.yml

system-console (it is using the image files):

sh-4.2$ ls -al config
total 224
drwxrwsr-x. 11 default root  4096 Nov  7 11:00 .
drwxrwxr-x.  1 default root     6 Nov 28 12:46 ..
drwxrwsr-x.  2 default root   218 Oct 25 20:03 abilities
-rwxrwxr--.  1 default root   557 Oct 25 20:03 amazon_s3.yml
-rwxrwxr--.  1 default root 13551 Oct 25 20:03 application.rb
-rwxrwxr--.  1 default root   293 Oct 25 20:03 backend.yml
-rwxrwxr--.  1 default root   351 Oct 25 20:03 backend_redis.yml
-rwxrwxr--.  1 default root   128 Oct 25 20:03 boot.rb

This PR fixes the console container args.

/kind bug /priority important-soon /assign

3scale-robot commented 1 year ago

LGTM label has been added.

Git tree hash: 0c2631c02630edda6380c2bd699d338aa760eb65

slopezz commented 1 year ago

/approve

3scale-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: slopezz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/3scale-ops/saas-operator/blob/main/OWNERS)~~ [slopezz] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment