github.com/verrazzano/verrazzano-monitoring-operator@v0.0.30/pkg/config/reindex_config.go (about)

     1  // Copyright (C) 2022, Oracle and/or its affiliates.
     2  // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  package config
     5  
     6  import (
     7  	"os"
     8  	"strings"
     9  )
    10  
    11  var reindexConfiguration = struct {
    12  	namespacesKey         string
    13  	defaultNamespaces     []string
    14  	datastreamNameKey     string
    15  	defaultDataStreamName string
    16  }{
    17  	"VERRAZZANO_NAMESPACES_ARRAY",
    18  	[]string{
    19  		"kube-system",
    20  		"verrazzano-system",
    21  		"istio-system",
    22  		"keycloak",
    23  		"metallb-system",
    24  		"default",
    25  		"cert-manager",
    26  		"local-path-storage",
    27  		"rancher-operator-system",
    28  		"fleet-system",
    29  		"ingress-nginx",
    30  		"cattle-system",
    31  		"verrazzano-install",
    32  		"monitoring",
    33  	},
    34  	"VERRAZZANO_DATA_STREAM_NAME",
    35  	"verrazzano-system",
    36  }
    37  
    38  func SystemNamespaces() []string {
    39  	reindexValues := os.Getenv(reindexConfiguration.namespacesKey)
    40  	if reindexValues == "" {
    41  		return reindexConfiguration.defaultNamespaces
    42  	}
    43  	return strings.Split(reindexValues, ",")
    44  }
    45  
    46  func DataStreamName() string {
    47  	dataStreamName := os.Getenv(reindexConfiguration.datastreamNameKey)
    48  	if dataStreamName == "" {
    49  		return reindexConfiguration.defaultDataStreamName
    50  	}
    51  	return dataStreamName
    52  }