Documentation ¶
Index ¶
- Constants
- type ComponentDescriptorReferenceDiff
- func (d *ComponentDescriptorReferenceDiff) GetComponentNameOverwrite() (string, string)
- func (d *ComponentDescriptorReferenceDiff) GetRepoCtxOverwrite() (*types.UnstructuredTypedObject, *types.UnstructuredTypedObject)
- func (d *ComponentDescriptorReferenceDiff) GetVersionOverwrite() (string, string)
- func (d *ComponentDescriptorReferenceDiff) IsAnyOverwritten() bool
- func (d *ComponentDescriptorReferenceDiff) IsOverwritten(aspect cdRefAspect) bool
- func (d *ComponentDescriptorReferenceDiff) OverwriteToString(aspect cdRefAspect, textOnNotOverwritten bool) string
- func (d *ComponentDescriptorReferenceDiff) String() string
- type Overwriter
- type Substitutions
Constants ¶
const ( RepoCtx cdRefAspect = "RepositoryContext" ComponentName cdRefAspect = "ComponentName" Version cdRefAspect = "Version" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentDescriptorReferenceDiff ¶
type ComponentDescriptorReferenceDiff struct {
// contains filtered or unexported fields
}
ComponentDescriptorReferenceDiff represents a diff between two component descriptor references. It is meant to be used to describe the changes in a component descriptor reference which has been overwritten. It should be generated by using the ReferenceDiff function. It implements the Stringer interface and will produce a human-readable description of the changes between the two references.
func ReferenceDiff ¶
func ReferenceDiff(oldRef, newRef *lsv1alpha1.ComponentDescriptorReference) *ComponentDescriptorReferenceDiff
ReferenceDiff returns a ComponentDescriptorReferenceDiff object, which contains information on which parts of a component reference have been overwritten. It can also produce a human-readable description of the diff.
func (*ComponentDescriptorReferenceDiff) GetComponentNameOverwrite ¶
func (d *ComponentDescriptorReferenceDiff) GetComponentNameOverwrite() (string, string)
GetComponentNameOverwrite returns the old and the new component names. If not overwritten, both will be empty.
func (*ComponentDescriptorReferenceDiff) GetRepoCtxOverwrite ¶
func (d *ComponentDescriptorReferenceDiff) GetRepoCtxOverwrite() (*types.UnstructuredTypedObject, *types.UnstructuredTypedObject)
GetRepoCtxOverwrite returns the old and the new repository contexts. If not overwritten, both will be nil.
func (*ComponentDescriptorReferenceDiff) GetVersionOverwrite ¶
func (d *ComponentDescriptorReferenceDiff) GetVersionOverwrite() (string, string)
GetVersionOverwrite returns the old and the new component versions. If not overwritten, both will be empty.
func (*ComponentDescriptorReferenceDiff) IsAnyOverwritten ¶
func (d *ComponentDescriptorReferenceDiff) IsAnyOverwritten() bool
IsAnyOverwritten returns true if any part of the reference has been overwritten.
func (*ComponentDescriptorReferenceDiff) IsOverwritten ¶
func (d *ComponentDescriptorReferenceDiff) IsOverwritten(aspect cdRefAspect) bool
IsOverwritten returns whether the given aspect of the reference has been overwritten.
func (*ComponentDescriptorReferenceDiff) OverwriteToString ¶
func (d *ComponentDescriptorReferenceDiff) OverwriteToString(aspect cdRefAspect, textOnNotOverwritten bool) string
OverwriteToString returns a human-readable description of whether the given aspect of the component descriptor reference has been overwritten. If the second argument is true, a string describing that no overwrite happened will be returned if the aspect has not been overwritten. Otherwise, an empty string will be returned in these cases.
func (*ComponentDescriptorReferenceDiff) String ¶
func (d *ComponentDescriptorReferenceDiff) String() string
String returns a human-readable description of which parts of the component descriptor reference have been overwritten.
type Overwriter ¶
type Overwriter interface {
Replace(reference *lsv1alpha1.ComponentDescriptorReference) bool
}
Overwriter is a interface that implements a component reference replace method.
type Substitutions ¶
type Substitutions struct {
Substitutions []lsv1alpha1.ComponentVersionOverwrite
}
Substitutions handles overwrites and implements the Substitutor interface.
func NewSubstitutions ¶
func NewSubstitutions(subs []lsv1alpha1.ComponentVersionOverwrite) *Substitutions
func (*Substitutions) Replace ¶
func (sm *Substitutions) Replace(ref *lsv1alpha1.ComponentDescriptorReference) bool