-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tinkerbell IP in hegel urls controller #7574
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ func (p *Provider) BootstrapClusterOpts(_ *cluster.Spec) ([]bootstrapper.Bootstr | |
func (p *Provider) PreCAPIInstallOnBootstrap(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error { | ||
logger.V(4).Info("Installing Tinkerbell stack on bootstrap cluster") | ||
|
||
logger.V(4).Info("Adding annotation for tinkerbell ip on bootstrap cluster") | ||
clusterSpec.Cluster.AddTinkerbellIPAnnotation(p.tinkerbellIP) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a code comment here are why we need to add this annotation will be very helpful for future us. |
||
versionsBundle := clusterSpec.RootVersionsBundle() | ||
|
||
err := p.stackInstaller.Install( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ package management | |
import ( | ||
"context" | ||
|
||
"github.com/aws/eks-anywhere/pkg/api/v1alpha1" | ||
"github.com/aws/eks-anywhere/pkg/cluster" | ||
"github.com/aws/eks-anywhere/pkg/logger" | ||
"github.com/aws/eks-anywhere/pkg/task" | ||
|
@@ -38,6 +39,11 @@ func (s *installEksaComponentsOnBootstrapTask) Checkpoint() *task.CompletedTask | |
type installEksaComponentsOnWorkloadTask struct{} | ||
|
||
func (s *installEksaComponentsOnWorkloadTask) Run(ctx context.Context, commandContext *task.CommandContext) task.Task { | ||
if commandContext.ClusterSpec.Cluster.Spec.DatacenterRef.Kind == v1alpha1.TinkerbellDatacenterKind { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a code comment here around why this is the only place we remove the annotation would be very helpful to future us. |
||
logger.Info("Removing Tinkerbell IP annotation") | ||
commandContext.ClusterSpec.Cluster.ClearTinkerbellIPAnnotation() | ||
} | ||
|
||
logger.Info("Installing EKS-A custom components on workload cluster") | ||
|
||
err := installEKSAComponents(ctx, commandContext, commandContext.WorkloadCluster) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might consider not using the bool in the return. The alternative is for consumers to check if the returned string is empty or not. The bool adds extra checking that doesn't feel necessary. If you do go with this idea, you might then rethink the name of the method. Maybe just remove the
Has
, so its justTinkerbellIPAnnotation
.