config

package
v0.0.0-...-633508f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright (c) 2021 Red Hat, Inc. Copyright Contributors to the Open Cluster Management project

Index

Constants

View Source
const (
	DEFAULT_SERVICE_PORT     = ":3030"
	DEFAULT_HTTP_TIMEOUT     = 180000                                  // 3 minutes HTTP Timeout
	DEFAULT_CCX_SERVER       = "http://localhost:8080/api/v1/clusters" // For local use only
	DEFAULT_POLL_INTERVAL    = 30                                      // 30mins default polling interval cloud.redhat.com
	DEFAULT_REQUEST_INTERVAL = 1                                       // 1 second Interval between 2 consecutive requests
	DEFAULT_POD_NAMESPACE    = "kube-system"                           // Namespace of insights-client pod
)

Variables

View Source
var Cfg = Config{}

Cfg service configuration

Functions

func GetConfig

func GetConfig() *rest.Config

func GetDynamicClient

func GetDynamicClient() dynamic.Interface

Get the kubernetes dynamic client.

func GetKubeClient

func GetKubeClient() *kubernetes.Clientset

Types

type Config

type Config struct {
	ServicePort     string `env:"SERVICE_PORT"`
	HTTPTimeout     int    `env:"HTTP_TIMEOUT"` // timeout when the http server should drop connections
	CCXServer       string `env:"CCX_SERVER"`
	KubeConfig      string `env:"KUBECONFIG"`       // Local kubeconfig path
	CCXToken        string `env:"CCX_TOKEN"`        // Token to access CCX server , when pull-secret cannot be used
	PollInterval    int    `env:"POLL_INTERVAL"`    // Polling interval to reports from cloud.redhat.com
	RequestInterval int    `env:"REQUEST_INTERVAL"` // Interval between 2 consequent requests
	CACert          string `env:"CACert"`           // base64 encoded caCert used for dev & test
	PodNamespace    string `env:"POD_NAMESPACE"`    // Namespace of insights-client pod
}

Config - Define a config type to hold our config properties.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL