controller

package
v0.0.0-...-c63b137 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright 2025 The canary-gate authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanaryGateReconciler

type CanaryGateReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

CanaryGateReconciler reconciles a CanaryGate object

func (*CanaryGateReconciler) Reconcile

func (r *CanaryGateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

+kubebuilder:rbac:groups=piggysec.com,resources=canarygates,verbs=get;list;watch;update;patch +kubebuilder:rbac:groups=piggysec.com,resources=canarygates/status,verbs=get;update;patch +kubebuilder:rbac:groups=piggysec.com,resources=canarygates/finalizers,verbs=update +kubebuilder:rbac:groups=flagger.app,resources=canaries,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups="",resources=events,verbs=create;patch

func (*CanaryGateReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type DynamicEventSink

type DynamicEventSink struct {
	Client dynamic.Interface
}

DynamicEventSink implements the record.EventSink interface using a dynamic client.

func (*DynamicEventSink) Create

func (s *DynamicEventSink) Create(event *corev1.Event) (*corev1.Event, error)

Create sends an event to the API server using the dynamic client.

func (*DynamicEventSink) Patch

func (s *DynamicEventSink) Patch(event *corev1.Event, patch []byte) (*corev1.Event, error)

Patch is required by the EventSink interface. For this example, we won't implement it.

func (*DynamicEventSink) Update

func (s *DynamicEventSink) Update(event *corev1.Event) (*corev1.Event, error)

Update implements record.EventSink.

type LogrAdapter

type LogrAdapter struct {
}

LogrAdapter implements the logr.LogSink interface.

func (*LogrAdapter) Enabled

func (a *LogrAdapter) Enabled(level int) bool

Enabled returns true if the logger is enabled. We'll always enable it.

func (*LogrAdapter) Error

func (a *LogrAdapter) Error(err error, msg string, keysAndValues ...interface{})

Error logs an error message.

func (*LogrAdapter) Info

func (a *LogrAdapter) Info(level int, msg string, keysAndValues ...interface{})

Info logs an info message.

func (*LogrAdapter) Init

func (a *LogrAdapter) Init(info logr.RuntimeInfo)

Init is called by logr.

func (*LogrAdapter) WithName

func (a *LogrAdapter) WithName(name string) logr.LogSink

WithName returns a new logger with a name segment. We can ignore it.

func (*LogrAdapter) WithValues

func (a *LogrAdapter) WithValues(keysAndValues ...interface{}) logr.LogSink

WithValues returns a new logger with additional key-value pairs.

Jump to

Keyboard shortcuts

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