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

[mgmt-framework] Fix rest-server startup script #14979

Merged
merged 1 commit into from
May 23, 2023

Conversation

sachinholla
Copy link
Contributor

Why I did it

Mgmt-framework REST server startup script is using "null" as default value for all optional fields of REST_SERVER table -- due to incorrect use of jq -r command. Server was not coming up when REST_SERVER entry exists but some fields were not given (which is a valid configuration).

Work item tracking
  • Microsoft ADO (number only):

How I did it

Fixed the jq query expression to return empty string for non existing fields.

How to verify it

Verify REST server startup with following configurations:

  • No REST_SERVER and x509 table entries
  • With client_auth config in REST_SERVER entry
  • With log_level config in REST_SERVER entry
  • With certificate configs in REST_SERVER entry
  • WIth all configs in REST_SERVER entry
  • With certificate configs in x509 entry
  • With client_auth config in REST_SERVER entry and certificate configs in x509 entry
  • With certificate configs in both REST_SERVER and x509 entries

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Tested branch (Please provide the tested image version)

  • [x ] SONiC.master.243527-3d1733bc4

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

This script was using 'null' as default value for all optional fields
of REST_SERVER table -- due to incorrect use of 'jq -r' command.
Server was not coming up when REST_SERVER entry exists but some fields
were not given (which is a valid configuration).
Fixed the jq query expression to return empty string for non existing
fields.

Signed-off-by: Sachin Holla <sachin.holla@broadcom.com>
@sachinholla sachinholla requested a review from lguohan as a code owner May 8, 2023 10:57
@adyeung
Copy link
Collaborator

adyeung commented May 18, 2023

@qiluo-msft please help review the change

@adyeung adyeung requested a review from qiluo-msft May 18, 2023 20:36
@qiluo-msft qiluo-msft requested a review from ganglyu May 18, 2023 20:37
@adyeung
Copy link
Collaborator

adyeung commented May 19, 2023

@lguohan pls help merge the fix

@Praveen-Brcm Praveen-Brcm merged commit ba6aba2 into sonic-net:master May 23, 2023
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