-
Notifications
You must be signed in to change notification settings - Fork 190
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
Allow CR with custom dashboard image that is different from general custom image or default image #177
Allow CR with custom dashboard image that is different from general custom image or default image #177
Conversation
TODO: Add other useful fields. apiVersion, kind, uid?' | ||
type: string | ||
type: object | ||
type: array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I did the docket-build, as expect the opensearch-operator/config/crd/bases/opensearch.opster.io_opensearchclusters.yaml file was updated.
My question is even before my PR, the updated opensearch.opster.io_opensearchclusters.yaml content is different from charts/opensearch-operator/templates/opensearchclusters.opensearch.opster.io-crd.yaml
I suspected they should be the same but theopensearchclusters.opensearch.opster.io-crd.yaml
is not updated every time when the CR struct is changes.
See another PR: https://github.com/Opster/opensearch-k8s-operator/pull/175/files
I am not sure this snippet is needed for PR or not. I can remove it if it is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are currently working on automatically updating the CRD in the helm chart. But you can keep the change in.
return | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this code snippet is used 3 times in this go file, refactoring the code to call useCustomImage
func for easy maintenance going forward.
07f315f
to
a4c7f25
Compare
Reviewers |
65c530c
to
57e1517
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aarontams. Thank you for your PR.
Could you please add a unittest for the new functionality (probably in opensearch-operator/pkg/reconcilers/dashboards_test.go
)
and please add the new fields to the crd.md (that the fields for spec.general.image
are not there is an omission, in general every field of the CRD should be documented).
Otherwise code looks good to me.
TODO: Add other useful fields. apiVersion, kind, uid?' | ||
type: string | ||
type: object | ||
type: array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are currently working on automatically updating the CRD in the helm chart. But you can keep the change in.
Will do in next PR update.
I was thinking about adding the new fields to crd.md, but didn't see the ImageSpec defined in GeneralConfig. Yes, I will add that in next PR update. Thanks for reviewing my PR. |
…ustom image or default image Signed-off-by: aaron.tam <aaron.tam@oracle.com>
57e1517
to
e430b04
Compare
@swoehrl-mw
Looking forward to having you to review it again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Task Allow config the OpenSearchCluster CR to use a specific image for the dashboards only
Limit Currently, the OpenSearchCluster CR only allows customize the dashboard image through the
spec.general.image
. But the CR value inspec.general.image
will also be used by all the opensearch cluster nodes (master, ingest, and data).Scenario Some users build the opensearch cluster (a.k.a ES cluster) and opensearch dashboard (a.k.a Kibana) separately and put the images in two different docker registry repos. They need a way to individualize both images for opensearch cluster and opensearch dashboard.
Solution To allow the CR to customize the dashboard image only without affecting other components, the simplest way is to introduce an
ImageSpec
struct withinspec.dashboards
. For example:Implementation With this MR, the opensearch operator will choose the dashboard image in the following order:
spec.dashboards.image
if specified.spec.general.image
if specified.docker.io/opensearchproject/opensearch-dashboards:
+ cr.Spec.Dashboards.Version in reconcile-helpers.go.