Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyFilters(ocmClient *sdk.Connection, filters []string) ([]*cmv1.Cluster, error)
- func ConfirmPrompt() bool
- func CreateConnection() (*sdk.Connection, error)
- func CreateIssue(service *jira.IssueService, summary string, description string, ...) (*jira.Issue, error)
- func FindRouteTableForSubnet(awsClient aws.Client, subnetID string) (string, error)
- func FindRouteTableForSubnetForVerification(verificationAwsClient verificationAWSClient, subnetID string) (string, error)
- func GenerateQuery(clusterIdentifier string) string
- func GetAWSAccountIdForCluster(ocmClient *sdk.Connection, clusterID string) (string, error)
- func GetAccount(connection *sdk.Connection, key string) (account *amv1.Account, err error)
- func GetCluster(connection *sdk.Connection, key string) (cluster *cmv1.Cluster, err error)
- func GetClusterAnyStatus(conn *sdk.Connection, clusterId string) (*cmv1.Cluster, error)
- func GetClusterLimitedSupportReasons(connection *sdk.Connection, clusterID string) ([]*cmv1.LimitedSupportReason, error)
- func GetClusters(ocmClient *sdk.Connection, clusterIds []string) []*cmv1.Cluster
- func GetCurrentOCMEnv(connection *sdk.Connection) string
- func GetDependencyVersion(dependencyPath string) (string, error)
- func GetDynatraceURLFromLabel(clusterID string) (url string, err error)
- func GetHCPNamespace(clusterId string) (namespace string, err error)
- func GetHiveCluster(clusterId string) (*cmv1.Cluster, error)
- func GetHiveShard(clusterID string) (string, error)
- func GetJiraClient() (*jira.Client, error)
- func GetJiraIssuesForCluster(clusterID string, externalClusterID string) ([]jira.Issue, error)
- func GetJiraSupportExceptionsForOrg(organizationID string) ([]jira.Issue, error)
- func GetLatestVersion() (latest string, err error)
- func GetManagementCluster(clusterId string) (*cmv1.Cluster, error)
- func GetOrganization(connection *sdk.Connection, key string) (*amv1.Organization, error)
- func GetOrgfromClusterID(ocmClient *sdk.Connection, cluster cmv1.Cluster) (string, error)
- func GetRegistryCredentials(connection *sdk.Connection, accountId string) ([]*amv1.RegistryCredential, error)
- func GetServiceCluster(clusterId string) (*cmv1.Cluster, error)
- func GetSubscription(connection *sdk.Connection, key string) (subscription *amv1.Subscription, err error)
- func GetSupportRoleArnForCluster(ocmClient *sdk.Connection, clusterID string) (string, error)
- func IsClusterCCS(ocmClient *sdk.Connection, clusterID string) (bool, error)
- func IsHostedCluster(clusterID string) (bool, error)
- func IsManagementCluster(clusterID string) (isMC bool, err error)
- func IsValidClusterKey(clusterKey string) (err error)
- func IsValidKey(clusterKey string) bool
- func PrintJiraIssues(issues []jira.Issue)
- func PrintLimitedSupportReasons(limitedSupportReasons []*cmv1.LimitedSupportReason)
- func PrintPDAlerts(incidents map[string][]pd.Incident, serviceIDs []string)
- func PrintServiceLogs(serviceLogs []*v1.LogEntry, verbose bool, sinceDays int)
- func SendRequest(request *sdk.Request) (*sdk.Response, error)
- func StreamErrorln(stream genericclioptions.IOStreams, msg string)
- func StreamPrint(stream genericclioptions.IOStreams, msg string)
- func StreamPrintln(stream genericclioptions.IOStreams, msg string)
- func StreamRead(stream genericclioptions.IOStreams, delim byte) (string, error)
- type Config
- type DelayTracker
Constants ¶
const ( JiraTokenConfigKey = "jira_token" JiraBaseURL = "https://issues.redhat.com" )
const ( HypershiftClusterTypeLabel = "ext-hypershift.openshift.io/cluster-type" DynatraceTenantKeyLabel = "sre-capabilities.dtp.tenant" )
const ( VersionAPIEndpoint = "https://api.github.com/repos/openshift/osdctl/releases/latest" VersionAddressTemplate = "https://github.com/openshift/osdctl/releases/download/v%s/osdctl_%s_%s_%s.tar.gz" // version, version, GOOS, GOARCH )
const ClusterServiceClusterSearch = "id = '%s' or name = '%s' or external_id = '%s'"
Variables ¶
var ( // GitCommit is the short git commit hash from the environment // Will be set during build process via GoReleaser // See also: https://pkg.go.dev/cmd/link GitCommit string // Version is the tag version from the environment // Will be set during build process via GoReleaser // See also: https://pkg.go.dev/cmd/link Version string )
var ReadBuildInfo = debug.ReadBuildInfo
Functions ¶
func ApplyFilters ¶ added in v0.9.6
ApplyFilters retrieves clusters in OCM which match the filters given
func ConfirmPrompt ¶ added in v0.17.0
func ConfirmPrompt() bool
func CreateConnection ¶ added in v0.9.6
func CreateConnection() (*sdk.Connection, error)
func CreateIssue ¶ added in v0.20.0
func FindRouteTableForSubnet ¶ added in v0.32.0
func FindRouteTableForSubnetForVerification ¶ added in v0.32.0
func GenerateQuery ¶ added in v0.9.6
GenerateQuery returns an OCM search query to retrieve all clusters matching an expression (ie- "foo%")
func GetAWSAccountIdForCluster ¶ added in v0.13.0
func GetAWSAccountIdForCluster(ocmClient *sdk.Connection, clusterID string) (string, error)
func GetAccount ¶ added in v0.12.0
GetAccount Function allows to get a single account with any identifier (username, ID)
func GetCluster ¶ added in v0.9.6
GetCluster Function allows to get a single cluster with any identifier (displayname, ID, or external ID)
func GetClusterAnyStatus ¶ added in v0.13.5
GetClusterAnyStatus returns an OCM cluster object given an OCM connection and cluster id (internal id, external id, and name all supported).
func GetClusterLimitedSupportReasons ¶ added in v0.9.6
func GetClusterLimitedSupportReasons(connection *sdk.Connection, clusterID string) ([]*cmv1.LimitedSupportReason, error)
func GetClusters ¶ added in v0.9.6
func GetClusters(ocmClient *sdk.Connection, clusterIds []string) []*cmv1.Cluster
func GetCurrentOCMEnv ¶ added in v0.13.0
func GetCurrentOCMEnv(connection *sdk.Connection) string
func GetDependencyVersion ¶ added in v0.33.0
func GetDynatraceURLFromLabel ¶ added in v0.37.0
func GetHCPNamespace ¶ added in v0.37.0
func GetHiveShard ¶ added in v0.13.0
Returns the hive shard corresponding to a cluster e.g. https://api.<hive_cluster>.byo5.p1.openshiftapps.com:6443
func GetJiraClient ¶ added in v0.18.0
func GetJiraClient() (*jira.Client, error)
GetJiraClient creates a jira client that connects to https://issues.redhat.com. To work, the jiraToken needs to be set in the config
func GetJiraIssuesForCluster ¶ added in v0.18.0
func GetJiraSupportExceptionsForOrg ¶ added in v0.18.0
func GetLatestVersion ¶ added in v0.13.5
getLatestVersion connects to the GitHub API and returns the latest osdctl tag name Interesting Note: GitHub only shows the latest "stable" tag. This means, that tags with a suffix like *-rc.1 are not returned. We will always show the latest stable on master branch.
func GetManagementCluster ¶ added in v0.20.0
GetManagementCluster returns the OCM Cluster object for a provided clusterId
func GetOrganization ¶ added in v0.21.0
func GetOrganization(connection *sdk.Connection, key string) (*amv1.Organization, error)
GetOrganization returns an *amv1.Organization given an OCM cluster name, external id, or internal id as key
func GetOrgfromClusterID ¶ added in v0.13.7
func GetRegistryCredentials ¶ added in v0.18.0
func GetRegistryCredentials(connection *sdk.Connection, accountId string) ([]*amv1.RegistryCredential, error)
func GetServiceCluster ¶ added in v0.39.0
GetServiceCluster returns the hypershift Service Cluster object for a provided HCP clusterId
func GetSubscription ¶ added in v0.12.0
func GetSubscription(connection *sdk.Connection, key string) (subscription *amv1.Subscription, err error)
GetSubscription Function allows to get a single subscription with any identifier (displayname, ID, internal or external ID)
func GetSupportRoleArnForCluster ¶ added in v0.13.0
func GetSupportRoleArnForCluster(ocmClient *sdk.Connection, clusterID string) (string, error)
func IsClusterCCS ¶ added in v0.13.0
func IsClusterCCS(ocmClient *sdk.Connection, clusterID string) (bool, error)
func IsHostedCluster ¶ added in v0.39.0
func IsManagementCluster ¶ added in v0.37.0
Sanity Check for MC Cluster
func IsValidClusterKey ¶ added in v0.11.0
func IsValidKey ¶ added in v0.11.0
func PrintJiraIssues ¶ added in v0.18.0
func PrintJiraIssues(issues []jira.Issue)
func PrintLimitedSupportReasons ¶ added in v0.18.0
func PrintLimitedSupportReasons(limitedSupportReasons []*cmv1.LimitedSupportReason)
func PrintPDAlerts ¶ added in v0.18.0
func PrintServiceLogs ¶ added in v0.18.0
func StreamErrorln ¶ added in v0.13.0
func StreamErrorln(stream genericclioptions.IOStreams, msg string)
StreamErrorln prints the given error msg using the provided IOStreams
func StreamPrint ¶ added in v0.13.0
func StreamPrint(stream genericclioptions.IOStreams, msg string)
StreamPrint prints the given msg using the provided IOStreams
func StreamPrintln ¶ added in v0.13.0
func StreamPrintln(stream genericclioptions.IOStreams, msg string)
StreamPrintln appends a newline then prints the given msg using the provided IOStreams
func StreamRead ¶ added in v0.13.0
func StreamRead(stream genericclioptions.IOStreams, delim byte) (string, error)
StreamRead retrieves input from the provided IOStreams up to (and including) the delimiter given
Types ¶
type Config ¶ added in v0.14.3
type Config struct { AccessToken string `json:"access_token,omitempty" doc:"Bearer access token."` ClientID string `json:"client_id,omitempty" doc:"OpenID client identifier."` ClientSecret string `json:"client_secret,omitempty" doc:"OpenID client secret."` Insecure bool `` /* 142-byte string literal not displayed */ Password string `json:"password,omitempty" doc:"User password."` RefreshToken string `json:"refresh_token,omitempty" doc:"Offline or refresh token."` Scopes []string `` /* 172-byte string literal not displayed */ TokenURL string `json:"token_url,omitempty" doc:"OpenID token URL."` URL string `` /* 162-byte string literal not displayed */ User string `json:"user,omitempty" doc:"User name."` Pager string `json:"pager,omitempty" doc:"Pager command, for example 'less'. If empty no pager will be used."` }
Config describes the OCM client configuration Taken wholesale from openshift-online/ocm-cli
type DelayTracker ¶ added in v0.32.0
type DelayTracker struct {
// contains filtered or unexported fields
}
func StartDelayTracker ¶ added in v0.32.0
func StartDelayTracker(verbose bool, action string) *DelayTracker
func (*DelayTracker) End ¶ added in v0.32.0
func (dt *DelayTracker) End()