summary

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package summary provides the entrypoint to process the results of the provider and baseline validations, applying filters and transformations to the data.

Index

Constants

View Source
const (
	ResultSourceNameProvider = "provider"
	ResultSourceNameBaseline = "baseline"
)
View Source
const (
	SuiteNameKubernetesConformance = "kubernetes/conformance"
	SuiteNameOpenshiftConformance  = "openshift/conformance"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsolidatedSummary

type ConsolidatedSummary struct {
	Verbose     bool
	Timers      *metrics.Timers
	Provider    *ResultSummary
	Baseline    *ResultSummary
	BaselineAPI *baseline.BaselineConfig
}

ConsolidatedSummary Aggregate the results of provider and baseline

func (*ConsolidatedSummary) GetBaseline

func (cs *ConsolidatedSummary) GetBaseline() *ResultSummary

GetBaseline get the baseline results.

func (*ConsolidatedSummary) GetProvider

func (cs *ConsolidatedSummary) GetProvider() *ResultSummary

GetProvider get the provider results.

func (*ConsolidatedSummary) HasBaselineResults

func (cs *ConsolidatedSummary) HasBaselineResults() bool

HasBaselineResults checks if the baseline results was set (--dif), and has valid data.

func (*ConsolidatedSummary) Process

func (cs *ConsolidatedSummary) Process() error

Process entrypoint to read and fill all summaries for each archive, plugin and suites applying any transformation it needs through filters.

func (*ConsolidatedSummary) SaveResults

func (cs *ConsolidatedSummary) SaveResults(path string) error

SaveResults dump all the results and processed to the disk to be used on the review process.

type ConsolidatedSummaryInput

type ConsolidatedSummaryInput struct {
	Archive     string
	ArchiveBase string
	SaveTo      string
	Verbose     bool
	Timers      *metrics.Timers
}

type Node

type Node struct {
	Hostname          string            `json:"hostname,omitempty"`
	Architecture      string            `json:"architecture,omitempty"`
	OperatingSystem   string            `json:"os,omitempty"`
	OperatingSystemId string            `json:"osId,omitempty"`
	CreationDate      string            `json:"creationDate,omitempty"`
	NodeRoles         string            `json:"nodeRoles,omitempty"`
	TaintsNodeRole    string            `json:"taints,omitempty"`
	CapacityCPU       string            `json:"capacityCpu,omitempty"`
	CapacityStorageGB string            `json:"capacityStorageGB,omitempty"`
	CapacityMemGB     string            `json:"capacityMemGB,omitempty"`
	Labels            map[string]string `json:"labels,omitempty"`
	ControlPlane      bool              `json:"controlPlane,omitempty"`
}

type OpenShiftSummary

type OpenShiftSummary struct {
	Infrastructure   *configv1.Infrastructure
	ClusterVersion   *configv1.ClusterVersion
	ClusterOperators *configv1.ClusterOperatorList
	ClusterNetwork   *configv1.Network
	Nodes            []*Node

	// Plugin Results
	PluginResultK8sConformance     *plugin.OPCTPluginSummary
	PluginResultOCPValidated       *plugin.OPCTPluginSummary
	PluginResultConformanceUpgrade *plugin.OPCTPluginSummary
	PluginResultArtifactsCollector *plugin.OPCTPluginSummary
	PluginResultConformanceReplay  *plugin.OPCTPluginSummary

	// get from Sonobuoy metadata
	VersionK8S string
}

OpenShiftSummary holds the data collected from artifacts related to OpenShift objects.

func NewOpenShiftSummary

func NewOpenShiftSummary() *OpenShiftSummary

func (*OpenShiftSummary) GetClusterNetwork

func (os *OpenShiftSummary) GetClusterNetwork() (*SummaryOpenShiftClusterNetworkV1, error)

func (*OpenShiftSummary) GetClusterOperator

func (os *OpenShiftSummary) GetClusterOperator() (*SummaryClusterOperatorOutput, error)

func (*OpenShiftSummary) GetClusterVersion

func (os *OpenShiftSummary) GetClusterVersion() (*SummaryClusterVersionOutput, error)

func (*OpenShiftSummary) GetClusterVersionXY

func (os *OpenShiftSummary) GetClusterVersionXY() (string, error)

func (*OpenShiftSummary) GetInfrastructure

func (os *OpenShiftSummary) GetInfrastructure() (*SummaryOpenShiftInfrastructureV1, error)

func (*OpenShiftSummary) GetInfrastructurePlatformType

func (os *OpenShiftSummary) GetInfrastructurePlatformType() string

func (*OpenShiftSummary) GetNodes

func (os *OpenShiftSummary) GetNodes() []*Node

func (*OpenShiftSummary) GetResultArtifactsCollector

func (os *OpenShiftSummary) GetResultArtifactsCollector() *plugin.OPCTPluginSummary

func (*OpenShiftSummary) GetResultConformanceReplay

func (os *OpenShiftSummary) GetResultConformanceReplay() *plugin.OPCTPluginSummary

func (*OpenShiftSummary) GetResultConformanceUpgrade

func (os *OpenShiftSummary) GetResultConformanceUpgrade() *plugin.OPCTPluginSummary

func (*OpenShiftSummary) GetResultK8SValidated

func (os *OpenShiftSummary) GetResultK8SValidated() *plugin.OPCTPluginSummary

func (*OpenShiftSummary) GetResultOCPValidated

func (os *OpenShiftSummary) GetResultOCPValidated() *plugin.OPCTPluginSummary

func (*OpenShiftSummary) SetClusterNetwork

func (os *OpenShiftSummary) SetClusterNetwork(cn *configv1.NetworkList) error

func (*OpenShiftSummary) SetClusterOperators

func (os *OpenShiftSummary) SetClusterOperators(cr *configv1.ClusterOperatorList) error

func (*OpenShiftSummary) SetClusterVersion

func (os *OpenShiftSummary) SetClusterVersion(cr *configv1.ClusterVersionList) error

func (*OpenShiftSummary) SetInfrastructure

func (os *OpenShiftSummary) SetInfrastructure(cr *configv1.InfrastructureList) error

func (*OpenShiftSummary) SetNodes

func (os *OpenShiftSummary) SetNodes(nodes *v1.NodeList) error

func (*OpenShiftSummary) SetPluginResult

func (os *OpenShiftSummary) SetPluginResult(in *plugin.OPCTPluginSummary) error

type OpenshiftTestsSuite

type OpenshiftTestsSuite struct {
	InputFile string
	Name      string
	Count     int
	Tests     []string `json:"-"`
}

func (*OpenshiftTestsSuite) Load

func (s *OpenshiftTestsSuite) Load(ifile string, buf *bytes.Buffer) error

type OpenshiftTestsSuites

type OpenshiftTestsSuites struct {
	KubernetesConformance *OpenshiftTestsSuite
	OpenshiftConformance  *OpenshiftTestsSuite
}

func (*OpenshiftTestsSuites) GetTotalK8S

func (ts *OpenshiftTestsSuites) GetTotalK8S() int

func (*OpenshiftTestsSuites) GetTotalOCP

func (ts *OpenshiftTestsSuites) GetTotalOCP() int

type ResultSummary

type ResultSummary struct {
	Name      string
	Archive   string
	Sonobuoy  *SonobuoySummary
	OpenShift *OpenShiftSummary
	Suites    *OpenshiftTestsSuites

	// SavePath is the target path to save the extracted report.
	SavePath string

	// MustGather stores the extracted items from must-gather.
	MustGather *mustgather.MustGather

	HasCAMGI         bool
	HasMetrics       bool
	HasInstallConfig bool

	// Metrics stores the extracted items from must-gather metrics.
	Metrics *mustgathermetrics.MustGatherMetrics

	// Plugin Know failures
	TestSuiteKnownFailures []string

	// BaselineAPI holds the data fetched from the baseline API.
	BaselineAPI string
	// contains filtered or unexported fields
}

ResultSummary persists the reference of results archive.

func (*ResultSummary) GetOpenShift

func (rs *ResultSummary) GetOpenShift() *OpenShiftSummary

GetOpenShift returns the OpenShift objects parsed from results

func (*ResultSummary) GetSonobuoy

func (rs *ResultSummary) GetSonobuoy() *SonobuoySummary

GetSonobuoy returns the Sonobuoy objects parsed from results

func (*ResultSummary) GetSonobuoyCluster

func (rs *ResultSummary) GetSonobuoyCluster() *discovery.ClusterSummary

GetSonobuoyCluster returns the SonobuoyCluster object parsed from results

func (*ResultSummary) GetSuites

func (rs *ResultSummary) GetSuites() *OpenshiftTestsSuites

GetSuites returns the Conformance suites collected from results

func (*ResultSummary) HasValidResults

func (rs *ResultSummary) HasValidResults() bool

HasValidResults checks if the result instance has valid archive to be processed, returning true if it's valid. Invalid results happens when the baseline archive was not set on the CLI arguments, making the 'process' command to ignore the comparisons and filters related.

func (*ResultSummary) Populate

func (rs *ResultSummary) Populate() error

Populate open the archive and process the files to populate the summary structures.

type SonobuoyPluginDefinition

type SonobuoyPluginDefinition struct {
	Definition    *SonobuoyPluginDefinitionManifest `json:"Definition"`
	SonobuoyImage string                            `json:"SonobuoyImage"`
}

Plugin is the sonobuoy plugin definitoin.

type SonobuoyPluginDefinitionManifest

type SonobuoyPluginDefinitionManifest = manifest.Manifest

type SonobuoySummary

type SonobuoySummary struct {
	Cluster           *discovery.ClusterSummary
	MetaRuntime       []*archive.RuntimeInfoItem
	MetaConfig        []*archive.RuntimeInfoItem
	OpctConfig        []*archive.RuntimeInfoItem
	PluginsDefinition map[string]*SonobuoyPluginDefinition
}

func NewSonobuoySummary

func NewSonobuoySummary() *SonobuoySummary

func (*SonobuoySummary) ParseMetaConfig

func (s *SonobuoySummary) ParseMetaConfig(metaConfig *archive.MetaConfigSonobuoy)

func (*SonobuoySummary) ParseMetaRunlogs

func (s *SonobuoySummary) ParseMetaRunlogs(logLines *bytes.Buffer)

func (*SonobuoySummary) ParseOpctConfigMap

func (s *SonobuoySummary) ParseOpctConfigMap(cm *v1.ConfigMapList)

func (*SonobuoySummary) SetCluster

func (s *SonobuoySummary) SetCluster(c *discovery.ClusterSummary) error

func (*SonobuoySummary) SetPluginDefinition

func (s *SonobuoySummary) SetPluginDefinition(name string, def *SonobuoyPluginDefinition)

func (*SonobuoySummary) SetPluginsDefinition

func (s *SonobuoySummary) SetPluginsDefinition(p map[string]*SonobuoyPluginDefinition) error

type SummaryClusterOperatorOutput

type SummaryClusterOperatorOutput struct {
	CountAvailable   uint64
	CountProgressing uint64
	CountDegraded    uint64
}

type SummaryClusterVersionOutput

type SummaryClusterVersionOutput struct {
	Desired                           string `json:"desired"`
	Previous                          string `json:"previous"`
	Channel                           string `json:"channel"`
	ClusterID                         string `json:"clusterID"`
	OverallStatus                     string `json:"overallStatus"`
	OverallStatusReason               string `json:"overallStatusReason,omitempty"`
	OverallStatusMessage              string `json:"overallStatusMessage,omitempty"`
	CondAvailable                     string `json:"conditionAvailable,omitempty"`
	CondFailing                       string `json:"conditionFailing,omitempty"`
	CondProgressing                   string `json:"conditionProgressing,omitempty"`
	CondProgressingMessage            string `json:"conditionProgressingMessage,omitempty"`
	CondRetrievedUpdates              string `json:"conditionUpdates,omitempty"`
	CondImplicitlyEnabledCapabilities string `json:"conditionImplicitlyEnabledCapabilities,omitempty"`
	CondReleaseAccepted               string `json:"conditionReleaseAccepted,omitempty"`
}

type SummaryOpenShiftClusterNetworkV1

type SummaryOpenShiftClusterNetworkV1 = configv1.Network

type SummaryOpenShiftInfrastructureV1

type SummaryOpenShiftInfrastructureV1 = configv1.Infrastructure

type SummaryOpenShiftNetworkV1

type SummaryOpenShiftNetworkV1 = configv1.Network

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL