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

quick fix for https://issues.redhat.com/browse/RHIDP-1701 #273

Closed
wants to merge 1 commit into from

Conversation

gazarenkov
Copy link
Collaborator

Description

quick fix for https://issues.redhat.com/browse/RHIDP-1701

PR acceptance criteria

  • Tests

How to test changes / Special notes to the reviewer

make test

Copy link

openshift-ci bot commented Mar 21, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from gazarenkov. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

sonarcloud bot commented Mar 21, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@gazarenkov gazarenkov requested review from kadel and rm3l and removed request for nickboldt and jianrongzhang89 March 21, 2024 07:39
Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think a test case will be helpful to catch potential regressions on this. Maybe I've missed it, but I'm not sure this is captured with the existing tests.


})
for _, c := range deployment.Spec.Template.Spec.Containers {
if c.Name == _defaultBackstageMainContainerName {
Copy link
Member

@rm3l rm3l Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest replacing based on a placeholder instead. Otherwise, if user changes the config to use their own images for the main and/or init containers, they will still be replaced here; so same issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that we have the same issue with the DB StatefulSet as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand about placeholder. Could you please elaborate?

For the database: Do you see any option for extension it's deployment in the Helm Chart?
(I just would keep this fix as simple as possible)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand about placeholder. Could you please elaborate?

I mean, use by default a placeholder like <RELATED_IMAGE_backstage> in the default deployment.yaml manifest, and perform replacements only for places where this placeholder is used explicitly. This way, it is clear that only these placeholders will be replaced, regardless of the container names.
I remember I saw something like this in a PR (83c7187 (#86)), but it was changed at some point later 😕

For the database: Do you see any option for extension it's deployment in the Helm Chart?
(I just would keep this fix as simple as possible)

Maybe not extend it with an extra-container (or why not actually?), but I was thinking of just trying to use a different DB image for example (which is possible in the Helm Chart). Right now, this is not configurable in the CR, so the only way to do this would be via the rawRuntimeConfig, but the image would end up being replaced.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand about placeholder. Could you please elaborate?

I mean, use by default a placeholder like <RELATED_IMAGE_backstage> in the default deployment.yaml manifest, and perform replacements only for places where this placeholder is used explicitly. This way, it is clear that only these placeholders will be replaced, regardless of the container names. I remember I saw something like this in a PR (83c7187 (#86)), but it was changed at some point later 😕

And here for the logic: https://github.com/janus-idp/operator/pull/86/files#diff-8e7e7c9a64394f1ee039417ef32b84b7122580096d39f293a8d976bd2af27f45R308-R314

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, if you use <RELATED_IMAGE_backstage> in deployment.yaml, what would be the value if I do not put env variable?

I remember I saw something like this in a PR (83c7187 (#86)), but it was changed at some point later

I guess, the changes you mentioned caused by the fact that in this case we have to use somehow hardcoded value which is not good.

Maybe not extend it with an extra-container (or why not actually?), but I was thinking of just trying to use a different DB image for example (which is possible in the Helm Chart). Right now, this is not configurable in the CR, so the only way to do this would be via the rawRuntimeConfig, but the image would end up being replaced.

OK, Let's move this discussion to the issue?
My point here is to fix concrete problem and so far I can not see it changed anything else but fix it :) . WDYT?

@gazarenkov
Copy link
Collaborator Author

Close this and create bug fixes PR for 1.1.x branch.

@gazarenkov gazarenkov closed this Mar 27, 2024
@gazarenkov gazarenkov deleted the container-fix branch April 19, 2024 08:06
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.

None yet

2 participants