/
types.go
81 lines (70 loc) · 3.36 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package serverconfig
// This file is a copy of the struct within the console operator:
// https://github.com/devops-simba/console-operator/blob/master/pkg/console/subresource/consoleserver/types.go
// These structs need to remain in sync.
// Config is the top-level console server cli configuration.
type Config struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
ServingInfo `yaml:"servingInfo"`
ClusterInfo `yaml:"clusterInfo"`
Auth `yaml:"auth"`
Customization `yaml:"customization"`
Providers `yaml:"providers"`
Helm `yaml:"helm"`
MonitoringInfo `yaml:"monitoringInfo,omitempty"`
}
// ServingInfo holds configuration for serving HTTP.
type ServingInfo struct {
BindAddress string `yaml:"bindAddress,omitempty"`
CertFile string `yaml:"certFile,omitempty"`
KeyFile string `yaml:"keyFile,omitempty"`
RedirectPort int `yaml:"redirectPort,omitempty"`
// These fields are defined in `HTTPServingInfo`, but are not supported for console. Fail if any are specified.
// https://github.com/openshift/api/blob/0cb4131a7636e1ada6b2769edc9118f0fe6844c8/config/v1/types.go#L7-L38
BindNetwork string `yaml:"bindNetwork,omitempty"`
ClientCA string `yaml:"clientCA,omitempty"`
NamedCertificates []interface{} `yaml:"namedCertificates,omitempty"`
MinTLSVersion string `yaml:"minTLSVersion,omitempty"`
CipherSuites []string `yaml:"cipherSuites,omitempty"`
MaxRequestsInFlight int64 `yaml:"maxRequestsInFlight,omitempty"`
RequestTimeoutSeconds int64 `yaml:"requestTimeoutSeconds,omitempty"`
}
// Monitoring holds URLs for monitoring related services
type MonitoringInfo struct {
AlertmanagerPublicURL string `yaml:"alertmanagerPublicURL,omitempty"`
GrafanaPublicURL string `yaml:"grafanaPublicURL,omitempty"`
PrometheusPublicURL string `yaml:"prometheusPublicURL,omitempty"`
ThanosPublicURL string `yaml:"thanosPublicURL,omitempty"`
}
// ClusterInfo holds information the about the cluster such as master public URL and console public URL.
type ClusterInfo struct {
ConsoleBaseAddress string `yaml:"consoleBaseAddress,omitempty"`
ConsoleBasePath string `yaml:"consoleBasePath,omitempty"`
MasterPublicURL string `yaml:"masterPublicURL,omitempty"`
}
// Auth holds configuration for authenticating with OpenShift. The auth method is assumed to be "openshift".
type Auth struct {
ClientID string `yaml:"clientID,omitempty"`
ClientSecretFile string `yaml:"clientSecretFile,omitempty"`
OAuthEndpointCAFile string `yaml:"oauthEndpointCAFile,omitempty"`
LogoutRedirect string `yaml:"logoutRedirect,omitempty"`
InactivityTimeoutSeconds int `yaml:"inactivityTimeoutSeconds,omitempty"`
}
// Customization holds configuration such as what logo to use.
type Customization struct {
Branding string `yaml:"branding,omitempty"`
DocumentationBaseURL string `yaml:"documentationBaseURL,omitempty"`
CustomProductName string `yaml:"customProductName,omitempty"`
CustomLogoFile string `yaml:"customLogoFile,omitempty"`
}
type Providers struct {
StatuspageID string `yaml:"statuspageID,omitempty"`
}
type HelmChartRepo struct {
URL string `yaml:"url,omitempty"`
CAFile string `yaml:"caFile,omitempty"`
}
type Helm struct {
ChartRepo HelmChartRepo `yaml:"chartRepository"`
}