Skip to content
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

Merged
merged 3 commits into from
Feb 15, 2024

Conversation

mitalipaygude
Copy link
Member

@mitalipaygude mitalipaygude commented Feb 14, 2024

Issue #, if available:

Description of changes:
Fix tinkerbell IP in hegel urls controller

Testing (if applicable):

  • manual test
  • unit tests

Documentation added/planned (if applicable):

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot eks-distro-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 14, 2024
@mitalipaygude mitalipaygude added do-not-merge/hold and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 14, 2024
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

Attention: 76 lines in your changes are missing coverage. Please review.

Comparison is base (4583834) 73.48% compared to head (bc26f1f) 73.55%.
Report is 75 commits behind head on main.

Files Patch % Lines
controllers/kubeadmcontrolplane_controller.go 64.00% 5 Missing and 4 partials ⚠️
controllers/machinedeployment_controller.go 52.63% 5 Missing and 4 partials ⚠️
pkg/providers/tinkerbell/validate.go 73.68% 4 Missing and 1 partial ⚠️
pkg/providers/vsphere/vsphere.go 0.00% 5 Missing ⚠️
pkg/clustermanager/cluster_manager.go 78.94% 4 Missing ⚠️
pkg/providers/snow/snow.go 0.00% 4 Missing ⚠️
release/api/v1alpha1/artifacts.go 0.00% 4 Missing ⚠️
pkg/providers/docker/docker.go 0.00% 3 Missing ⚠️
pkg/workflows/management/create_install_eksa.go 57.14% 2 Missing and 1 partial ⚠️
pkg/workflows/management/create_workload.go 78.57% 2 Missing and 1 partial ⚠️
... and 17 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7574      +/-   ##
==========================================
+ Coverage   73.48%   73.55%   +0.07%     
==========================================
  Files         579      580       +1     
  Lines       36357    36664     +307     
==========================================
+ Hits        26718    26970     +252     
- Misses       7875     7916      +41     
- Partials     1764     1778      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eks-distro-bot eks-distro-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 14, 2024
@mitalipaygude
Copy link
Member Author

/approve

@abhay-krishna
Copy link
Member

/lgtm
/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhay-krishna, mitalipaygude

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [abhay-krishna,mitalipaygude]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mitalipaygude mitalipaygude merged commit 44d1394 into aws:main Feb 15, 2024
10 of 12 checks passed
Copy link
Member

@jacobweinstock jacobweinstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mitalipaygude . Couple of comments, thanks.

}

// HasTinkerbellIPAnnotation returns the tinkerbell IP value if the annotation exists.
func (c *Cluster) HasTinkerbellIPAnnotation() (string, bool) {
Copy link
Member

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 just TinkerbellIPAnnotation.

@@ -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 {
Copy link
Member

Choose a reason for hiding this comment

The 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.

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants