kitops

package module
v0.0.0-...-1449df2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 17 Imported by: 1

README

pgk kitops

This package implements the kitops instance.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResource

type APIResource struct {
	Kind     string
	Metadata struct {
		Name      string
		Namespace string
	}
}

APIResource holds the object information of the API Object

func NewResource

func NewResource(r io.Reader) (resource *APIResource, err error)

NewResource parses a YAML of a Kubernetes Resource description returns an initialized API Resource returns an error, if the Reader contains no valid yaml

func (*APIResource) Checksum

func (r *APIResource) Checksum() string

Checksum returns a SHA256 checksum of the APIResource as a string

func (*APIResource) Delete

func (r *APIResource) Delete()

Delete deletes the resource from the cluster

func (*APIResource) Exists

func (r *APIResource) Exists() bool

Exists returns a bool. true if the Object exists in the cluster, false if not It returns also false, when there is no information if the resource is namespaced

func (*APIResource) Label

func (r *APIResource) Label(label string)

Label labels the resource in the cluster

type ClusterConfig

type ClusterConfig struct {
	APIResources     *Collection
	SourceRepository *sourcerepo.SourceRepo
	CommitID         string
	ResourceLabel    string
}

ClusterConfig holds all API Resources for a commit id

func NewClusterConfig

func NewClusterConfig(sourceRepo *sourcerepo.SourceRepo, commitID string) *ClusterConfig

NewClusterConfig returns an initialized *ClusterConfig sourceRepo is the Repository with the configuration commitID is the commit id of the source repository.

func (*ClusterConfig) ApplyManifests

func (cc *ClusterConfig) ApplyManifests() error

ApplyManifests applies the manifests stored in the repository and checked out with the commitID. It returns an error if something goes wrong on apply.

func (*ClusterConfig) Clean

func (cc *ClusterConfig) Clean()

Clean cleans the cluster from resources which are not in the ClusterConfig, but managed by Kitops

func (*ClusterConfig) Label

func (cc *ClusterConfig) Label()

Label labels all resources of this ClusterConfig in the Cluster

func (*ClusterConfig) LoadManifests

func (cc *ClusterConfig) LoadManifests() error

LoadManifests loads the manifests of the checked out repository into the ClusterConfig

type Collection

type Collection struct {
	Items map[string]*APIResource

	ResourceLabel string
	// contains filtered or unexported fields
}

Collection holds a collection of resources and the the corresponding manifests

func NewCollection

func NewCollection(label string) *Collection

NewCollection returns an empty collection of API resources

func (*Collection) AddFromFile

func (c *Collection) AddFromFile(manifest []byte, path string) error

AddFromFile adds API Resources from the given manifest manifest is a byte array containing the manifest path is the path of the manifest file returns an error if the manifest is invalid

func (*Collection) Exists

func (c *Collection) Exists() bool

Exists returns a bool. true if the resources exists in the cluster, false if not It returns also false, when there is no information if the resource is namespaced

func (*Collection) Label

func (c *Collection) Label()

Label labels all resources of the collection in the cluster

func (*Collection) LoadFromDirectory

func (c *Collection) LoadFromDirectory(directory string) error

LoadFromDirectory loads collections from YAML files within the directory recursively returns an error if something is wrong with the files

func (*Collection) LoadFromList

func (c *Collection) LoadFromList(listContent []byte) error

LoadFromList loads API Resources from a byte array with a List of API Resources

type Kitops

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

Kitops is the instance type

func New

func New() *Kitops

New returns a new Kitops instance

func (*Kitops) Serve

func (k *Kitops) Serve()

Serve runs the application in server mode

type List

type List struct {
	Kind  string
	Items []APIResource
}

List holds the returned resources from kubectl get

type QueueProcessor

type QueueProcessor struct {
	ClusterConfigs map[string]*ClusterConfig
	// contains filtered or unexported fields
}

QueueProcessor is the instance for processsing the queue items

func (*QueueProcessor) Process

func (qp *QueueProcessor) Process(q *queue.Queue)

Process processes new queued commitIDs

Jump to

Keyboard shortcuts

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