Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffEntry ¶
type DiffEntry struct { Name string `json:"name"` Kind ManifestKind `json:"kind"` DiffType DiffType `json:"diffType,omitempty"` Diffs []difflib.DiffRecord `json:"diffs,omitempty"` Subs []*DiffEntry `json:"subs,omitempty"` }
DiffEntry records diff info of OAM object
type DryRun ¶
type DryRun interface {
ExecuteDryRun(ctx context.Context, app *v1beta1.Application) ([]*types.ComponentManifest, error)
}
DryRun executes dry-run on an application
type LiveDiffOption ¶
LiveDiffOption contains options for comparing an application with a living AppRevision in the cluster
func NewLiveDiffOption ¶
func NewLiveDiffOption(c client.Client, dm discoverymapper.DiscoveryMapper, pd *packages.PackageDiscover, as []oam.Object) *LiveDiffOption
NewLiveDiffOption creates a live-diff option
func (*LiveDiffOption) Diff ¶
func (l *LiveDiffOption) Diff(ctx context.Context, app *v1beta1.Application, appRevision *v1beta1.ApplicationRevision) (*DiffEntry, error)
Diff does three phases, dry-run on input app, preparing manifest for diff, and calculating diff on manifests.
type ManifestKind ¶
type ManifestKind string
ManifestKind enums the kind of OAM objects
const ( AppKind ManifestKind = "Application" AppConfigCompKind ManifestKind = "AppConfigComponent" RawCompKind ManifestKind = "Component" TraitKind ManifestKind = "Trait" )
enum kinds of manifest objects
type Option ¶
type Option struct { Client client.Client DiscoveryMapper discoverymapper.DiscoveryMapper PackageDiscover *packages.PackageDiscover // Auxiliaries are capability definitions used to parse application. // DryRun will use capabilities in Auxiliaries as higher priority than // getting one from cluster. Auxiliaries []oam.Object }
Option contains options to execute dry-run
func NewDryRunOption ¶
func NewDryRunOption(c client.Client, dm discoverymapper.DiscoveryMapper, pd *packages.PackageDiscover, as []oam.Object) *Option
NewDryRunOption creates a dry-run option
func (*Option) ExecuteDryRun ¶
func (d *Option) ExecuteDryRun(ctx context.Context, app *v1beta1.Application) ([]*types.ComponentManifest, error)
ExecuteDryRun simulates applying an application into cluster and returns rendered resources but not persist them into cluster.
type ReportDiffOption ¶
ReportDiffOption contains options to formats and prints diff report
func NewReportDiffOption ¶
func NewReportDiffOption(ctx int, to io.Writer) *ReportDiffOption
NewReportDiffOption creats a new ReportDiffOption that can formats and prints diff report into an io.Writer
func (*ReportDiffOption) PrintDiffReport ¶
func (r *ReportDiffOption) PrintDiffReport(app *DiffEntry)
PrintDiffReport formats and prints diff data into target io.Writer 'app' should be a diifEntry whose top-level is an application