buildchange

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxLogMessageSize = 800
)

Variables

This section is empty.

Functions

func Log

func Log(logger *log.Logger, changesStr string) error

func NewChangeLogger

func NewChangeLogger(logger *log.Logger, changesStr string) *changeLogger

Types

type Change

type Change interface {
	Reason() buildapi.BuildReason
	IsBuildRequired() (bool, error)
	Old() interface{}
	New() interface{}
	Priority() buildapi.BuildPriority
}

func NewBuildpackChange

func NewBuildpackChange(oldBuildpacks, newBuildpacks []corev1alpha1.BuildpackInfo) Change

func NewCommitChange

func NewCommitChange(oldRevision, newRevision string) Change

func NewConfigChange

func NewConfigChange(oldConfig, newConfig Config) Change

func NewStackChange

func NewStackChange(oldRunImageRefStr, newRunImageRefStr string) Change

func NewTriggerChange

func NewTriggerChange(dateStr string) Change

type ChangeProcessor

type ChangeProcessor struct {
	// contains filtered or unexported fields
}

func NewChangeProcessor

func NewChangeProcessor() *ChangeProcessor

func (*ChangeProcessor) Process

func (c *ChangeProcessor) Process(change Change) *ChangeProcessor

func (*ChangeProcessor) Summarize

func (c *ChangeProcessor) Summarize() (ChangeSummary, error)

type ChangeSummary

type ChangeSummary struct {
	HasChanges bool
	ReasonsStr string
	ChangesStr string
	Priority   buildapi.BuildPriority
}

func NewChangeSummary

func NewChangeSummary(hasChanges bool, reasonsStr, changesStr string, priority buildapi.BuildPriority) (ChangeSummary, error)

func (ChangeSummary) IsValid

func (c ChangeSummary) IsValid() bool

type Config

type Config struct {
	Env         []corev1.EnvVar             `json:"env,omitempty"`
	Resources   corev1.ResourceRequirements `json:"resources,omitempty"`
	Services    buildapi.Services           `json:"services,omitempty"`
	CNBBindings corev1alpha1.CNBBindings    `json:"cnbBindings,omitempty"`
	Source      corev1alpha1.SourceConfig   `json:"source,omitempty"`
}

type GenericChange

type GenericChange struct {
	Reason   string                 `json:"reason,omitempty"`
	Old      interface{}            `json:"old,omitempty"`
	New      interface{}            `json:"new,omitempty"`
	Priority buildapi.BuildPriority `json:"-"`
}

type ProgressLogger added in v0.12.0

type ProgressLogger struct {
	K8sClient k8sclient.Interface
}

func (*ProgressLogger) GetTerminationMessage added in v0.12.0

func (p *ProgressLogger) GetTerminationMessage(pod *corev1.Pod, s *corev1.ContainerStatus) (string, error)

GetTerminationMessage creates a termination message for a pod. Message consists out of container name that has terminated unsuccessfully with the last line of the container log truncated to 800 characters and the command to get more info from that container.

Jump to

Keyboard shortcuts

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