Documentation ¶
Index ¶
- Constants
- type Generator
- type Rollout
- type RolloutMonitor
- type Synchronizer
- func (n *Synchronizer) ClusterOperations(ctx context.Context, rollout Rollout) []commit
- func (n *Synchronizer) MonitorRollout(app generator.MonitorSource, logger log.Entry)
- func (n *Synchronizer) Prepare(ctx context.Context, source resource.Source) (*Rollout, error)
- func (n *Synchronizer) Reconcile(ctx context.Context, req ctrl.Request, app resource.Source) (ctrl.Result, error)
- func (n *Synchronizer) Sync(ctx context.Context, rollout Rollout) (bool, error)
- func (n *Synchronizer) Unreferenced(ctx context.Context, rollout Rollout) ([]runtime.Object, error)
- func (n *Synchronizer) UpdateResource(ctx context.Context, source resource.Source, ...) error
Constants ¶
const ( RolloutMessageCompleted = "Rollout has completed" RolloutMessageCronJobCompleted = "No support for monitoring CronJobs" RolloutMessageJobCompleted = "Job finished successfully" RolloutMessageJobFailed = "Job has failed" )
const (
NaiseratorFinalizer = "naiserator.nais.io/finalizer"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator interface { Prepare(ctx context.Context, source resource.Source, kube client.Client) (interface{}, error) Generate(source resource.Source, options interface{}) (resource.Operations, error) }
Generator transform CRD objects such as Application, Naisjob into other kinds of Kubernetes resources. First, `Prepare()` is called. This function has access to (read-only) cluster operations and returns a configuration object. Then, `Generate()` is called with the configuration object, and returns a full set of Kubernetes resources.
type Rollout ¶
type Rollout struct { Source resource.Source ResourceOperations resource.Operations Options interface{} CorrelationID string SynchronizationHash string }
Rollout represents the data necessary to rollout an application to Kubernetes.
type RolloutMonitor ¶
type RolloutMonitor struct {
// contains filtered or unexported fields
}
type Synchronizer ¶
Synchronizer creates child resources from Application resources in the cluster. If the child resources does not match the Application spec, the resources are updated.
func NewSynchronizer ¶
func (*Synchronizer) ClusterOperations ¶
func (n *Synchronizer) ClusterOperations(ctx context.Context, rollout Rollout) []commit
ClusterOperations generates a set of functions that will perform the rollout in the cluster.
func (*Synchronizer) MonitorRollout ¶
func (n *Synchronizer) MonitorRollout(app generator.MonitorSource, logger log.Entry)
func (*Synchronizer) Prepare ¶
Prepare converts a NAIS application spec into a Rollout object. The Rollout object contains callback functions that commits changes in the cluster. Prepare is a read-only operation.
func (*Synchronizer) Reconcile ¶
func (n *Synchronizer) Reconcile(ctx context.Context, req ctrl.Request, app resource.Source) (ctrl.Result, error)
Reconcile processes the work queue
func (*Synchronizer) Unreferenced ¶
Unreferenced return all resources in cluster which was created by synchronizer previously, but is not included in the current rollout.