transform

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoConfidence represents report items we can not migrate
	NoConfidence = iota

	// ModerateConfidence represents report items we can migrate with caveats
	ModerateConfidence

	// HighConfidence represents report items we can migrate without issue
	HighConfidence

	// OCP4InstallMsg message about using generated manifests
	OCP4InstallMsg = `` /* 355-byte string literal not displayed */

)
View Source
const ClusterTransformName = "Cluster"

ClusterTransformName is the cluster report name

Variables

View Source
var ReportOutputFlush = func(r Report) error {
	logrus.Info("Flushing reports to disk")
	reportoutput.DumpReports(r.Report)
	return nil
}

ReportOutputFlush flush reports to disk

Functions

func GenYAML

func GenYAML(CR interface{}) ([]byte, error)

GenYAML returns a YAML of the CR

func HandleError

func HandleError(err error, transformType string) error

HandleError handles errors

func Start

func Start()

Start generating manifests to be used with Openshift 4

Types

type Cluster

type Cluster struct {
	Master Master
}

Cluster contains a cluster

type ClusterExtraction

type ClusterExtraction struct {
	api.Resources
}

ClusterExtraction holds data extracted from k8s API resources

func (ClusterExtraction) Transform

func (e ClusterExtraction) Transform() ([]Output, error)

Transform converts data collected from an OCP3 API into a useful output

func (ClusterExtraction) Validate

func (e ClusterExtraction) Validate() (err error)

Validate no need to validate it, data is exctracted from API

type ClusterTransform

type ClusterTransform struct {
}

ClusterTransform reprents transform for k8s API resources

func (ClusterTransform) Extract

func (e ClusterTransform) Extract() (Extraction, error)

Extract collects data for cluster report

func (ClusterTransform) Name

func (e ClusterTransform) Name() string

Name returns a human readable name for the transform

type Extraction

type Extraction interface {
	Transform() ([]Output, error)
	Validate() error
}

Extraction is a generic data extraction

type Manifest

type Manifest struct {
	Name string
	CRD  []byte
}

Manifest to be exported for use with OCP 4

type Master

type Master struct {
	OAuth      configv1.OAuth
	Secrets    []*corev1.Secret
	ConfigMaps []*corev1.ConfigMap
}

Master is a cluster Master

type Output

type Output interface {
	Flush() error
}

Output is a generic output type

type Report

type Report struct {
	Report reportoutput.ReportOutput
}

Report represents structure for final output

var FinalReportOutput Report

FinalReportOutput represents final output

func (Report) Flush

func (r Report) Flush() error

Flush reports to files

type Runner

type Runner struct {
}

Runner a generic transform runner

func NewRunner

func NewRunner() *Runner

NewRunner creates a new Runner

func (Runner) Transform

func (r Runner) Transform(transforms []Transform)

Transform is the process run to complete a transform

type Transform

type Transform interface {
	Extract() (Extraction, error)
	Name() string
}

Transform is a generic transform

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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