Documentation
¶
Index ¶
- Constants
- type App
- type AppFilter
- type Apps
- type Change
- type ChangeImpl
- type ChangeMeta
- type LabeledApp
- func (a *LabeledApp) BeginChange(ChangeMeta) (Change, error)
- func (a *LabeledApp) Changes() ([]Change, error)
- func (a *LabeledApp) CreateOrUpdate(labels map[string]string, isDiffRun bool) error
- func (a *LabeledApp) CreationTimestamp() time.Time
- func (a *LabeledApp) Delete() error
- func (a *LabeledApp) Description() string
- func (a *LabeledApp) Exists() (bool, string, error)
- func (a *LabeledApp) GCChanges(max int, reviewFunc func(changesToDelete []Change) error) (int, int, error)
- func (a *LabeledApp) LabelSelector() (labels.Selector, error)
- func (a *LabeledApp) LastChange() (Change, error)
- func (a *LabeledApp) Meta() (Meta, error)
- func (a *LabeledApp) Name() string
- func (a *LabeledApp) Namespace() string
- func (a *LabeledApp) Rename(_ string, _ string) error
- func (a *LabeledApp) RenamePrevApp(_ string, _ map[string]string, _ bool) error
- func (a *LabeledApp) UpdateUsedGVsAndGKs([]schema.GroupVersion, []schema.GroupKind) error
- func (a *LabeledApp) UsedGKs() (*[]schema.GroupKind, error)
- func (a *LabeledApp) UsedGVs() ([]schema.GroupVersion, error)
- type Meta
- type NoopChange
- type Preparation
- type PrepareResourcesOpts
- type RecordedApp
- func (a *RecordedApp) BeginChange(meta ChangeMeta) (Change, error)
- func (a *RecordedApp) Changes() ([]Change, error)
- func (a *RecordedApp) CreateOrUpdate(labels map[string]string, isDiffRun bool) error
- func (a *RecordedApp) CreationTimestamp() time.Time
- func (a *RecordedApp) Delete() error
- func (a *RecordedApp) Description() string
- func (a *RecordedApp) Exists() (bool, string, error)
- func (a *RecordedApp) GCChanges(max int, reviewFunc func(changesToDelete []Change) error) (int, int, error)
- func (a *RecordedApp) LabelSelector() (labels.Selector, error)
- func (a *RecordedApp) LastChange() (Change, error)
- func (a *RecordedApp) Meta() (Meta, error)
- func (a *RecordedApp) Name() string
- func (a *RecordedApp) Namespace() string
- func (a *RecordedApp) Rename(newName string, newNamespace string) error
- func (a *RecordedApp) RenamePrevApp(prevAppName string, labels map[string]string, isDiffRun bool) error
- func (a *RecordedApp) UpdateUsedGVsAndGKs(gvs []schema.GroupVersion, gks []schema.GroupKind) error
- func (a *RecordedApp) UsedGKs() (*[]schema.GroupKind, error)
- func (a *RecordedApp) UsedGVs() ([]schema.GroupVersion, error)
- type RecordedAppChanges
- type Touch
Constants ¶
View Source
const ( KappIsConfigmapMigratedAnnotationKey = "kapp.k14s.io/is-configmap-migrated" KappIsConfigmapMigratedAnnotationValue = "" AppSuffix = ".apps.k14s.io" )
View Source
const (
AppChangesMaxToKeepDefault = 200
)
View Source
const (
KappIsAppLabelKey = "kapp.k14s.io/is-app"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { Name() string Namespace() string CreationTimestamp() time.Time Description() string Meta() (Meta, error) LabelSelector() (labels.Selector, error) UsedGVs() ([]schema.GroupVersion, error) UsedGKs() (*[]schema.GroupKind, error) UpdateUsedGVsAndGKs([]schema.GroupVersion, []schema.GroupKind) error CreateOrUpdate(map[string]string, bool) error Exists() (bool, string, error) Delete() error Rename(string, string) error RenamePrevApp(string, map[string]string, bool) error // Sorted as first is oldest Changes() ([]Change, error) LastChange() (Change, error) BeginChange(ChangeMeta) (Change, error) GCChanges(max int, reviewFunc func(changesToDelete []Change) error) (int, int, error) }
type Apps ¶
type Apps struct {
// contains filtered or unexported fields
}
func NewApps ¶
func NewApps(nsName string, coreClient kubernetes.Interface, identifiedResources ctlres.IdentifiedResources, logger logger.Logger) Apps
type Change ¶
type Change interface { Name() string Meta() ChangeMeta Fail() error Succeed() error Delete() error }
type ChangeImpl ¶
type ChangeImpl struct {
// contains filtered or unexported fields
}
func (*ChangeImpl) Delete ¶ added in v0.12.0
func (c *ChangeImpl) Delete() error
func (*ChangeImpl) Fail ¶
func (c *ChangeImpl) Fail() error
func (*ChangeImpl) Meta ¶
func (c *ChangeImpl) Meta() ChangeMeta
func (*ChangeImpl) Name ¶
func (c *ChangeImpl) Name() string
func (*ChangeImpl) Succeed ¶
func (c *ChangeImpl) Succeed() error
type ChangeMeta ¶
type ChangeMeta struct { StartedAt time.Time `json:"startedAt"` FinishedAt time.Time `json:"finishedAt,omitempty"` Successful *bool `json:"successful,omitempty"` Description string `json:"description,omitempty"` Namespaces []string `json:"namespaces,omitempty"` }
func NewChangeMetaFromData ¶
func NewChangeMetaFromData(data map[string]string) ChangeMeta
func NewChangeMetaFromString ¶
func NewChangeMetaFromString(data string) ChangeMeta
func (ChangeMeta) AsData ¶
func (m ChangeMeta) AsData() map[string]string
func (ChangeMeta) AsString ¶
func (m ChangeMeta) AsString() string
type LabeledApp ¶
type LabeledApp struct {
// contains filtered or unexported fields
}
func (*LabeledApp) BeginChange ¶
func (a *LabeledApp) BeginChange(ChangeMeta) (Change, error)
func (*LabeledApp) Changes ¶
func (a *LabeledApp) Changes() ([]Change, error)
func (*LabeledApp) CreateOrUpdate ¶
func (a *LabeledApp) CreateOrUpdate(labels map[string]string, isDiffRun bool) error
func (*LabeledApp) CreationTimestamp ¶ added in v0.46.0
func (a *LabeledApp) CreationTimestamp() time.Time
func (*LabeledApp) Delete ¶
func (a *LabeledApp) Delete() error
func (*LabeledApp) Description ¶ added in v0.22.0
func (a *LabeledApp) Description() string
func (*LabeledApp) LabelSelector ¶
func (a *LabeledApp) LabelSelector() (labels.Selector, error)
func (*LabeledApp) LastChange ¶
func (a *LabeledApp) LastChange() (Change, error)
func (*LabeledApp) Meta ¶
func (a *LabeledApp) Meta() (Meta, error)
func (*LabeledApp) Name ¶
func (a *LabeledApp) Name() string
func (*LabeledApp) Namespace ¶ added in v0.9.0
func (a *LabeledApp) Namespace() string
func (*LabeledApp) RenamePrevApp ¶ added in v0.47.0
func (*LabeledApp) UpdateUsedGVsAndGKs ¶ added in v0.46.0
func (a *LabeledApp) UpdateUsedGVsAndGKs([]schema.GroupVersion, []schema.GroupKind) error
func (*LabeledApp) UsedGKs ¶ added in v0.46.0
func (a *LabeledApp) UsedGKs() (*[]schema.GroupKind, error)
func (*LabeledApp) UsedGVs ¶ added in v0.18.0
func (a *LabeledApp) UsedGVs() ([]schema.GroupVersion, error)
type Meta ¶ added in v0.36.0
type Meta struct { LabelKey string `json:"labelKey"` LabelValue string `json:"labelValue"` LastChangeName string `json:"lastChangeName,omitempty"` LastChange ChangeMeta `json:"lastChange,omitempty"` UsedGVs []schema.GroupVersion `json:"usedGVs,omitempty"` UsedGKs *[]schema.GroupKind `json:"usedGKs,omitempty"` }
type NoopChange ¶
type NoopChange struct{}
func (NoopChange) Delete ¶ added in v0.12.0
func (NoopChange) Delete() error
func (NoopChange) Fail ¶
func (NoopChange) Fail() error
func (NoopChange) Meta ¶
func (NoopChange) Meta() ChangeMeta
func (NoopChange) Name ¶
func (NoopChange) Name() string
func (NoopChange) Succeed ¶
func (NoopChange) Succeed() error
type Preparation ¶
type Preparation struct {
// contains filtered or unexported fields
}
func NewPreparation ¶
func NewPreparation(resourceTypes ctlres.ResourceTypes, opts PrepareResourcesOpts) Preparation
func (Preparation) PrepareResources ¶
func (Preparation) ValidateResources ¶
func (a Preparation) ValidateResources(resources []ctlres.Resource) error
type PrepareResourcesOpts ¶
type PrepareResourcesOpts struct { BeforeModificationFunc func([]ctlres.Resource) []ctlres.Resource AllowCheck bool AllowedNamespaces []string AllowAllNamespaces bool AllowCluster bool IntoNamespace string // this ns is allowed automatically MapNamespaces []string // this ns is allowed automatically DefaultNamespace string // this ns is allowed automatically }
func (PrepareResourcesOpts) InAllowedNamespaces ¶
func (o PrepareResourcesOpts) InAllowedNamespaces(ns string) bool
type RecordedApp ¶
type RecordedApp struct {
// contains filtered or unexported fields
}
func NewRecordedApp ¶ added in v0.47.0
func NewRecordedApp(name, nsName string, creationTimestamp time.Time, coreClient kubernetes.Interface, identifiedResources ctlres.IdentifiedResources, appInDiffNsHintMsgFunc func(string) string, logger logger.Logger) *RecordedApp
func (*RecordedApp) BeginChange ¶
func (a *RecordedApp) BeginChange(meta ChangeMeta) (Change, error)
func (*RecordedApp) Changes ¶
func (a *RecordedApp) Changes() ([]Change, error)
func (*RecordedApp) CreateOrUpdate ¶
func (a *RecordedApp) CreateOrUpdate(labels map[string]string, isDiffRun bool) error
func (*RecordedApp) CreationTimestamp ¶ added in v0.46.0
func (a *RecordedApp) CreationTimestamp() time.Time
func (*RecordedApp) Delete ¶
func (a *RecordedApp) Delete() error
func (*RecordedApp) Description ¶ added in v0.22.0
func (a *RecordedApp) Description() string
func (*RecordedApp) LabelSelector ¶
func (a *RecordedApp) LabelSelector() (labels.Selector, error)
func (*RecordedApp) LastChange ¶
func (a *RecordedApp) LastChange() (Change, error)
func (*RecordedApp) Meta ¶
func (a *RecordedApp) Meta() (Meta, error)
func (*RecordedApp) Name ¶
func (a *RecordedApp) Name() string
func (*RecordedApp) Namespace ¶ added in v0.9.0
func (a *RecordedApp) Namespace() string
func (*RecordedApp) Rename ¶ added in v0.11.0
func (a *RecordedApp) Rename(newName string, newNamespace string) error
func (*RecordedApp) RenamePrevApp ¶ added in v0.47.0
func (*RecordedApp) UpdateUsedGVsAndGKs ¶ added in v0.46.0
func (a *RecordedApp) UpdateUsedGVsAndGKs(gvs []schema.GroupVersion, gks []schema.GroupKind) error
func (*RecordedApp) UsedGKs ¶ added in v0.46.0
func (a *RecordedApp) UsedGKs() (*[]schema.GroupKind, error)
func (*RecordedApp) UsedGVs ¶ added in v0.18.0
func (a *RecordedApp) UsedGVs() ([]schema.GroupVersion, error)
type RecordedAppChanges ¶
type RecordedAppChanges struct {
// contains filtered or unexported fields
}
func NewRecordedAppChanges ¶
func NewRecordedAppChanges(nsName, appName string, coreClient kubernetes.Interface) RecordedAppChanges
func (RecordedAppChanges) Begin ¶
func (a RecordedAppChanges) Begin(meta ChangeMeta) (*ChangeImpl, error)
func (RecordedAppChanges) DeleteAll ¶
func (a RecordedAppChanges) DeleteAll() error
func (RecordedAppChanges) List ¶
func (a RecordedAppChanges) List() ([]Change, error)
Click to show internal directories.
Click to hide internal directories.