Skip to content

Commit

Permalink
Modify --tinkerbell-bootstrap-ip flag to change boots CLI flags
Browse files Browse the repository at this point in the history
The value provided in the flag is now used in the CLI arguments when running boots binary:
--syslog-addr
--tftp-addr
--http-addr
--dhcp-ip-for-packet
--dhcp-syslog-ip
--dhcp-tftp-ip
--dhcp-http-ipxe-binary-url
--dhcp-http-ipxe-script-url
  • Loading branch information
Gedulis12 committed Oct 27, 2024
1 parent e1d56ae commit f471fbb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pkg/providers/tinkerbell/stack/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ func (s *Installer) installBootsOnDocker(ctx context.Context, bundle releasev1al
"-dhcp-addr", "0.0.0.0:67",
"-osie-url", osiePath,
"-tink-server", fmt.Sprintf("%s:%s", tinkServerIP, grpcPort),
"--syslog-addr", fmt.Sprintf("%s:514", tinkServerIP),
"--tftp-addr", fmt.Sprintf("%s:69", tinkServerIP),
"--http-addr", fmt.Sprintf("%s:80", tinkServerIP),
"--dhcp-ip-for-packet", fmt.Sprintf("%s", tinkServerIP),

Check failure on line 265 in pkg/providers/tinkerbell/stack/stack.go

View workflow job for this annotation

GitHub Actions / lint

S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)
"--dhcp-syslog-ip", fmt.Sprintf("%s", tinkServerIP),

Check failure on line 266 in pkg/providers/tinkerbell/stack/stack.go

View workflow job for this annotation

GitHub Actions / lint

S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)
"--dhcp-tftp-ip", fmt.Sprintf("%s:69", tinkServerIP),
"--dhcp-http-ipxe-binary-url", fmt.Sprintf("http://%s:8080/ipxe/", tinkServerIP),
"--dhcp-http-ipxe-script-url", fmt.Sprintf("http://%s/auto.ipxe", tinkServerIP),
}
if err := s.docker.Run(ctx, s.localRegistryURL(bundle.Boots.URI), boots, cmd, flags...); err != nil {
return fmt.Errorf("running boots with docker: %v", err)
Expand Down
18 changes: 16 additions & 2 deletions pkg/providers/tinkerbell/stack/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,28 @@ func TestTinkerbellStackInstallWithDifferentOptions(t *testing.T) {
if stackTest.installOnDocker {
docker.EXPECT().Run(ctx, "public.ecr.aws/eks-anywhere/boots:latest",
boots,
[]string{"-backend-kube-config", "/kubeconfig", "-dhcp-addr", "0.0.0.0:67", "-osie-url", "https://anywhere-assests.eks.amazonaws.com/tinkerbell/hook", "-tink-server", "1.2.3.4:42113"},
[]string{
"-backend-kube-config",
"/kubeconfig",
"-dhcp-addr", "0.0.0.0:67",
"-osie-url", "https://anywhere-assests.eks.amazonaws.com/tinkerbell/hook",
"-tink-server", "1.2.3.4:42113",
"--syslog-addr", fmt.Sprintf("%s:514", testIP),
"--tftp-addr", fmt.Sprintf("%s:69", testIP),
"--http-addr", fmt.Sprintf("%s:80", testIP),
"--dhcp-ip-for-packet", fmt.Sprintf("%s", testIP),

Check failure on line 241 in pkg/providers/tinkerbell/stack/stack_test.go

View workflow job for this annotation

GitHub Actions / lint

S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)
"--dhcp-syslog-ip", fmt.Sprintf("%s", testIP),

Check failure on line 242 in pkg/providers/tinkerbell/stack/stack_test.go

View workflow job for this annotation

GitHub Actions / lint

S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)
"--dhcp-tftp-ip", fmt.Sprintf("%s:69", testIP),
"--dhcp-http-ipxe-binary-url", fmt.Sprintf("http://%s:8080/ipxe/", testIP),
"--dhcp-http-ipxe-script-url", fmt.Sprintf("http://%s/auto.ipxe", testIP),
},
"-v", gomock.Any(),
"--network", "host",
"-e", gomock.Any(),
"-e", gomock.Any(),
"-e", gomock.Any(),
"-e", gomock.Any(),
)
).AnyTimes()
}

if err := s.Install(
Expand Down

0 comments on commit f471fbb

Please sign in to comment.