gameserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Types

type Control

type Control interface {
	// SyncGsToPod compares the pod with GameServer, and decide whether to update the pod based on the results.
	// When the fields of the pod is different from that of GameServer,
	// pod will be updated and true is returned; otherwise, the pod won't be updated and false is returned.
	SyncGsToPod() (bool, error)
	// SyncPodToGs compares the GameServer with pod, and update the GameServer.
	SyncPodToGs(*gameKruiseV1alpha1.GameServerSet) error
}

func NewGameServerManager

func NewGameServerManager(gs *gameKruiseV1alpha1.GameServer, pod *corev1.Pod, c client.Client) Control

type GameServerManager

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

func (GameServerManager) SyncGsToPod

func (manager GameServerManager) SyncGsToPod() (bool, error)

func (GameServerManager) SyncPodToGs

func (manager GameServerManager) SyncPodToGs(gss *gameKruiseV1alpha1.GameServerSet) error

type GameServerReconciler

type GameServerReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

GameServerReconciler reconciles a GameServer object

func (*GameServerReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the GameServer object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

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

func (*GameServerReconciler) SetupWithManager

func (r *GameServerReconciler) SetupWithManager(mgr ctrl.Manager) (c controller.Controller, err error)

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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