Documentation
¶
Index ¶
- Constants
- func GetAccessToken(secretsLister v1.SecretLister) (string, error)
- func GetClusterID(clusterVersionLister configlistersv1.ClusterVersionLister) (string, error)
- func GetOrganizationMeta(telemetryConfig map[string]string, ...) (string, string, bool)
- func IsTelemeterClientAvailable(deploymentLister appsv1listers.DeploymentLister) (bool, error)
- type Creator
- type DockerAuthEntry
- type DockerConfig
- type OCMAPIResponse
- type Organization
- type Subscription
Constants ¶
const ( TelemetryConfigMapName = "telemetry-config" TelemeterClientDeploymentName = "telemeter-client" TelemetryAnnotationPrefix = "telemetry.console.openshift.io/" TelemeterClientDeploymentNamespace = "openshift-monitoring" PullSecretName = "pull-secret" // FetchInterval defines how often we can fetch from OCM after the last successful fetch FetchInterval = 24 * time.Hour // FailureBackoffInterval defines how often we retry after a failed or missing-data attempt FailureBackoffInterval = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func GetAccessToken ¶
func GetAccessToken(secretsLister v1.SecretLister) (string, error)
func GetClusterID ¶
func GetClusterID(clusterVersionLister configlistersv1.ClusterVersionLister) (string, error)
func GetOrganizationMeta ¶
func GetOrganizationMeta(telemetryConfig map[string]string, cachedOrganizationID, cachedAccountEmail, clusterID, accessToken string) (string, string, bool)
check if: 1. custom ORGANIZATION_ID and ACCOUNT_MAIL is awailable as telemetry annotation on console-operator config or in telemetry-config configmap 2. cached ORGANIZATION_ID and ACCOUNT_MAIL is available on the operator controller instance else fetch the ORGANIZATION_ID and ACCOUNT_MAIL from OCM
func IsTelemeterClientAvailable ¶
func IsTelemeterClientAvailable(deploymentLister appsv1listers.DeploymentLister) (bool, error)
Types ¶
type DockerAuthEntry ¶
type DockerAuthEntry struct {
Auth string `json:"auth"`
}
DockerAuthEntry contains the base64-encoded auth credentials for a Docker registry.
type DockerConfig ¶
type DockerConfig struct {
Auths map[string]DockerAuthEntry `json:"auths"`
}
type OCMAPIResponse ¶
type OCMAPIResponse struct {
Items []Subscription `json:"items"`
}
Needed to create our own types for OCM Subscriptions since their types and client are useless https://github.com/openshift-online/ocm-sdk-go/blob/main/accountsmgmt/v1/subscription_client.go - everything private https://github.com/openshift-online/ocm-sdk-go/blob/main/accountsmgmt/v1/subscriptions_client.go#L38-L41 - useless client
type Organization ¶
type Organization struct {
ExternalId string `json:"external_id,omitempty"`
}
type Subscription ¶
type Subscription struct {
Organization Organization `json:"organization,omitempty"`
Creator Creator `json:"creator,omitempty"`
}
func FetchSubscription ¶
func FetchSubscription(clusterID, accessToken string) (*Subscription, error)
FetchOrganizationMeta fetches the organization ID and Accout email using the cluster ID and access token