resource

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigMapKind       = "ConfigMap"
	EKSIamConfigMapName = "aws-auth"
)

Variables

This section is empty.

Functions

func MapClusterToCloudStackDatacenterConfigSpec

func MapClusterToCloudStackDatacenterConfigSpec(csCluster *cloudstackv1.CloudStackCluster) *anywherev1.CloudStackDatacenterConfig

func MapKubeadmConfigTemplateToWorkerNodeGroupConfiguration

func MapKubeadmConfigTemplateToWorkerNodeGroupConfiguration(template kubeadmv1.KubeadmConfigTemplate) *anywherev1.WorkerNodeGroupConfiguration

func MapMachineTemplateToCloudStackMachineConfigSpec

func MapMachineTemplateToCloudStackMachineConfigSpec(csMachineTemplate *cloudstackv1.CloudStackMachineTemplate) (*anywherev1.CloudStackMachineConfig, error)

func MapMachineTemplateToVSphereDatacenterConfigSpec

func MapMachineTemplateToVSphereDatacenterConfigSpec(vsMachineTemplate *vspherev1.VSphereMachineTemplate) (*anywherev1.VSphereDatacenterConfig, error)

func MapMachineTemplateToVSphereMachineConfigSpec

func MapMachineTemplateToVSphereMachineConfigSpec(vsMachineTemplate *vspherev1.VSphereMachineTemplate, users []kubeadmv1.User) (*anywherev1.VSphereMachineConfig, error)

func NewCAPIResourceUpdater

func NewCAPIResourceUpdater(client client.Client, log logr.Logger) *capiResourceUpdater

func NewClusterReconciler

func NewClusterReconciler(resourceFetcher ResourceFetcher, resourceUpdater ResourceUpdater, now anywhereTypes.NowFunc, log logr.Logger) *clusterReconciler

Types

type AWSIamConfigTemplate

type AWSIamConfigTemplate struct {
	ResourceFetcher
}

func (*AWSIamConfigTemplate) TemplateResources

func (r *AWSIamConfigTemplate) TemplateResources(ctx context.Context, clusterSpec *cluster.Spec) ([]*unstructured.Unstructured, error)

type CapiResourceFetcher

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

func NewCAPIResourceFetcher

func NewCAPIResourceFetcher(client client.Reader, Log logr.Logger) *CapiResourceFetcher

func (*CapiResourceFetcher) AWSIamConfig

func (r *CapiResourceFetcher) AWSIamConfig(ctx context.Context, ref *anywherev1.Ref, namespace string) (*anywherev1.AWSIamConfig, error)

func (*CapiResourceFetcher) CloudStackControlPlaneMachineTemplate

func (r *CapiResourceFetcher) CloudStackControlPlaneMachineTemplate(ctx context.Context, cs *anywherev1.Cluster) (*cloudstackv1.CloudStackMachineTemplate, error)

func (*CapiResourceFetcher) CloudStackEtcdMachineTemplate

func (r *CapiResourceFetcher) CloudStackEtcdMachineTemplate(ctx context.Context, cs *anywherev1.Cluster) (*cloudstackv1.CloudStackMachineTemplate, error)

func (*CapiResourceFetcher) ControlPlane

func (*CapiResourceFetcher) DockerControlPlaneMachineTemplate

func (r *CapiResourceFetcher) DockerControlPlaneMachineTemplate(ctx context.Context, cs *anywherev1.Cluster) (*dockerv1.DockerMachineTemplate, error)

func (*CapiResourceFetcher) Etcd

func (*CapiResourceFetcher) ExistingCloudStackControlPlaneMachineConfig

func (r *CapiResourceFetcher) ExistingCloudStackControlPlaneMachineConfig(ctx context.Context, cs *anywherev1.Cluster) (*anywherev1.CloudStackMachineConfig, error)

func (*CapiResourceFetcher) ExistingCloudStackEtcdMachineConfig

func (r *CapiResourceFetcher) ExistingCloudStackEtcdMachineConfig(ctx context.Context, cs *anywherev1.Cluster) (*anywherev1.CloudStackMachineConfig, error)

func (*CapiResourceFetcher) ExistingControlPlaneKindNodeImage

func (r *CapiResourceFetcher) ExistingControlPlaneKindNodeImage(ctx context.Context, cs *anywherev1.Cluster) (string, error)

Control plane and external etcd are configured to use the same node image, so pulling it from control plane.

