Skip to content

Commit

Permalink
Add mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mitalipaygude committed Jan 17, 2024
1 parent 066d1a3 commit fb0ae0e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/clustermanager/cluster_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,22 @@ func (c *ClusterManager) getWorkloadClusterKubeconfig(ctx context.Context, clust
return nil
}

// CreateEKSAReleaseBundle applies the eks-a release bundle to the cluster.
func (c *ClusterManager) CreateEKSAReleaseBundle(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error {
if clusterSpec.Cluster.Namespace != "" {
if err := c.clusterClient.CreateNamespaceIfNotPresent(ctx, cluster.KubeconfigFile, clusterSpec.Cluster.Namespace); err != nil {
return err
}

Check warning on line 531 in pkg/clustermanager/cluster_manager.go

View check run for this annotation

Codecov / codecov/patch

pkg/clustermanager/cluster_manager.go#L527-L531

Added lines #L527 - L531 were not covered by tests
}

clusterSpec.Cluster.AddManagedByCLIAnnotation()

if err := c.ApplyBundles(ctx, clusterSpec, cluster); err != nil {
return err
}
return c.ApplyReleases(ctx, clusterSpec, cluster)

Check warning on line 539 in pkg/clustermanager/cluster_manager.go

View check run for this annotation

Codecov / codecov/patch

pkg/clustermanager/cluster_manager.go#L534-L539

Added lines #L534 - L539 were not covered by tests
}

func (c *ClusterManager) RunPostCreateWorkloadCluster(ctx context.Context, managementCluster, workloadCluster *types.Cluster, clusterSpec *cluster.Spec) error {
logger.V(3).Info("Waiting for controlplane and worker machines to be ready")
labels := []string{clusterv1.MachineControlPlaneNameLabel, clusterv1.MachineDeploymentNameLabel}
Expand Down
1 change: 1 addition & 0 deletions pkg/workflows/interfaces/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ClusterManager interface {
SaveLogsManagementCluster(ctx context.Context, spec *cluster.Spec, cluster *types.Cluster) error
SaveLogsWorkloadCluster(ctx context.Context, provider providers.Provider, spec *cluster.Spec, cluster *types.Cluster) error
InstallCustomComponents(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster, provider providers.Provider) error
CreateEKSAReleaseBundle(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
CreateEKSANamespace(ctx context.Context, cluster *types.Cluster) error
CreateEKSAResources(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, datacenterConfig providers.DatacenterConfig, machineConfigs []providers.MachineConfig) error
ApplyBundles(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster) error
Expand Down
14 changes: 14 additions & 0 deletions pkg/workflows/interfaces/mocks/clients.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fb0ae0e

Please sign in to comment.