Skip to content

Commit

Permalink
Add CAPI provider versions to logs (#6661)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna authored Sep 7, 2023
1 parent a07878f commit edc1df1
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion pkg/cluster/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/constants"
"github.com/aws/eks-anywhere/pkg/logger"
"github.com/aws/eks-anywhere/pkg/manifests"
"github.com/aws/eks-anywhere/pkg/manifests/bundles"
"github.com/aws/eks-anywhere/pkg/version"
Expand Down Expand Up @@ -69,7 +70,37 @@ func (b FileSpecBuilder) Build(clusterConfigURL string) (*Spec, error) {
if err != nil {
return nil, errors.Wrapf(err, "getting Bundles file")
}

bundle := bundlesManifest.Spec.VersionsBundles[0]
var infraProviderName, infraProviderVersion string
switch config.Cluster.Spec.DatacenterRef.Kind {
case v1alpha1.CloudStackDatacenterKind:
infraProviderName = "Cluster API Provider CloudStack"
infraProviderVersion = bundle.CloudStack.Version
case v1alpha1.DockerDatacenterKind:
infraProviderName = "Cluster API Provider Docker"
infraProviderVersion = bundle.Docker.Version
case v1alpha1.NutanixDatacenterKind:
infraProviderName = "Cluster API Provider Nutanix"
infraProviderVersion = bundle.Nutanix.Version
case v1alpha1.SnowDatacenterKind:
infraProviderName = "Cluster API Provider AWS Snow"
infraProviderVersion = bundle.Snow.Version
case v1alpha1.TinkerbellDatacenterKind:
infraProviderName = "Cluster API Provider Tinkerbell"
infraProviderVersion = bundle.Tinkerbell.Version
case v1alpha1.VSphereDatacenterKind:
infraProviderName = "Cluster API Provider VSphere"
infraProviderVersion = bundle.VSphere.Version
}
logger.V(4).Info(
"Using CAPI provider versions",
"Core Cluster API", bundle.ClusterAPI.Version,
"Kubeadm Bootstrap", bundle.Bootstrap.Version,
"Kubeadm Control Plane", bundle.ControlPlane.Version,
"External etcd Bootstrap", bundle.ExternalEtcdBootstrap.Version,
"External etcd Controller", bundle.ExternalEtcdController.Version,
infraProviderName, infraProviderVersion,
)
bundlesManifest.Namespace = constants.EksaSystemNamespace

configManager, err := NewDefaultConfigManager()
Expand Down

0 comments on commit edc1df1

Please sign in to comment.