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

RFE: Add GetDefaultTarget and SetDefaultTarget API #944

Closed
11 tasks done
engelmi opened this issue Sep 16, 2024 · 2 comments · Fixed by #951
Closed
11 tasks done

RFE: Add GetDefaultTarget and SetDefaultTarget API #944

engelmi opened this issue Sep 16, 2024 · 2 comments · Fixed by #951
Assignees
Labels
enhancement New feature or request jira Issues that are synced to Jira
Milestone

Comments

@engelmi
Copy link
Member

engelmi commented Sep 16, 2024

Please describe what you would like to see

In order to be able to get and set the default target of the system to boot into, it is necessary to extend BlueChi with the GetDefaultTarget and SetDefaultTarget API provided by the systemd Manager API (see the freedesktop systemd documentation).
For more information about the boot process, see here.

Please describe the solution you'd like

  • bluechi-controller: Add new API methods on public DBus for interface org.eclipse.bluechi.Node and delegate to bluechi-agent
    • GetDefaultTarget
    • SetDefaultTarget
  • bluechi-agent: Add new API methods on internal DBus and delegate to systemd bus
    • GetDefaultTarget
    • SetDefaultTarget
  • bluechictl: Add new commands in bluechictl:
    • bluechictl get-default [nodename]
      Similar to systemctl get-default). [nodename] is required for now. Maybe later this can be changed - if [nodename] is not provided, print all default targets for all nodes
    • bluechictl set-default [nodename] [target]
      Similar to systemctl set-default TARGET.
      The target needs to be a .target unit, so there should be pre-validation in place checking that the unit ends with .target.
  • Implement integration tests
  • Extend documentation (man pages, examples, etc.)
@engelmi engelmi added the enhancement New feature or request label Sep 16, 2024
@engelmi engelmi added this to the v0.9 milestone Sep 16, 2024
@ArtiomDivak
Copy link
Contributor

Please assign this to me

@engelmi engelmi added the jira Issues that are synced to Jira label Sep 16, 2024
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Sep 26, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Sep 26, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Sep 26, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Sep 26, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Sep 29, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Sep 30, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 1, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 3, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 3, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 7, 2024
This feature will get the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 7, 2024
This feature will get and set the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 7, 2024
This feature will get and set the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 7, 2024
This feature will get and set the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 7, 2024
This feature will get and set the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 7, 2024
This feature will get and set the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 7, 2024
This feature will get and set the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
ArtiomDivak added a commit to ArtiomDivak/BlueChi that referenced this issue Oct 7, 2024
This feature will get and set the default target for a specific node.

Solves eclipse-bluechi#944
Signed-off-by: Artiom Divak <[email protected]>
mwperina pushed a commit that referenced this issue Oct 7, 2024
This feature will get and set the default target for a specific node.

Solves #944
Signed-off-by: Artiom Divak <[email protected]>
@mwperina
Copy link
Member

mwperina commented Oct 7, 2024

Fixed by #951

@mwperina mwperina closed this as completed Oct 7, 2024
engelmi added a commit to engelmi/bluechi that referenced this issue Oct 11, 2024
Relates to: eclipse-bluechi#944

The bluechictl set-default command used for the force option a
separate CLI parameter with true/false values. This is a bit
brittle and doesn't take into account other truthy values. Using
the already defined --force option results in a much clearer
usage of this command.
In addition, when passing unit name other than a .target it failed
with a rather cryptic error message from systemd. Therefore, lets
do a pre-validation inside bluechictl before submitting any request
and provide a proper error message.

Signed-off-by: Michael Engel <[email protected]>
engelmi added a commit to engelmi/bluechi that referenced this issue Oct 14, 2024
Relates to: eclipse-bluechi#944

The bluechictl set-default command used for the force option a
separate CLI parameter with true/false values. This is a bit
brittle and doesn't take into account other truthy values. Using
the already defined --force option results in a much clearer
usage of this command.
In addition, when passing unit name other than a .target it failed
with a rather cryptic error message from systemd. Therefore, lets
do a pre-validation inside bluechictl before submitting any request
and provide a proper error message.

Signed-off-by: Michael Engel <[email protected]>
engelmi added a commit to engelmi/bluechi that referenced this issue Oct 14, 2024
Relates to: eclipse-bluechi#944

The bluechictl set-default command used for the force option a
separate CLI parameter with true/false values. This is a bit
brittle and doesn't take into account other truthy values. Using
the already defined --force option results in a much clearer
usage of this command.
In addition, when passing unit name other than a .target it failed
with a rather cryptic error message from systemd. Therefore, lets
do a pre-validation inside bluechictl before submitting any request
and provide a proper error message.

Signed-off-by: Michael Engel <[email protected]>
engelmi added a commit that referenced this issue Oct 14, 2024
Relates to: #944

The bluechictl set-default command used for the force option a
separate CLI parameter with true/false values. This is a bit
brittle and doesn't take into account other truthy values. Using
the already defined --force option results in a much clearer
usage of this command.
In addition, when passing unit name other than a .target it failed
with a rather cryptic error message from systemd. Therefore, lets
do a pre-validation inside bluechictl before submitting any request
and provide a proper error message.

Signed-off-by: Michael Engel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jira Issues that are synced to Jira
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants