clusterresourceimporter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReplicateService

type ReplicateService interface {
	// Snap will be used to export resources from target cluster.
	Snap(ctx context.Context, opts ...snapshot.Option) (*snapshot.ResourcesForSnap, error)
	// Load will be used to import resources the from data which was exported.
	Load(ctx context.Context, resources *snapshot.ResourcesForLoad, opts ...snapshot.Option) error
	IgnoreErr() snapshot.Option
	IgnoreSchedulerConfiguration() snapshot.Option
}

type Service

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

Service has two ReplicateServices. importService is used to import(replicate) these resources to the simulator. exportService is used to export resources from a target cluster.

func NewService

func NewService(e ReplicateService, i ReplicateService) *Service

NewService initializes Service.

func (*Service) ImportClusterResources

func (s *Service) ImportClusterResources(ctx context.Context) error

ImportClusterResources gets resources from the target cluster via exportService and then apply those resources to the simulator. Note: this method doesn't handle scheduler configuration. If you want to use the scheduler configuration along with the imported resources on the simulator, you need to set the path of the scheduler configuration file to `kubeSchedulerConfigPath` value in the Simulator Server Configuration.

Directories

Path Synopsis
Package mock_clusterresourceimporter is a generated GoMock package.
Package mock_clusterresourceimporter is a generated GoMock package.

Jump to

Keyboard shortcuts

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