%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%% Copyright (c) 2007-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
%%

[
  {k8s_discovery_mechanism_as_module,
      "cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
       cluster_formation.k8s.host = k8s.eng.megacorp.local", [
          {rabbit, [
              {cluster_formation, [
                  {peer_discovery_backend, rabbit_peer_discovery_k8s},
                  {peer_discovery_k8s, [
                      {k8s_host, "k8s.eng.megacorp.local"}
                  ]}
              ]}
          ]}
      ], [rabbitmq_peer_discovery_k8s]
  },

  {k8s_discovery_mechanism_as_alias1,
      "cluster_formation.peer_discovery_backend = k8s
       cluster_formation.k8s.host = k8s.eng.megacorp.local", [
          {rabbit, [
              {cluster_formation, [
                  {peer_discovery_backend, rabbit_peer_discovery_k8s},
                  {peer_discovery_k8s, [
                      {k8s_host, "k8s.eng.megacorp.local"}
                  ]}
              ]}
          ]}
      ], [rabbitmq_peer_discovery_k8s]
  },

  {k8s_discovery_mechanism_as_alias2,
      "cluster_formation.peer_discovery_backend = kubernetes
       cluster_formation.k8s.host = k8s.eng.megacorp.local", [
          {rabbit, [
              {cluster_formation, [
                  {peer_discovery_backend, rabbit_peer_discovery_k8s},
                  {peer_discovery_k8s, [
                      {k8s_host, "k8s.eng.megacorp.local"}
                  ]}
              ]}
          ]}
      ], [rabbitmq_peer_discovery_k8s]
  },

  {k8s_host, "cluster_formation.k8s.host = k8s.eng.megacorp.local", [
          {rabbit, [
              {cluster_formation, [
                  {peer_discovery_k8s, [
                      {k8s_host, "k8s.eng.megacorp.local"}
                  ]}
              ]}
          ]}
      ], [rabbitmq_peer_discovery_k8s]
  }

, {k8s_port,
   "cluster_formation.k8s.port = 9700",
   [{rabbit, [{cluster_formation, [
                                   {peer_discovery_k8s, [
                                                            {k8s_port, 9700}
                                                           ]}
                                  ]}]}],
   [rabbitmq_peer_discovery_k8s]}

, {k8s_host_and_port,
   "cluster_formation.k8s.host = k8s.eng.megacorp.local
   cluster_formation.k8s.port = 443",
  [{rabbit, [{cluster_formation, [
                                  {peer_discovery_k8s, [
                                                           {k8s_host, "k8s.eng.megacorp.local"},
                                                           {k8s_port, 443}
                                                          ]}
                                 ]}]}],
   [rabbitmq_peer_discovery_k8s]}


, {k8s_scheme,
   "cluster_formation.k8s.scheme = https",
   [{rabbit, [{cluster_formation, [
                                   {peer_discovery_k8s, [
                                                            {k8s_scheme, "https"}
                                                           ]}
                                  ]}]}],
   [rabbitmq_peer_discovery_k8s]}


, {k8s_service_name, "cluster_formation.k8s.service_name = kubernetes-service", [
        {rabbit, [
            {cluster_formation, [
                {peer_discovery_k8s, [
                    {k8s_service_name, "kubernetes-service"}
                ]}
            ]}
        ]}
    ], [rabbitmq_peer_discovery_k8s]
  }

, {k8s_token_path, "cluster_formation.k8s.token_path = test/config_schema_SUITE_data/token.txt", [
        {rabbit, [
            {cluster_formation, [
                {peer_discovery_k8s, [
                    {k8s_token_path, "test/config_schema_SUITE_data/token.txt"}
                ]}
            ]}
        ]}
    ], [rabbitmq_peer_discovery_k8s]
  }

, {k8s_ca_certificate_legacy_cert_path, "cluster_formation.k8s.cert_path = test/config_schema_SUITE_data/certs/cacert.pem", [
        {rabbit, [
            {cluster_formation, [
                {peer_discovery_k8s, [
                    {k8s_cert_path, "test/config_schema_SUITE_data/certs/cacert.pem"}
                ]}
            ]}
        ]}
    ], [rabbitmq_peer_discovery_k8s]
  }

, {k8s_ca_certificate_modern_path, "cluster_formation.k8s.tls.cacertfile = test/config_schema_SUITE_data/certs/cacert.pem", [
        {rabbit, [
            {cluster_formation, [
                {peer_discovery_k8s, [
                    {ssl_options, [
                        {cacertfile, "test/config_schema_SUITE_data/certs/cacert.pem"}
                    ]}
                ]}
            ]}
        ]}
    ], [rabbitmq_peer_discovery_k8s]
  }

, {k8s_client_certificate_modern_path, "cluster_formation.k8s.tls.certfile = test/config_schema_SUITE_data/certs/cert.pem", [
        {rabbit, [
            {cluster_formation, [
                {peer_discovery_k8s, [
                    {ssl_options, [
                        {certfile, "test/config_schema_SUITE_data/certs/cert.pem"}
                    ]}
                ]}
            ]}
        ]}
    ], [rabbitmq_peer_discovery_k8s]
  }

, {k8s_client_key_modern_path, "cluster_formation.k8s.tls.keyfile = test/config_schema_SUITE_data/certs/key.pem", [
        {rabbit, [
            {cluster_formation, [
                {peer_discovery_k8s, [
                    {ssl_options, [
                        {keyfile, "test/config_schema_SUITE_data/certs/key.pem"}
                    ]}
                ]}
            ]}
        ]}
    ], [rabbitmq_peer_discovery_k8s]
  }

, {k8s_namespace_path, "cluster_formation.k8s.namespace_path = test/config_schema_SUITE_data/namespace.txt", [
        {rabbit, [
            {cluster_formation, [
                {peer_discovery_k8s, [
                    {k8s_namespace_path, "test/config_schema_SUITE_data/namespace.txt"}
                ]}
            ]}
        ]}
    ], [rabbitmq_peer_discovery_k8s]
  }
].
