Documentation ¶
Index ¶
- Constants
- func IsNotFound(err error) bool
- func TransformedObjects(reader io.Reader, namespace, name string) (obj []*model.K8sObject, err error)
- type APIResourceType
- type K8sPackage
- type PackageInfo
- type PackageManager
- func (m *PackageManager) Apply(ctx context.Context, pkg *K8sPackage, prune bool) (err error)
- func (m *PackageManager) Delete(ctx context.Context, namespace, pkgName string) (err error)
- func (m *PackageManager) DeleteObjects(ctx context.Context, obj []*model.K8sObject) (err error)
- func (m *PackageManager) List(ctx context.Context, allNamespaces bool, namespace string) (pkgs []*PackageInfo, err error)
- func (m *PackageManager) State(ctx context.Context, namespace, pkgName string) (pkg *K8sPackage, err error)
Constants ¶
View Source
const ( // See https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/ PKG_NAME_LABEL = "app.kubernetes.io/part-of" PKG_NS_LABEL = "k8spkg.mgoltzsche.github.com/namespaces" )
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
Types ¶
type APIResourceType ¶
type APIResourceType struct { Name string ShortNames []string APIGroup string Kind string Namespaced bool }
APIResourceType represents a Kubernetes API resource type's metadata
func LoadAPIResourceTypes ¶
func LoadAPIResourceTypes(ctx context.Context, kubeconfigFile string) (types []*APIResourceType, err error)
func (*APIResourceType) FullName ¶
func (t *APIResourceType) FullName() (name string)
Returns the type's short name with APIGroup suffix if there is one
func (*APIResourceType) ShortName ¶
func (t *APIResourceType) ShortName() (name string)
Returns the type's short name if any or its name
type K8sPackage ¶
type K8sPackage struct { *PackageInfo Objects []*model.K8sObject }
K8sPackage define a collection of objects and their package metadata
func PkgFromManifest ¶
func PkgFromManifest(reader io.Reader, namespace, name string) (pkg *K8sPackage, err error)
type PackageInfo ¶
func PackageInfosFromObjects ¶
func PackageInfosFromObjects(obj []*model.K8sObject) (pkgs []*PackageInfo, err error)
Returns a list of the packages declared within the provided objects. An error is only returned if an object has no k8spkg label while all declared packages are still returned.
type PackageManager ¶
type PackageManager struct {
// contains filtered or unexported fields
}
func NewPackageManager ¶
func NewPackageManager(kubeconfigFile string) *PackageManager
func (*PackageManager) Apply ¶
func (m *PackageManager) Apply(ctx context.Context, pkg *K8sPackage, prune bool) (err error)
func (*PackageManager) Delete ¶
func (m *PackageManager) Delete(ctx context.Context, namespace, pkgName string) (err error)
func (*PackageManager) DeleteObjects ¶
func (*PackageManager) List ¶
func (m *PackageManager) List(ctx context.Context, allNamespaces bool, namespace string) (pkgs []*PackageInfo, err error)
func (*PackageManager) State ¶
func (m *PackageManager) State(ctx context.Context, namespace, pkgName string) (pkg *K8sPackage, err error)
Click to show internal directories.
Click to hide internal directories.