func (*CapiResourceFetcher) ExistingKubeVersion

func (r *CapiResourceFetcher) ExistingKubeVersion(ctx context.Context, cs *anywherev1.Cluster) (string, error)

func (*CapiResourceFetcher) ExistingVSphereControlPlaneMachineConfig

func (r *CapiResourceFetcher) ExistingVSphereControlPlaneMachineConfig(ctx context.Context, cs *anywherev1.Cluster) (*anywherev1.VSphereMachineConfig, error)

func (*CapiResourceFetcher) ExistingVSphereEtcdMachineConfig

func (r *CapiResourceFetcher) ExistingVSphereEtcdMachineConfig(ctx context.Context, cs *anywherev1.Cluster) (*anywherev1.VSphereMachineConfig, error)

func (*CapiResourceFetcher) ExistingWorkerKindNodeImage

func (r *CapiResourceFetcher) ExistingWorkerKindNodeImage(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (string, error)

func (*CapiResourceFetcher) Fetch

func (r *CapiResourceFetcher) Fetch(ctx context.Context, name string, namespace string, kind string, apiVersion string) (*unstructured.Unstructured, error)

func (*CapiResourceFetcher) FetchAppliedSpec

func (r *CapiResourceFetcher) FetchAppliedSpec(ctx context.Context, cs *anywherev1.Cluster) (*cluster.Spec, error)

func (*CapiResourceFetcher) FetchCluster

func (r *CapiResourceFetcher) FetchCluster(ctx context.Context, objectKey types.NamespacedName) (*anywherev1.Cluster, error)

func (*CapiResourceFetcher) FetchObject

func (r *CapiResourceFetcher) FetchObject(ctx context.Context, objectKey types.NamespacedName, obj client.Object) error

func (*CapiResourceFetcher) FetchObjectByName

func (r *CapiResourceFetcher) FetchObjectByName(ctx context.Context, name string, namespace string, obj client.Object) error

func (*CapiResourceFetcher) OIDCConfig

func (r *CapiResourceFetcher) OIDCConfig(ctx context.Context, ref *anywherev1.Ref, namespace string) (*anywherev1.OIDCConfig, error)

func (*CapiResourceFetcher) VSphereControlPlaneMachineTemplate

func (r *CapiResourceFetcher) VSphereControlPlaneMachineTemplate(ctx context.Context, cs *anywherev1.Cluster) (*vspherev1.VSphereMachineTemplate, error)

func (*CapiResourceFetcher) VSphereCredentials

func (r *CapiResourceFetcher) VSphereCredentials(ctx context.Context) (*corev1.Secret, error)

func (*CapiResourceFetcher) VSphereEtcdMachineTemplate

func (r *CapiResourceFetcher) VSphereEtcdMachineTemplate(ctx context.Context, cs *anywherev1.Cluster) (*vspherev1.VSphereMachineTemplate, error)

type CloudStackTemplate

type CloudStackTemplate struct {
	ResourceFetcher
	ResourceUpdater
	// contains filtered or unexported fields
}

func (*CloudStackTemplate) TemplateResources

type DockerTemplate

type DockerTemplate struct {
	ResourceFetcher
	// contains filtered or unexported fields
}

func (*DockerTemplate) TemplateResources

func (r *DockerTemplate) TemplateResources(ctx context.Context, eksaCluster *anywherev1.Cluster, clusterSpec *cluster.Spec) ([]*unstructured.Unstructured, error)

type NutanixTemplate added in v0.12.0

type NutanixTemplate struct {
	ResourceFetcher
	// contains filtered or unexported fields
}

NutanixTemplate is a struct that implements the TemplateResources method for Nutanix Provider.

func (*NutanixTemplate) TemplateResources added in v0.12.0

func (r *NutanixTemplate) TemplateResources(
	ctx context.Context,
	cluster *anywherev1.Cluster,
	clusterSpec *cluster.Spec,
	dcConf anywherev1.NutanixDatacenterConfig,
	controlPlaneMachineConf anywherev1.NutanixMachineConfig,
	etcdMachineConf anywherev1.NutanixMachineConfig,
	workerMachineConfs map[string]anywherev1.NutanixMachineConfig,
) ([]*unstructured.Unstructured, error)

TemplateResources generates the templated resources for the nutanix cluster TODO(nutanix): This is currently a placeholder for the actual implementation.

type Reconciler

type Reconciler interface {
	Reconcile(ctx context.Context, objectKey types.NamespacedName, dryRun bool) error
}

type ResourceFetcher

type ResourceFetcher interface {
	MachineDeployment(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (*clusterv1.MachineDeployment, error)
	KubeadmConfigTemplate(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (*kubeadmv1.KubeadmConfigTemplate, error)
	VSphereWorkerMachineTemplate(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (*vspherev1.VSphereMachineTemplate, error)
	VSphereCredentials(ctx context.Context) (*corev1.Secret, error)
	FetchObject(ctx context.Context, objectKey types.NamespacedName, obj client.Object) error
	FetchObjectByName(ctx context.Context, name string, namespace string, obj client.Object) error
	Fetch(ctx context.Context, name string, namespace string, kind string, apiVersion string) (*unstructured.Unstructured, error)
	FetchCluster(ctx context.Context, objectKey types.NamespacedName) (*anywherev1.Cluster, error)
	ExistingVSphereDatacenterConfig(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (*anywherev1.VSphereDatacenterConfig, error)
	ExistingVSphereControlPlaneMachineConfig(ctx context.Context, cs *anywherev1.Cluster) (*anywherev1.VSphereMachineConfig, error)
	ExistingVSphereEtcdMachineConfig(ctx context.Context, cs *anywherev1.Cluster) (*anywherev1.VSphereMachineConfig, error)
	ExistingVSphereWorkerMachineConfig(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (*anywherev1.VSphereMachineConfig, error)
	ExistingCloudStackDatacenterConfig(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (*anywherev1.CloudStackDatacenterConfig, error)
	ExistingCloudStackControlPlaneMachineConfig(ctx context.Context, cs *anywherev1.Cluster) (*anywherev1.CloudStackMachineConfig, error)
	ExistingCloudStackEtcdMachineConfig(ctx context.Context, cs *anywherev1.Cluster) (*anywherev1.CloudStackMachineConfig, error)
	ExistingCloudStackWorkerMachineConfig(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (*anywherev1.CloudStackMachineConfig, error)
	ExistingWorkerNodeGroupConfig(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (*anywherev1.WorkerNodeGroupConfiguration, error)
	ExistingKubeVersion(ctx context.Context, cs *anywherev1.Cluster) (string, error)
	ExistingControlPlaneKindNodeImage(ctx context.Context, cs *anywherev1.Cluster) (string, error)
	ExistingWorkerKindNodeImage(ctx context.Context, cs *anywherev1.Cluster, wnc anywherev1.WorkerNodeGroupConfiguration) (string, error)
	ControlPlane(ctx context.Context, cs *anywherev1.Cluster) (*controlplanev1.KubeadmControlPlane, error)
	Etcd(ctx context.Context, cs *anywherev1.Cluster) (*etcdv1.EtcdadmCluster, error)
	FetchAppliedSpec(ctx context.Context, cs *anywherev1.Cluster) (*cluster.Spec, error)
	AWSIamConfig(ctx context.Context, ref *anywherev1.Ref, namespace string) (*anywherev1.AWSIamConfig, error)
	OIDCConfig(ctx context.Context, ref *anywherev1.Ref, namespace string) (*anywherev1.OIDCConfig, error)
}

type ResourceUpdater

type ResourceUpdater interface {
	CreateResource(ctx context.Context, obj *unstructured.Unstructured, dryRun bool) error
	UpdateTemplate(template *unstructured.Unstructured, values map[string]interface{}) (hasDiff bool, err error)
	ApplyTemplate(ctx context.Context, template *unstructured.Unstructured, values map[string]interface{}, dryRun bool) error
	ForceApplyTemplate(ctx context.Context, template *unstructured.Unstructured, dryRun bool) error
	ApplyUpdatedTemplate(ctx context.Context, template *unstructured.Unstructured, dryRun bool) error
	ApplyPatch(ctx context.Context, obj client.Object, dryRun bool) error
}

type TinkerbellTemplate

type TinkerbellTemplate struct {
	ResourceFetcher
	// contains filtered or unexported fields
}

func (*TinkerbellTemplate) TemplateResources

TODO(pokearu): This method is currently not used. Need to add logic in reconciler for TinkerbellDatacenterKind.

type VsphereTemplate

type VsphereTemplate struct {
	ResourceFetcher
	ResourceUpdater
	// contains filtered or unexported fields
}

func (*VsphereTemplate) TemplateResources

Directories

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

Jump to

Keyboard shortcuts

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