1

I have a working opensearch cluster running in aks using opster opensearch operator. When I add custom branding in additionalConfig section it throws error.

dashboards:
version: 2.5.0
enable: true

additionalConfig:
  server.basePath: "/opensearch"
  server.rewriteBasePath: "false"
  opensearch_security.multitenancy.enabled: "true"
  opensearchDashboards.branding:
    logo:
      defaultUrl: "https://example.com/sample.svg"
      darkModeUrl: "https://example.com/dark-mode-sample.svg"
    mark:
      defaultUrl: "https://example.com/sample1.svg"
      darkModeUrl: "https://example.com/dark-mode-sample1.svg"
    loadingLogo:
      defaultUrl: "https://example.com/sample2.svg"
      darkModeUrl: "https://example.com/dark-mode-sample2.svg"
    faviconUrl: "https://example.com/sample3.svg"
    applicationTitle: "My Custom Title"

Error Received:

error: error validating "opensearch-cluster.yaml": error validating data: ValidationError(OpenSearchCluster.spec.dashboards.additionalConfig.opensearchDashboards.branding): invalid type for io.opster.opensearch.v1.OpenSearchCluster.spec.dashboards.additionalConfig: got "map", expected "string"; if you choose to ignore these errors, turn validation off with --validate=false

I tried updating the configmap as well that point to opensearch_dashboards.yml but the configmap is not getting updated.

zahid
  • 23
  • 4

1 Answers1

0

This is a bit tricky, but additionalConfig should be a map of strings.

So, opensearchDashboards.branding YAML value should be a string, and in your example it's a map.

I haven't tested it, but something like :

  opensearchDashboards.branding: |
    logo:
      defaultUrl: "https://example.com/sample.svg"
      darkModeUrl: "https://example.com/dark-mode-sample.svg"
    mark:
      defaultUrl: "https://example.com/sample1.svg"
      darkModeUrl: "https://example.com/dark-mode-sample1.svg"
    loadingLogo:
      defaultUrl: "https://example.com/sample2.svg"
      darkModeUrl: "https://example.com/dark-mode-sample2.svg"
    faviconUrl: "https://example.com/sample3.svg"
    applicationTitle: "My Custom Title"

might do the job. It's really frustrating, especially since not the only field impacted with this and the documentation around that for the operator is kind of lacking.