cluster

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cluster is a generated GoMock package.

Index

Constants

View Source
const (
	ClusterfilterFileName = "clusterignorerule"
)

Variables

This section is empty.

Functions

func AddIfNotExists

func AddIfNotExists(list []string, item string) []string

func DeleteSpecifyDir

func DeleteSpecifyDir(dir string) error

func DeleteSpecifyFile

func DeleteSpecifyFile(filename string) error

func GenerateNodePort

func GenerateNodePort(usedPorts []int) int

func GetApplicationSetElements

func GetApplicationSetElements(data []byte) ([]string, error)

func GetClustersDir

func GetClustersDir(dir string) string

func GetHostClusterAppsetFilePath

func GetHostClusterAppsetFilePath(dir string) string

func GetHostClusterNames

func GetHostClusterNames(filePath string) (hostClusterNames []string, err error)

func GetHostClustesrDir

func GetHostClustesrDir(dir string) string

func GetRuntimesDir

func GetRuntimesDir(dir string) string

func GetTenantProductionDir

func GetTenantProductionDir(dir string) string

func GetVclusterNames

func GetVclusterNames(filePath string) (vclusterNames []string, err error)

func GetVclustersDir

func GetVclustersDir(dir, subDir string) string

func IsHostCluser

func IsHostCluser(cluster *resourcev1alpha1.Cluster) bool

func IsPhysicalRuntime

func IsPhysicalRuntime(cluster *resourcev1alpha1.Cluster) bool

func IsValidRuntimeAppSetFilename

func IsValidRuntimeAppSetFilename(filename string) bool

func IsVirtualRuntime

func IsVirtualRuntime(cluster *resourcev1alpha1.Cluster) bool

func RemoveStringFromArray

func RemoveStringFromArray(arr []string, target string) []string

func ReplaceFilePath

func ReplaceFilePath(filePath, oldDir, newDir string) (newPath string)

func ReplacePlaceholders

func ReplacePlaceholders(data string, placeholder, value string) string

func WriteConfigFile

func WriteConfigFile(filePath, content string) error

Types

type Argocd

type Argocd struct {
	Host string
	URL  string
}

type ClusterRegistration

type ClusterRegistration struct {
	Cluster                      *resourcev1alpha1.Cluster
	ClusterResouceFiles          []string
	ClusterTemplateRepoLocalPath string
	TenantConfigRepoLocalPath    string
	RepoURL                      string
	CaBundle                     string
	Usage                        ClusterUsage
	HostCluster                  *HostCluster
	HostClusterNames             []string
	VclusterNames                []string
	Vcluster                     *Vcluster
	RuntimeNameAndApiServers     []*RuntimeNameAndApiServer
	Runtime                      *Runtime
	Traefik                      *Traefik
	NautesConfigs                nautesconfigs.Nautes
	GitConfigs                   nautesconfigs.GitRepo
	SecretConfigs                nautesconfigs.SecretRepo
	OauthConfigs                 nautesconfigs.OAuth
}

func (*ClusterRegistration) CheckHostClusterDirExists

func (r *ClusterRegistration) CheckHostClusterDirExists() error

func (*ClusterRegistration) DeleteCluster

func (r *ClusterRegistration) DeleteCluster() error

func (*ClusterRegistration) DeleteClusterByType

func (r *ClusterRegistration) DeleteClusterByType(config *Config) (*nodestree.Node, error)

func (*ClusterRegistration) DeleteClusterToKustomization

func (r *ClusterRegistration) DeleteClusterToKustomization() (err error)

func (*ClusterRegistration) DeleteFileIfAppSetHasNoElements

func (r *ClusterRegistration) DeleteFileIfAppSetHasNoElements() error

func (*ClusterRegistration) DeleteHostCluster

func (r *ClusterRegistration) DeleteHostCluster(nodes *nodestree.Node) error

func (*ClusterRegistration) DeleteHostClusterAppSet

func (r *ClusterRegistration) DeleteHostClusterAppSet() error

func (*ClusterRegistration) DeleteRuntime

func (r *ClusterRegistration) DeleteRuntime(nodes *nodestree.Node) error

func (*ClusterRegistration) DeleteRuntimeAppSet

func (r *ClusterRegistration) DeleteRuntimeAppSet() error

func (*ClusterRegistration) DeleteVclusterAppSet

func (r *ClusterRegistration) DeleteVclusterAppSet() error

func (*ClusterRegistration) Execute

func (r *ClusterRegistration) Execute(nodes *nodestree.Node) error

func (*ClusterRegistration) GetAndDeleteHostClusterNames

func (r *ClusterRegistration) GetAndDeleteHostClusterNames() error

