ocplifecycle

package
v0.0.0-...-388220c Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]map[string][]LifecyclePhase

Config is an OCP lifecycle config. It holds a top-level product key (e.G. OCP) that maps to versions (e.G. 4.8) and those finally include the lifecycle phases.

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig loads the lifecycle configuration from a given localtion.

func (Config) GetTimeline

func (c Config) GetTimeline(product string, opts ...TimelineOptions) Timeline

GetTimeline returns a list of events in chronological order for a given product name.

func (Config) GetTimelinesByVersion

func (c Config) GetTimelinesByVersion(product string) TimelineByVersion

GetTimeline returns a list of events in chronological order for a given product name mapped by version.

type Event

type Event struct {
	ProductVersion string
	LifecyclePhase LifecyclePhase
}

Event holds information about the product version and the lifecycle phase.

type LifecycleEvent

type LifecycleEvent string

LifecycleEvent is an event in the lifecycle of a version of a product.

const (
	// LifecycleEventOpen marks the moment that development branches open for changes.
	LifecycleEventOpen LifecycleEvent = "open"
	// LifecycleEventFeatureFreeze marks the moment that development branches close for new features.
	// At this point it is expected that only stabilizing bug-fixes land in the branches.
	LifecycleEventFeatureFreeze LifecycleEvent = "feature-freeze"
	// LifecycleEventCodeFreeze marks the moment that development branches close for contribution.
	// At this point it is expected that only urgent stabilizing bug-fixes land in the branches.
	LifecycleEventCodeFreeze LifecycleEvent = "code-freeze"
	// LifecycleEventGenerallyAvailable marks the moment that a version is available and the development
	// branches begin to track the next release.
	LifecycleEventGenerallyAvailable LifecycleEvent = "generally-available"
	// LifecycleEventEndOfLife marks the moment that a version is no longer supported and release branches
	// close for good for this version.
	LifecycleEventEndOfLife LifecycleEvent = "end-of-life"
	// LifecycleEventEndOfFullSupport marks the moment that a version is no longer supported fully.
	LifecycleEventEndOfFullSupport LifecycleEvent = "end-of-full-support"
	// LifecycleEventEndOfMaintenanceSupport marks the moment that a version is no longer supported.
	LifecycleEventEndOfMaintenanceSupport LifecycleEvent = "end-of-maintenance-support"
)

func (LifecycleEvent) Validate

func (le LifecycleEvent) Validate() error

type LifecyclePhase

type LifecyclePhase struct {
	// Event is the name of this phase.
	Event LifecycleEvent `json:"event"`
	// When is the moment in time when this phase begins. Optional.
	When *metav1.Time `json:"when,omitempty"`
}

LifecyclePhase describes a phase in the release lifecycle for a version of a product.

type MajorMinor

type MajorMinor struct {
	Major int `json:"major"`
	Minor int `json:"minor"`
}

func ParseMajorMinor

func ParseMajorMinor(version string) (*MajorMinor, error)

func (MajorMinor) GetFutureVersion

func (m MajorMinor) GetFutureVersion() string

func (MajorMinor) GetPastVersion

func (m MajorMinor) GetPastVersion() string

func (MajorMinor) GetVersion

func (m MajorMinor) GetVersion() string

func (MajorMinor) Less

func (m MajorMinor) Less(other MajorMinor) bool

func (MajorMinor) String

func (m MajorMinor) String() string

func (MajorMinor) WithIncrementedMinor

func (m MajorMinor) WithIncrementedMinor(increment int) MajorMinor

type Timeline

type Timeline []Event

Timeline is a list of events.

func (Timeline) DeterminePlaceInTime

func (t Timeline) DeterminePlaceInTime(now time.Time) (Event, Event)

DeterminePlaceInTime returns the the previous and the next event based on the given point in time.

func (Timeline) GetExactLifecyclePhase

func (t Timeline) GetExactLifecyclePhase(now time.Time) *Event

DeterminePlaceInTime returns pointer to the exact lifecycle phase by comparing dates

type TimelineByVersion

type TimelineByVersion map[string]Timeline

TimelineByProduct is a list of events mapped by version

type TimelineOptions

type TimelineOptions struct {
	OnlyEvents sets.Set[string]
}

Jump to

Keyboard shortcuts

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