<commit_before>package config

const (
	HttpPortExternal      = uint32(8080)
	HttpPortInternal      = uint32(8081)
	HttpsPortExternal     = uint32(8443)
	InternalKourierHeader = "kourier-snapshot-id"
	InternalKourierDomain = "internalkourier"
	InternalKourierPath   = "/__internalkouriersnapshot"
)<commit_msg>config: add Namespace()<commit_after>package config

import (
	"os"
	"sync"

	log "github.com/sirupsen/logrus"
)

const (
	HttpPortExternal  = uint32(8080)
	HttpPortInternal  = uint32(8081)
	HttpsPortExternal = uint32(8443)

	InternalKourierHeader = "kourier-snapshot-id"
	InternalKourierDomain = "internalkourier"
	InternalKourierPath   = "/__internalkouriersnapshot"

	KourierNamespaceEnv     = "KOURIER_NAMESPACE"
	KourierDefaultNamespace = "knative-serving"
)

var kourierNamespace string
var once sync.Once

func Namespace() string {
	once.Do(
		func() {
			kourierNamespace = os.Getenv(KourierNamespaceEnv)

			if kourierNamespace == "" {
				log.Infof(
					"Env %s empty, using default: %s",
					KourierNamespaceEnv,
					KourierDefaultNamespace,
				)

				kourierNamespace = KourierDefaultNamespace
			}
		},
	)

	return kourierNamespace
}
{'fraction_non_alphanumeric': 0.0939655172413793, 'fraction_numerical': 0.03103448275862069, 'mean_word_length': 4.555023923444976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3177657', 'n_tokens_mistral': 466, 'n_tokens_neox': 390, 'n_words': 69}