func (*ClusterRegistration) GetAndDeleteVclusterNames

func (r *ClusterRegistration) GetAndDeleteVclusterNames() error

func (*ClusterRegistration) GetAndMergeHostClusterNames

func (r *ClusterRegistration) GetAndMergeHostClusterNames() error

func (*ClusterRegistration) GetAndMergeVclusterNames

func (r *ClusterRegistration) GetAndMergeVclusterNames() error

func (*ClusterRegistration) GetArgocdURL

func (r *ClusterRegistration) GetArgocdURL() (string, error)

func (*ClusterRegistration) GetTraefikNodePortToHostCluster

func (r *ClusterRegistration) GetTraefikNodePortToHostCluster(tenantLocalPath, hostCluster string) (int, error)

func (*ClusterRegistration) InitializeDependencies

func (r *ClusterRegistration) InitializeDependencies(param *ClusterRegistrationParam) error

func (*ClusterRegistration) LoadTemplateNodesTree

func (r *ClusterRegistration) LoadTemplateNodesTree(ignorePath, ignoreFile []string) (nodes nodestree.Node, err error)

func (*ClusterRegistration) OverlayTemplateDirectoryPlaceholder

func (r *ClusterRegistration) OverlayTemplateDirectoryPlaceholder(nodes *nodestree.Node, placeholder string, replaceVaule string)

func (*ClusterRegistration) Remove

func (r *ClusterRegistration) Remove() error

func (*ClusterRegistration) ReplaceFilePath

func (r *ClusterRegistration) ReplaceFilePath(nodes *nodestree.Node)

func (*ClusterRegistration) Save

func (r *ClusterRegistration) Save() error

func (*ClusterRegistration) SaveClusterByType

func (r *ClusterRegistration) SaveClusterByType(config *Config) (*nodestree.Node, error)

func (*ClusterRegistration) SaveClusterToKustomization

func (r *ClusterRegistration) SaveClusterToKustomization() (err error)

func (*ClusterRegistration) SaveHostCluster

func (r *ClusterRegistration) SaveHostCluster(nodes *nodestree.Node) error

func (*ClusterRegistration) SaveRuntime

func (r *ClusterRegistration) SaveRuntime(nodes *nodestree.Node) error

func (*ClusterRegistration) WriteCluster

func (r *ClusterRegistration) WriteCluster() error

func (*ClusterRegistration) WriteFileToTenantConfigRepository

func (r *ClusterRegistration) WriteFileToTenantConfigRepository(nodes *nodestree.Node) error

type ClusterRegistrationOperator

type ClusterRegistrationOperator interface {
	InitializeDependencies(param *ClusterRegistrationParam) error
	GetArgocdURL() (string, error)
	GetTraefikNodePortToHostCluster(tenantLocalPath, hostCluster string) (int, error)
	Save() error
	Remove() error
}

func NewClusterRegistration

func NewClusterRegistration() ClusterRegistrationOperator

type ClusterRegistrationParam

type ClusterRegistrationParam struct {
	RepoURL                      string
	ClusterTemplateRepoLocalPath string
	TenantConfigRepoLocalPath    string
	GitRepoHTTPSURL              string
	Vcluster                     *Vcluster
	Cluster                      *resourcev1alpha1.Cluster
	ArgocdHost                   string
	Traefik                      *Traefik
	Configs                      *nautesconfigs.Config
	CaBundle                     string
}

type ClusterUsage

type ClusterUsage string

type CommonConfig

type CommonConfig struct {
	IgnorePath []string `yaml:"ignorePath"`
	IgnoreFile []string `yaml:"ignoreFile"`
}

type Config

type Config struct {
	Save   Save         `yaml:"save"`
	Remove Remove       `yaml:"remove"`
	Common CommonConfig `yaml:"common"`
}

func NewClusterFileConfig

func NewClusterFileConfig(dir string) (*Config, error)

func (*Config) GetRemoveHostClusterConfig

func (c *Config) GetRemoveHostClusterConfig() (ignorePath, ignoreFile []string)

func (*Config) GetRemovePhysicalRuntimeConfig

func (c *Config) GetRemovePhysicalRuntimeConfig() (ignorePath, ignoreFile []string)

func (*Config) GetRemoveVirtualRuntimeConfig

func (c *Config) GetRemoveVirtualRuntimeConfig() (ignorePath, ignoreFile []string)

func (*Config) GetSaveHostClusterConfig

func (c *Config) GetSaveHostClusterConfig() (ignorePath, ignoreFile []string)

func (*Config) GetSavePhysicalRuntimeConfig

