Skip to content

Conversation

@synhershko
Copy link
Collaborator

Fixes #1082

Make dashboard configuration less verbose by making replicas and version fields optional when dashboards are disabled.

Changes:

  • Add 'omitempty' tag to DashboardsConfig.Replicas and Version fields
  • Add kubebuilder default=1 annotation for replicas field
  • Use cluster version unless dashboards version is explicitly declared
  • Regenerate CRDs to reflect schema changes

Before:
dashboards: enabled: false
replicas: 0 # Required but redundant
version: "2.9.0" # Required but redundant

After:
dashboards:
enabled: false # No longer requires replicas and version

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Make dashboard configuration less verbose by making replicas and version
fields optional when dashboards are disabled.

Changes:
- Add 'omitempty' tag to DashboardsConfig.Replicas and Version fields
- Add kubebuilder default=1 annotation for replicas field
- Use cluster version unless dashboards version is explicitly declared
- Regenerate CRDs to reflect schema changes

Before:
  dashboards:
    enabled: false
    replicas: 0      # Required but redundant
    version: "2.9.0" # Required but redundant

After:
  dashboards:
    enabled: false   # No longer requires replicas and version

Signed-off-by: Itamar Syn-Hershko <[email protected]>
Signed-off-by: josedev-union <[email protected]>

version := cr.Spec.Dashboards.Version
if version == "" {
version = cr.Spec.General.Version
Copy link
Member

Choose a reason for hiding this comment

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

This will be a problem in scenarios where we only release OpenSearch. Example for 3.3.1 opensearch-project/opensearch-build#5784. The docker for OpenSearch has 3.3.1 https://hub.docker.com/r/opensearchproject/opensearch/tags, but not for OpenSearch Dashboards https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags.
CC @getsaurabh02 @peterzhuamazon

Copy link
Member

Choose a reason for hiding this comment

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

Based on this its good to disable the version (for OSD) only when enabled is false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch - @josedev-union can you propose a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[FEATURE] Don't require explicit configurations where not needed

3 participants