agent

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetItems

func GetItems(resources client.ObjectList) []interface{}

Returns the list of items from the resources based on the resource type

Types

type Config

type Config struct {
	// The interval between individual synchronizations
	Interval time.Duration
	// Agent Identifier
	ID string
	// Url of Control Plane API
	ControlPlaneUrl string
	// Token to authenticate with Control Plane API
	ControlPlaneAuthToken string
	// Tags
	Tags map[string]string
}

type Shipper

type Shipper struct {
	Client    *http.Client
	BaseURL   string
	AuthToken string
}

func NewShipper

func NewShipper(config *ShipperConfig) *Shipper

func (*Shipper) Post

func (s *Shipper) Post(payload controlplane.AgentPayload) error

type ShipperConfig

type ShipperConfig struct {
	URL       string
	Token     string
	TLSVerify bool
	Timeout   time.Duration
}

type SubjectVersion

type SubjectVersion struct {
	ID                 string
	Namespace          string
	TotalResourceCount int
	UniqVersions       []string
	Versions           []*v1alpha1.Version
	RemoteVersion      v1alpha1.RemoteVersion
}

type VersionTrackerReconciler

type VersionTrackerReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	Config *Config
}

VersionTrackerReconciler reconciles a VersionTracker object

func (*VersionTrackerReconciler) ExtractSubjectVersion

func (r *VersionTrackerReconciler) ExtractSubjectVersion(v v1alpha1.VersionTracker, items []interface{}) SubjectVersion

ExtractSubjectVersion looks at the feild of each individuel resource and extracts the version based on the extraction configuration in the VersionTracker

func (*VersionTrackerReconciler) PrepareThePayload

func (*VersionTrackerReconciler) Reconcile

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*VersionTrackerReconciler) SetupWithManager

func (r *VersionTrackerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*VersionTrackerReconciler) ShipToControlPlane

func (r *VersionTrackerReconciler) ShipToControlPlane(ver SubjectVersion) error

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the opvic v1alpha1 API group +kubebuilder:object:generate=true +groupName=opvic.skillz.com
Package v1alpha1 contains API Schema definitions for the opvic v1alpha1 API group +kubebuilder:object:generate=true +groupName=opvic.skillz.com

Jump to

Keyboard shortcuts

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