Documentation ¶
Index ¶
- Variables
- func AddCapiToScheme(scheme *runtime.Scheme)
- func CaptureGlobalCapiResources(dynamicClient dynamic.Interface, captureDir string, vzHelper VZHelper) error
- func CaptureGlobalRancherResources(dynamicClient dynamic.Interface, captureDir string, vzHelper VZHelper) error
- func CaptureK8SResources(client clipkg.Client, kubeClient kubernetes.Interface, ...) error
- func CaptureLogs(wg *sync.WaitGroup, ec chan ErrorsChannelLogs, kubeClient kubernetes.Interface, ...)
- func CaptureMetadata(captureDir string) error
- func CaptureMultiClusterOAMResources(dynamicClient dynamic.Interface, nsList []string, captureDir string, ...) error
- func CaptureOAMResources(dynamicClient dynamic.Interface, nsList []string, captureDir string, ...) error
- func CapturePodLog(kubeClient kubernetes.Interface, pod corev1.Pod, namespace, captureDir string, ...) error
- func CaptureVZResource(captureDir string, vz *v1beta1.Verrazzano) error
- func CaptureVerrazzanoManagedCluster(dynamicClient dynamic.Interface, captureDir string, vzHelper VZHelper) error
- func CaptureVerrazzanoProjects(dynamicClient dynamic.Interface, captureDir string, vzHelper VZHelper) error
- func CheckAndRemoveBugReportAndRedactionFileExistsInDir(dir string) bool
- func CheckAndRemoveBugReportExistsInDir(dir string) bool
- func CreateReportArchive(captureDir string, bugRepFile *os.File, addClusterSnapshot bool) error
- func DoesNamespaceExist(kubeClient kubernetes.Interface, namespace string, vzHelper VZHelper) (bool, error)
- func FindVerrazzanoResource(client client.Client) (*v1beta1.Verrazzano, error)
- func GenerateRedactionFileNameFromBugReportName(bugReportFileName string) string
- func GetAppConfigScheme() schema.GroupVersionResource
- func GetComponentConfigScheme() schema.GroupVersionResource
- func GetIngressTraitConfigScheme() schema.GroupVersionResource
- func GetIsLiveCluster() bool
- func GetLatestReleaseVersion(client *http.Client) (string, error)
- func GetMCAppConfigScheme() schema.GroupVersionResource
- func GetMCComponentScheme() schema.GroupVersionResource
- func GetManagedClusterConfigScheme() schema.GroupVersionResource
- func GetMetricsTraitConfigScheme() schema.GroupVersionResource
- func GetMultiWriterErr() io.Writer
- func GetMultiWriterOut() io.Writer
- func GetNamespacesForAllComponents(vz *v1beta1.Verrazzano) []string
- func GetOperatorYaml(version string) (string, error)
- func GetPodList(client clipkg.Client, appLabel, appName, namespace string) ([]corev1.Pod, error)
- func GetPodListAll(client clipkg.Client, namespace string) ([]corev1.Pod, error)
- func GetScheme() *runtime.Scheme
- func GetVZManagedNamespaces(kubeClient kubernetes.Interface) []string
- func GetVerrazzanoResource(client client.Client, namespacedName types.NamespacedName) (*v1beta1.Verrazzano, error)
- func GetVersionOut() string
- func GetVzProjectsConfigScheme() schema.GroupVersionResource
- func InitRegexToReplacementMap()
- func IsErrorReported() bool
- func LogError(msg string)
- func LogMessage(msg string)
- func NewScheme() *runtime.Scheme
- func NewVerrazzanoForGroupVersion(groupVersion schema.GroupVersion) func() interface{}
- func NewVerrazzanoForVZVersion(version string) (schema.GroupVersion, client.Object, error)
- func RemoveDuplicate(origSlice []string) []string
- func SanitizeString(l string, redactedValuesOverride map[string]string) string
- func SetIsLiveCluster()
- func SetK8sVer() error
- func SetMultiWriterErr(errStream io.Writer, errFile *os.File)
- func SetMultiWriterOut(outStream io.Writer, outFile *os.File)
- func SetVerboseOutput(enableVerbose bool)
- func SetVzVer(client *client.Client) error
- func UntarArchive(captureDir string, tarFile *os.File) error
- func UpdateVerrazzanoResource(client client.Client, vz *v1beta1.Verrazzano) error
- func VerifyVzInstallNamespaceExists(kubeClient kubernetes.Interface) bool
- func WriteRedactionMapFile(outputFilePath string, redactedValuesOverride map[string]string) error
- type CaCrtInfo
- type ClusterSnapshotCtx
- type ErrorsChannel
- type ErrorsChannelLogs
- type Metadata
- type PodLogs
- type Pods
- type ReportCtx
- type VZHelper
Constants ¶
This section is empty.
Variables ¶
var KnownHostNames = make(map[string]bool)
Functions ¶
func AddCapiToScheme ¶ added in v1.6.1
func CaptureGlobalCapiResources ¶ added in v1.6.1
func CaptureGlobalCapiResources(dynamicClient dynamic.Interface, captureDir string, vzHelper VZHelper) error
CaptureGlobalCapiResources captures global resources related to ClusterAPI
func CaptureGlobalRancherResources ¶ added in v1.6.2
func CaptureGlobalRancherResources(dynamicClient dynamic.Interface, captureDir string, vzHelper VZHelper) error
CaptureGlobalRancherResources captures global resources related to ClusterAPI
func CaptureK8SResources ¶
func CaptureK8SResources(client clipkg.Client, kubeClient kubernetes.Interface, dynamicClient dynamic.Interface, namespace, captureDir string, vzHelper VZHelper) error
CaptureK8SResources collects the Workloads (Deployment and ReplicaSet, StatefulSet, Daemonset), pods, events, ingress services, and cert-manager certificates from the specified namespace, as JSON files
func CaptureLogs ¶ added in v1.6.11
func CaptureLogs(wg *sync.WaitGroup, ec chan ErrorsChannelLogs, kubeClient kubernetes.Interface, pod Pods, bugReportDir string, vzHelper VZHelper, podLog PodLogs)
CaptureLogs collects the logs from platform operator, application operator and monitoring operator in parallel
func CaptureMetadata ¶ added in v1.6.11
captureMetadata gets the current time in UTC on the user's system and outputs it in RFC 3339 format to the user's system
func CaptureMultiClusterOAMResources ¶ added in v1.4.4
func CaptureMultiClusterOAMResources(dynamicClient dynamic.Interface, nsList []string, captureDir string, vzHelper VZHelper) error
CaptureMultiClusterOAMResources captures OAM resources in multi-cluster environment
func CaptureOAMResources ¶
func CaptureOAMResources(dynamicClient dynamic.Interface, nsList []string, captureDir string, vzHelper VZHelper) error
CaptureOAMResources captures OAM resources in the given list of namespaces
func CapturePodLog ¶
func CapturePodLog(kubeClient kubernetes.Interface, pod corev1.Pod, namespace, captureDir string, vzHelper VZHelper, duration int64, previous bool) error
CapturePodLog captures the log from the pod in the captureDir
func CaptureVZResource ¶
func CaptureVZResource(captureDir string, vz *v1beta1.Verrazzano) error
CaptureVZResource captures Verrazzano resources as a JSON file
func CaptureVerrazzanoManagedCluster ¶ added in v1.4.4
func CaptureVerrazzanoManagedCluster(dynamicClient dynamic.Interface, captureDir string, vzHelper VZHelper) error
CaptureVerrazzanoManagedCluster captures VerrazzanoManagedCluster in verrazzano-mc namespace, as a JSON file
func CaptureVerrazzanoProjects ¶ added in v1.4.4
func CaptureVerrazzanoProjects(dynamicClient dynamic.Interface, captureDir string, vzHelper VZHelper) error
CaptureVerrazzanoProjects captures the Verrazzano projects in the verrazzano-mc namespace, as a JSON file
func CheckAndRemoveBugReportAndRedactionFileExistsInDir ¶ added in v1.6.11
CheckAndRemoveBugReportAndRedactionFileExistsInDir checks that both a vz bug-report file and a redacted values file exists in dir, with matching names
func CheckAndRemoveBugReportExistsInDir ¶ added in v1.6.0
CheckAndRemoveBugReportExistsInDir checks vz bug report exists in dir or not
func CreateReportArchive ¶
CreateReportArchive creates the .tar.gz file specified by bugReportFile, from the files in captureDir If the addClusterSnapshot value is set to true, a value of "cluster-snapshot" prefixes every file path that is put into the archive
func DoesNamespaceExist ¶
func DoesNamespaceExist(kubeClient kubernetes.Interface, namespace string, vzHelper VZHelper) (bool, error)
DoesNamespaceExist checks whether the namespace exists in the cluster
func FindVerrazzanoResource ¶
func FindVerrazzanoResource(client client.Client) (*v1beta1.Verrazzano, error)
FindVerrazzanoResource - find the single Verrazzano resource
func GenerateRedactionFileNameFromBugReportName ¶ added in v1.6.11
generateRedactionFileNameFromBugReportName returns a name for the redacted values file to match the bugReportFileName. For example, for a bugReportFileName of vz-bug-report-datetime-xxxx.tar.gz, this function returns vz-bug-report-datetime-xxxx-sensitive-do-not-share-redaction-map.csv.
func GetAppConfigScheme ¶
func GetAppConfigScheme() schema.GroupVersionResource
GetAppConfigScheme returns GroupVersionResource for ApplicationConfiguration
func GetComponentConfigScheme ¶
func GetComponentConfigScheme() schema.GroupVersionResource
GetComponentConfigScheme returns GroupVersionResource for Component
func GetIngressTraitConfigScheme ¶
func GetIngressTraitConfigScheme() schema.GroupVersionResource
GetIngressTraitConfigScheme returns GroupVersionResource for IngressTrait
func GetIsLiveCluster ¶
func GetIsLiveCluster() bool
GetIsLiveCluster returns a boolean indicating whether it is live cluster analysis
func GetLatestReleaseVersion ¶
GetLatestReleaseVersion - get the version of the latest release of Verrazzano
func GetMCAppConfigScheme ¶
func GetMCAppConfigScheme() schema.GroupVersionResource
GetMCAppConfigScheme returns GroupVersionResource for MulticlusterApplicationConfiguration
func GetMCComponentScheme ¶
func GetMCComponentScheme() schema.GroupVersionResource
GetMCComponentScheme returns GroupVersionResource for MulticlusterComponent
func GetManagedClusterConfigScheme ¶
func GetManagedClusterConfigScheme() schema.GroupVersionResource
GetManagedClusterConfigScheme returns GroupVersionResource for VerrazzanoManagedCluster
func GetMetricsTraitConfigScheme ¶
func GetMetricsTraitConfigScheme() schema.GroupVersionResource
GetMetricsTraitConfigScheme returns GroupVersionResource for MetricsTrait
func GetMultiWriterErr ¶
GetMultiWriterErr returns the MultiWriter for standard error
func GetMultiWriterOut ¶
GetMultiWriterOut returns the MultiWriter for standard output
func GetNamespacesForAllComponents ¶
func GetNamespacesForAllComponents(vz *v1beta1.Verrazzano) []string
GetNamespacesForAllComponents returns the list of unique namespaces of all the components included in the Verrazzano resource
func GetOperatorYaml ¶
GetOperatorYaml returns Kubernetes manifests to deploy the Verrazzano platform operator The return value is operator.yaml for releases earlier than 1.4.0 and verrazzano-platform-operator.yaml from release 1.4.0 onwards
func GetPodList ¶
GetPodList returns list of pods matching the label in the given namespace
func GetPodListAll ¶ added in v1.4.4
GetPodListAll returns list of pods in the given namespace Will be used to fetch all pods in additional namespace
func GetVZManagedNamespaces ¶
func GetVZManagedNamespaces(kubeClient kubernetes.Interface) []string
GetVZManagedNamespaces returns the namespaces with label verrazzano-managed=true
func GetVerrazzanoResource ¶
func GetVerrazzanoResource(client client.Client, namespacedName types.NamespacedName) (*v1beta1.Verrazzano, error)
GetVerrazzanoResource - get a Verrazzano resource
func GetVersionOut ¶ added in v1.6.0
func GetVersionOut() string
GetVersionOut returns the customised k8s and vz version string
func GetVzProjectsConfigScheme ¶
func GetVzProjectsConfigScheme() schema.GroupVersionResource
GetVzProjectsConfigScheme returns GroupVersionResource for VerrazzanoProject
func InitRegexToReplacementMap ¶
func InitRegexToReplacementMap()
InitRegexToReplacementMap Initialize the regex string to replacement string map Append to this map for any future additions
func IsErrorReported ¶
func IsErrorReported() bool
IsErrorReported returns true when the command logs at least one error to the standard error
func NewVerrazzanoForGroupVersion ¶
func NewVerrazzanoForGroupVersion(groupVersion schema.GroupVersion) func() interface{}
func RemoveDuplicate ¶
RemoveDuplicate removes duplicates from origSlice
func SanitizeString ¶
SanitizeString sanitizes each line in a given file, Sanitizes based on the regex map initialized above, which is currently filtering for IPv4 addresses and hostnames
The redactedValuesOverride parameter can be used to override the default redactedValues map for keeping track of redacted strings.
func SetIsLiveCluster ¶
func SetIsLiveCluster()
SetIsLiveCluster sets true to isLiveCluster, indicating the live cluster analysis usage
func SetK8sVer ¶ added in v1.6.0
func SetK8sVer() error
SetK8sVer returns cluster Kubernetes version
func SetMultiWriterErr ¶
SetMultiWriterErr sets MultiWriter for standard error
func SetMultiWriterOut ¶
SetMultiWriterOut sets MultiWriter for standard output
func SetVerboseOutput ¶
func SetVerboseOutput(enableVerbose bool)
SetVerboseOutput sets the verbose output for the commands bug-report and analyze
func UntarArchive ¶ added in v1.6.11
UntarArchive untars the specified file and puts it in the capture directory
func UpdateVerrazzanoResource ¶
func UpdateVerrazzanoResource(client client.Client, vz *v1beta1.Verrazzano) error
func VerifyVzInstallNamespaceExists ¶ added in v1.6.0
func VerifyVzInstallNamespaceExists(kubeClient kubernetes.Interface) bool
VerifyVzInstallNamespaceExists returns existence of verrazzano-install namespace
func WriteRedactionMapFile ¶ added in v1.6.11
WriteRedactionMapFile creates a CSV file at the provided outputFilePath to document all the values this tool has redacted so far, stored in the redactedValues (or redactedValuesOverride) map.
Types ¶
type ClusterSnapshotCtx ¶ added in v1.6.0
type ErrorsChannel ¶ added in v1.6.11
type ErrorsChannel struct {
ErrorMessage string `json:"errorMessage"`
}
type ErrorsChannelLogs ¶ added in v1.6.11
type VZHelper ¶
type VZHelper interface { GetOutputStream() io.Writer GetErrorStream() io.Writer GetInputStream() io.Reader GetClient(cmd *cobra.Command) (client.Client, error) GetKubeClient(cmd *cobra.Command) (kubernetes.Interface, error) GetHTTPClient() *http.Client GetDynamicClient(cmd *cobra.Command) (dynamic.Interface, error) GetDiscoveryClient(cmd *cobra.Command) (discovery.DiscoveryInterface, error) VerifyCLIArgsNil(cmd *cobra.Command) error }