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

chore: add generic methods and use them part 2/2 #5720

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

DmitriyMV
Copy link
Member

@DmitriyMV DmitriyMV commented Jun 9, 2022

Use things from #5702.

Signed-off-by: Dmitriy Matrenichev dmitry.matrenichev@siderolabs.com


This change is Reviewable

@DmitriyMV DmitriyMV changed the title chore: add generic methods and use them part #2 WIP: chore: add generic methods and use them part 2/2 Jun 9, 2022
@@ -53,7 +53,8 @@ func Generate(ctx context.Context, in *machine.GenerateConfigurationRequest) (re
DeviceCIDR: device.Cidr,
DeviceDHCP: device.Dhcp,
DeviceIgnore: device.Ignore,
DeviceRoutes: routes,
// TODO: this looks strange, since its always empty de-facto.
Copy link
Member Author

Choose a reason for hiding this comment

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

I have no idea whats happening here

Copy link
Member

Choose a reason for hiding this comment

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

@Unix4ever should know! I think it should be a copy, but ?

Copy link
Member

Choose a reason for hiding this comment

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

probably copy(routes, device.Routes) before this place is missing

@DmitriyMV DmitriyMV changed the title WIP: chore: add generic methods and use them part 2/2 chore: add generic methods and use them part 2/2 Jun 9, 2022
Copy link
Member

@smira smira left a comment

Choose a reason for hiding this comment

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

😎

Use things from siderolabs#5702.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
@DmitriyMV
Copy link
Member Author

I added

DeviceRoutes: slices.Map(device.Routes, func(route *machine.RouteConfig) *v1alpha1.Route {
	return &v1alpha1.Route{
		RouteNetwork: route.Network,
		RouteGateway: route.Gateway,
		RouteMetric:  route.Metric,
	}
}),

@DmitriyMV
Copy link
Member Author

FYI @Unix4ever

@DmitriyMV
Copy link
Member Author

/m

@talos-bot talos-bot merged commit 4dbbf4a into siderolabs:master Jun 9, 2022
@DmitriyMV DmitriyMV deleted the generics-part2 branch June 9, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants