Documentation
¶
Overview ¶
Copyright (C) 2020-2022 Red Hat, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2020-2024 Red Hat, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2022-2024 Red Hat, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2022-2024 Red Hat, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Copyright (C) 2020-2024 Red Hat, Inc.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Index ¶
- Constants
- Variables
- func CountPodsByStatus(allPods []corev1.Pod) map[string]int
- func CreateLabels(labelStrings []string) (labelObjects []labelObject)
- func FindCrObjectByNameByNamespace(scalesGetter scale.ScalesGetter, ns, name string, ...) (*scalingv1.Scale, error)
- func FindDeploymentByNameByNamespace(appClient appv1client.AppsV1Interface, namespace, name string) (*appsv1.Deployment, error)
- func FindPodsByLabels(oc corev1client.CoreV1Interface, labels []labelObject, namespaces []string) (runningPods, allPods []corev1.Pod)
- func FindStatefulsetByNameByNamespace(appClient appv1client.AppsV1Interface, namespace, name string) (*appsv1.StatefulSet, error)
- func FindTestCrdNames(clusterCrds []*apiextv1.CustomResourceDefinition, ...) (targetCrds []*apiextv1.CustomResourceDefinition)
- type DiscoveredTestData
- type PodStates
- type ScaleObject
Constants ¶
const (
// NonOpenshiftClusterVersion is a fake version number for non openshift clusters (kind/minikube)
NonOpenshiftClusterVersion = "0.0.0"
)
Variables ¶
var SriovNetworkGVR = schema.GroupVersionResource{
Group: "sriovnetwork.openshift.io",
Version: "v1",
Resource: "sriovnetworks",
}
SriovNetworkGVR defines the GroupVersionResource for SriovNetwork
var SriovNetworkNodePolicyGVR = schema.GroupVersionResource{
Group: "sriovnetwork.openshift.io",
Version: "v1",
Resource: "sriovnetworknodepolicies",
}
SriovNetworkNodePolicyGVR defines the GroupVersionResource for SriovNetworkNodePolicy
Functions ¶
func CreateLabels ¶
func CreateLabels(labelStrings []string) (labelObjects []labelObject)
func FindCrObjectByNameByNamespace ¶
func FindCrObjectByNameByNamespace(scalesGetter scale.ScalesGetter, ns, name string, groupResourceSchema schema.GroupResource) (*scalingv1.Scale, error)
func FindDeploymentByNameByNamespace ¶
func FindDeploymentByNameByNamespace(appClient appv1client.AppsV1Interface, namespace, name string) (*appsv1.Deployment, error)
func FindPodsByLabels ¶
func FindPodsByLabels(oc corev1client.CoreV1Interface, labels []labelObject, namespaces []string) (runningPods, allPods []corev1.Pod)
func FindStatefulsetByNameByNamespace ¶
func FindStatefulsetByNameByNamespace(appClient appv1client.AppsV1Interface, namespace, name string) (*appsv1.StatefulSet, error)
func FindTestCrdNames ¶
func FindTestCrdNames(clusterCrds []*apiextv1.CustomResourceDefinition, crdFilters []configuration.CrdFilter) (targetCrds []*apiextv1.CustomResourceDefinition)
FindTestCrdNames gets a list of CRD names based on configured groups.
Types ¶
type DiscoveredTestData ¶
type DiscoveredTestData struct {
Env configuration.TestParameters
PodStates PodStates
Pods []corev1.Pod
AllPods []corev1.Pod
ProbePods []corev1.Pod
CSVToPodListMap map[types.NamespacedName][]*corev1.Pod
OperandPods []*corev1.Pod
ResourceQuotaItems []corev1.ResourceQuota
PodDisruptionBudgets []policyv1.PodDisruptionBudget
NetworkPolicies []networkingv1.NetworkPolicy
Crds []*apiextv1.CustomResourceDefinition
Namespaces []string
AllNamespaces []string
AbnormalEvents []corev1.Event
Csvs []*olmv1Alpha.ClusterServiceVersion
AllCrds []*apiextv1.CustomResourceDefinition
AllCsvs []*olmv1Alpha.ClusterServiceVersion
AllInstallPlans []*olmv1Alpha.InstallPlan
AllCatalogSources []*olmv1Alpha.CatalogSource
AllPackageManifests []*olmPkgv1.PackageManifest
ClusterOperators []configv1.ClusterOperator
SriovNetworks []unstructured.Unstructured
SriovNetworkNodePolicies []unstructured.Unstructured
AllSriovNetworks []unstructured.Unstructured
AllSriovNetworkNodePolicies []unstructured.Unstructured
NetworkAttachmentDefinitions []nadClient.NetworkAttachmentDefinition
Deployments []appsv1.Deployment
StatefulSet []appsv1.StatefulSet
PersistentVolumes []corev1.PersistentVolume
PersistentVolumeClaims []corev1.PersistentVolumeClaim
ClusterRoleBindings []rbacv1.ClusterRoleBinding
RoleBindings []rbacv1.RoleBinding // Contains all rolebindings from all namespaces
Roles []rbacv1.Role // Contains all roles from all namespaces
Services []*corev1.Service
AllServices []*corev1.Service
ServiceAccounts []*corev1.ServiceAccount
AllServiceAccounts []*corev1.ServiceAccount
Hpas []*scalingv1.HorizontalPodAutoscaler
Subscriptions []olmv1Alpha.Subscription
AllSubscriptions []olmv1Alpha.Subscription
HelmChartReleases map[string][]*release.Release
K8sVersion string
OpenshiftVersion string
OCPStatus string
Nodes *corev1.NodeList
IstioServiceMeshFound bool
ValidProtocolNames []string
StorageClasses []storagev1.StorageClass
ServicesIgnoreList []string
ScaleCrUnderTest []ScaleObject
ExecutedBy string
PartnerName string
CollectorAppPassword string
CollectorAppEndpoint string
ConnectAPIKey string
ConnectProjectID string
ConnectAPIBaseURL string
ConnectAPIProxyURL string
ConnectAPIProxyPort string
}
func DoAutoDiscover ¶
func DoAutoDiscover(config *configuration.TestConfiguration) DiscoveredTestData
DoAutoDiscover finds objects under test
type ScaleObject ¶
type ScaleObject struct {
Scale *scalingv1.Scale
GroupResourceSchema schema.GroupResource
}
func GetScaleCrUnderTest ¶
func GetScaleCrUnderTest(namespaces []string, crds []*apiextv1.CustomResourceDefinition) []ScaleObject
Source Files
¶
- autodiscover.go
- autodiscover_clusteroperators.go
- autodiscover_crds.go
- autodiscover_debug.go
- autodiscover_events.go
- autodiscover_nads.go
- autodiscover_networkpolicies.go
- autodiscover_operators.go
- autodiscover_pdbs.go
- autodiscover_pods.go
- autodiscover_podset.go
- autodiscover_pv.go
- autodiscover_rbac.go
- autodiscover_resources.go
- autodiscover_scales.go
- autodiscover_service_accounts.go
- autodiscover_services.go
- autodiscover_sriov.go
- constants.go