Skip to content

Comments

fix: generate database ID earlier and pull Docker image before container run#55

Merged
tsivaprasad merged 2 commits intomainfrom
PLAT-115-fix-validation-errors-and-image-pull-issues-during-volume-validation-in-database-workflows
Jun 13, 2025
Merged

fix: generate database ID earlier and pull Docker image before container run#55
tsivaprasad merged 2 commits intomainfrom
PLAT-115-fix-validation-errors-and-image-pull-issues-during-volume-validation-in-database-workflows

Conversation

@tsivaprasad
Copy link
Contributor

@tsivaprasad tsivaprasad commented Jun 13, 2025

This PR includes two bug fixes:

Database ID generation:

  • Moved the generation of DatabaseID earlier in the flow (before ValidateSpec) to avoid validation errors when the ID is missing.

Docker image availability:

  • Added logic in ContainerRun to ensure the Docker image is pulled before attempting to create the container. This prevents failures due to missing local images.

Validation:

  • Created a database without an ID using:

restish control-plane-local-1 create-database < No_ID_createdatabase.json

  • Successfully created the database by assigning a newly generated ID.

  • Deleted the pgedge Docker image from local images, then created a database without an ID.

  • Volume validation was successful, and the database was created.

  • Observed that the database was created with a newly generated random ID.

  • Created a database with an ID using:

restish control-plane-local-1 create-database < createdatabase.json

  • Successfully created the database with the specified ID.

restish control-plane-local-1 list-databases

HTTP/1.1 200 OK
Content-Length: 1646
Content-Type: application/json
Date: Fri, 13 Jun 2025 12:09:52 GMT

[
  {
    created_at: "2025-06-13T12:06:20Z"
    id: "0603d9cd-df2f-42ad-b945-2bc4b73fa461"
    instances: [
      {
        host_id: "8f6e5455-e228-4e2e-9129-a86cba1437c8"
        id: "badffb5e-c902-5167-b33b-173090dc77b2"
        node_name: "n1"
        state: "available"
      }
      {
        host_id: "36dcd7ff-9f04-476e-ac6f-5495d075607d"
        id: "774da19c-6185-599d-8ffd-de8014703dc8"
        node_name: "n2"
        state: "available"
      }
      {
        host_id: "fa461a39-5867-4a72-9923-dd7ce91e1eab"
        id: "c1a27534-b159-577b-822c-3f6d774b3c4d"
        node_name: "n3"
        state: "available"
      }
    ]
    state: "available"
    updated_at: "2025-06-13T12:06:20Z"
  }
  {
    created_at: "2025-06-13T11:31:25Z"
    id: "a7fa3516-d609-4779-ae12-3481b66e0d3b"
    instances: [
      {
        host_id: "8f6e5455-e228-4e2e-9129-a86cba1437c8"
        id: "f5980592-c75a-56a7-9bb6-2d19fcaf3651"
        node_name: "n1"
        state: "available"
      }
      {
        host_id: "36dcd7ff-9f04-476e-ac6f-5495d075607d"
        id: "36e0d876-e3f1-5c80-8154-d317f8a2e79d"
        node_name: "n2"
        state: "available"
      }
      {
        host_id: "fa461a39-5867-4a72-9923-dd7ce91e1eab"
        id: "759a5f06-d387-59f5-88ba-e885fc5811ab"
        node_name: "n3"
        state: "available"
      }
    ]
    state: "available"
    updated_at: "2025-06-13T11:31:25Z"
  }
  {
    created_at: "2025-06-13T12:09:03Z"
    id: "f2f1cae9-6f37-4609-aa98-d0991bff3493"
    instances: [
      {
        host_id: "8f6e5455-e228-4e2e-9129-a86cba1437c8"
        id: "60cff14d-066d-579c-b139-522d35f69d08"
        node_name: "n1"
        state: "available"
      }
      {
        host_id: "36dcd7ff-9f04-476e-ac6f-5495d075607d"
        id: "1de81ed2-aac1-5074-a221-681fdff0735d"
        node_name: "n2"
        state: "available"
      }
      {
        host_id: "fa461a39-5867-4a72-9923-dd7ce91e1eab"
        id: "73e3ab53-65b4-5a12-a73c-01c9df80af73"
        node_name: "n3"
        state: "available"
      }
    ]
    state: "available"
    updated_at: "2025-06-13T12:09:03Z"
  }
]

PLAT-115

@tsivaprasad tsivaprasad merged commit 862f66a into main Jun 13, 2025
2 checks passed
@tsivaprasad tsivaprasad deleted the PLAT-115-fix-validation-errors-and-image-pull-issues-during-volume-validation-in-database-workflows branch July 3, 2025 12:54
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.

2 participants