func (c *Config) GetSavePhysicalRuntimeConfig() (ignorePath, ignoreFile []string)

func (*Config) GetSaveVirtualRuntimeConfig

func (c *Config) GetSaveVirtualRuntimeConfig() (ignorePath, ignoreFile []string)

type HostCluster

type HostCluster struct {
	Name          string
	ApiServer     string
	ArgocdProject string
}

type HostClusterConfig

type HostClusterConfig struct {
	IgnorePath []string `yaml:"ignorePath"`
	IgnoreFile []string `yaml:"ignoreFile"`
}

type MockClusterRegistrationOperator

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

MockClusterRegistrationOperator is a mock of ClusterRegistrationOperator interface.

func NewMockClusterRegistrationOperator

func NewMockClusterRegistrationOperator(ctrl *gomock.Controller) *MockClusterRegistrationOperator

NewMockClusterRegistrationOperator creates a new mock instance.

func (*MockClusterRegistrationOperator) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClusterRegistrationOperator) GetArgocdURL

func (m *MockClusterRegistrationOperator) GetArgocdURL() (string, error)

GetArgocdURL mocks base method.

func (*MockClusterRegistrationOperator) GetTraefikNodePortToHostCluster

func (m *MockClusterRegistrationOperator) GetTraefikNodePortToHostCluster(tenantLocalPath, hostCluster string) (int, error)

GetTraefikNodePortToHostCluster mocks base method.

func (*MockClusterRegistrationOperator) InitializeDependencies

func (m *MockClusterRegistrationOperator) InitializeDependencies(param *ClusterRegistrationParam) error

InitializeDependencies mocks base method.

func (*MockClusterRegistrationOperator) Remove

Remove mocks base method.

func (*MockClusterRegistrationOperator) Save

Save mocks base method.

type MockClusterRegistrationOperatorMockRecorder

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

MockClusterRegistrationOperatorMockRecorder is the mock recorder for MockClusterRegistrationOperator.

func (*MockClusterRegistrationOperatorMockRecorder) GetArgocdURL

GetArgocdURL indicates an expected call of GetArgocdURL.

func (*MockClusterRegistrationOperatorMockRecorder) GetTraefikNodePortToHostCluster

func (mr *MockClusterRegistrationOperatorMockRecorder) GetTraefikNodePortToHostCluster(tenantLocalPath, hostCluster interface{}) *gomock.Call

GetTraefikNodePortToHostCluster indicates an expected call of GetTraefikNodePortToHostCluster.

func (*MockClusterRegistrationOperatorMockRecorder) InitializeDependencies

func (mr *MockClusterRegistrationOperatorMockRecorder) InitializeDependencies(param interface{}) *gomock.Call

InitializeDependencies indicates an expected call of InitializeDependencies.

func (*MockClusterRegistrationOperatorMockRecorder) Remove

Remove indicates an expected call of Remove.

func (*MockClusterRegistrationOperatorMockRecorder) Save

Save indicates an expected call of Save.

type Remove

type Remove struct {
	HostCluster     HostClusterConfig `yaml:"hostCluster"`
	PhysicalRuntime RuntimeConfig     `yaml:"physicalRuntime"`
	VirtualRuntime  RuntimeConfig     `yaml:"virtualRuntime"`
}

type Runtime

type Runtime struct {
	Name          string
	Type          string
	MountPath     string
	ApiServer     string
	ArgocdProject string
	Argocd        *Argocd
}

type RuntimeConfig

type RuntimeConfig struct {
	IgnorePath []string `yaml:"ignorePath"`
	IgnoreFile []string `yaml:"ignoreFile"`
}

type RuntimeNameAndApiServer

type RuntimeNameAndApiServer struct {
	Name       string
	ClusterURL string
}

func DeleteRuntimeByName

func DeleteRuntimeByName(runtimeList []*RuntimeNameAndApiServer, name string) []*RuntimeNameAndApiServer

type Save

type Save struct {
	HostCluster     HostClusterConfig `yaml:"hostCluster"`
	PhysicalRuntime RuntimeConfig     `yaml:"physicalRuntime"`
	VirtualRuntime  RuntimeConfig     `yaml:"virtualRuntime"`
}

type Traefik

type Traefik struct {
	HttpNodePort  string
	HttpsNodePort string
}

type Vcluster

type Vcluster struct {
	Name          string
	Namespace     string
	ApiServer     string
	HttpsNodePort string
	TlsSan        string
	HostCluster   *HostCluster
}

func ConstructVcluster

func ConstructVcluster(param *ClusterRegistrationParam) (*Vcluster, error)

Jump to

Keyboard shortcuts

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