gitops

package
v0.0.0-...-75b20ab Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuditPodNamespace

func GetAuditPodNamespace() string

func GetAuditServiceAccount

func GetAuditServiceAccount() string

func GetResources

func GetResources() []string

func RegisterTypes

func RegisterTypes(scheme *runtime.Scheme)

Types

type CustomRepo

type CustomRepo struct {
	Repo           *git.Repository
	K8s            *K8sClient
	RollbackMode   bool
	ServiceAccount string
	Fs             billy.Filesystem
	Mutex          sync.Mutex
}

func SetupRepo

func SetupRepo(k8s *K8sClient, mode StorageModeType, dir string) (*CustomRepo, error)

func (*CustomRepo) AddAndCommit

func (cr *CustomRepo) AddAndCommit(username string, email string, message string) error

func (*CustomRepo) FilterCommits

func (cr *CustomRepo) FilterCommits(author string, since time.Time, until time.Time, resource string, namespace string, name string) ([]object.Commit, error)

func (*CustomRepo) HandleEvent

func (cr *CustomRepo) HandleEvent(event auditv1.Event) error

func (*CustomRepo) HandleEventList

func (cr *CustomRepo) HandleEventList(jsonstring []byte) error

func (*CustomRepo) HashToCommit

func (cr *CustomRepo) HashToCommit(commitSha string) (*object.Commit, error)

func (*CustomRepo) RemoveTag

func (cr *CustomRepo) RemoveTag(tag string) (string, error)

func (*CustomRepo) RollbackRepo

func (cr *CustomRepo) RollbackRepo(targetCommit *object.Commit) (string, error)

func (*CustomRepo) TagCommit

func (cr *CustomRepo) TagCommit(commitSha string, tag string, tagger *object.Signature) (string, error)

func (*CustomRepo) TagToCommit

func (cr *CustomRepo) TagToCommit(tag string) (*object.Commit, error)

type K8sClient

type K8sClient struct {
	client.Client
}

func NewKubernetes

func NewKubernetes() (*K8sClient, error)

func (*K8sClient) CreateOrUpdateResource

func (k *K8sClient) CreateOrUpdateResource(resource *unstructured.Unstructured) error

func (*K8sClient) DeleteResource

func (k *K8sClient) DeleteResource(resource *unstructured.Unstructured) error

func (*K8sClient) GetResource

func (k *K8sClient) GetResource(resource *unstructured.Unstructured, namespace string, name string) (*unstructured.Unstructured, error)

func (*K8sClient) ListResource

func (k *K8sClient) ListResource(resourceList *unstructured.UnstructuredList) (*unstructured.UnstructuredList, error)

type StorageModeType

type StorageModeType string
const (
	StorageModeDisk     StorageModeType = "Disk"
	StorageModeInMemory StorageModeType = "InMemory"
)

Jump to

Keyboard shortcuts

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