Skip to content

Conversation

@Fredi-raspall
Copy link
Contributor

@Fredi-raspall Fredi-raspall commented Dec 10, 2025

This PR:

  • adds a new crate to store/retrieve globally the name of the gateway
  • adds a --name cmd line argument to specify the name of a gateway/dataplane
  • if no --name is provided, it retrieves the name from the OS. This is desired according to @Frostman

@Fredi-raspall Fredi-raspall requested a review from a team as a code owner December 10, 2025 18:02
@Fredi-raspall Fredi-raspall requested review from Frostman and daniel-noland and removed request for a team December 10, 2025 18:02
Copy link
Collaborator

@daniel-noland daniel-noland left a comment

Choose a reason for hiding this comment

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

I think I must have missed something. We should chat about this

@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/gwname_cmdline branch from e96d3c0 to 2793536 Compare December 11, 2025 10:26
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/gwname_cmdline branch 2 times, most recently from f8ccdfc to 6de9d4b Compare December 12, 2025 21:36
@Fredi-raspall Fredi-raspall changed the title Pr/fredi/gwname cmdline Add crate gwname to set gateway name Dec 12, 2025
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/gwname_cmdline branch 3 times, most recently from 3e5f0b3 to 52aee41 Compare December 16, 2025 11:16
Adds a tiny crate to set the gateway name in a static
variable that can be set only once. The name will be
set either from the cmd line arguments or by retrieving
the hostname from the OS.

Signed-off-by: Fredi Raspall <[email protected]>
The argument, currently optional, will allow setting the name of
the gateway.

Signed-off-by: Fredi Raspall <[email protected]>
Augment LaunchConfiguration with GeneralConfigSection that may
include general, global settings.

Signed-off-by: Fredi Raspall <[email protected]>
Set the gateway name from the cmd line --name argument.
If no --name is provided, set the gateway name from the hostname
provided by the OS. Fail to start if the gatway name cannot be set.

With this, the gateway name defaults to the hostname but can always
be overriden with --name.

Signed-off-by: Fredi Raspall <[email protected]>
Adds a fixture so that we can annotate tests such that
we make sure that the gateway name is seen as set from
those tests. Sample:

    #[test]
    #[wrap(with_gw_name())]
    fn test_potato() {
        let gw_name = get_gw_name().unwrap();
        println!("Hello {gw_name}");
    }

This is Daniel's.

Signed-off-by: Fredi Raspall <[email protected]>
@Fredi-raspall Fredi-raspall force-pushed the pr/fredi/gwname_cmdline branch from bcccd52 to 7ac3866 Compare December 16, 2025 21:28
Copy link
Collaborator

@daniel-noland daniel-noland left a comment

Choose a reason for hiding this comment

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

approved after offline chat

@mvachhar mvachhar enabled auto-merge December 16, 2025 22:09
@mvachhar mvachhar added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit ea8da1c Dec 16, 2025
21 checks passed
@mvachhar mvachhar deleted the pr/fredi/gwname_cmdline branch December 16, 2025 23:14
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.

3 participants