Skip to content

NC | Health | Connection test is invalid because of additional .json #8910

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

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Mar 27, 2025

Describe the Problem

The following 2 fixes got merged around the same time, they have a logical conflict -

  1. bucket notifications - add connection test to health #8833 - added a health test to a connection file, in which .json was added to the file name.
  2. NC | CLI | List bucket dose not return full bucket name with .json suffix #8806 - removed a config dir check that if a file already has .json in it won't add.
    get_connection_by_name() already adds .json, therefore, the health CLI tried to search for conn.json.json and failed because it doesn't exist.

Explain the Changes

  1. Removed the additional .json suffix.

Issues: Fixed #xxx / Gap #xxx

Testing Instructions:

  1. create an account - noobaa-cli account add --name account1 --user=root --new_buckets_path=/private/tmp/nb_storage1
  2. create a bucket - noobaa-cli bucket add --name buck1 --owner account1 --path=/private/tmp/nb_storage1
  3. create a dummy connection - noobaa-cli connection add --name conn --notification_protocol http
  4. Run noobaa service - sudo node noobaa-core/src/cmd/nsfs.js --debug 5
  5. create notification configuration file -
> vi notif.json
{
"TopicConfigurations": [ { "Id": "notify_event", "TopicArn": "conn", "Events": [ "s3:ObjectCreated:*" ] }
]
}
  1. Run health script and check that the connection is valid/invalid -
{
  "response": {
    "code": "HealthStatus",
    "message": "Health status retrieved successfully",
    "reply": {
      "service_name": "noobaa",
....
       },
        "connections_status": {
          "invalid_storages": [],
          "valid_storages": [
            {
              "name": "conn",
              "config_path": "/private/tmp/custom_conf_dir/connections/conn.json"
            }
          ]
        }
      }
    }
  }
}
  • Doc added/updated
  • Tests added

Copy link
Contributor

@shirady shirady left a comment

Choose a reason for hiding this comment

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

LGTM

@romayalon romayalon force-pushed the romy-fix-connection-health branch from f72307a to c7c3eb1 Compare March 27, 2025 12:24
@romayalon romayalon mentioned this pull request Mar 27, 2025
2 tasks
@romayalon romayalon merged commit b84ca35 into noobaa:master Mar 27, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants