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

Allow users to create a stack for managing pkg applications #17235

Closed
2 tasks done
jsteenb2 opened this issue Mar 12, 2020 · 0 comments · Fixed by #17448
Closed
2 tasks done

Allow users to create a stack for managing pkg applications #17235

jsteenb2 opened this issue Mar 12, 2020 · 0 comments · Fixed by #17448
Assignees

Comments

@jsteenb2
Copy link
Contributor

jsteenb2 commented Mar 12, 2020

We want to introduce the concept of a stack, which is a container for which to apply packages that maintain state of their application.

A stack record will look like the following:
{
  "stack_id": "UUID",
  "created_at": "TIME STAMP",
  "updated_at": "TIME STAMP",
  "config": {
    "urls": ["URL_TO_ORG_PKG", "URL_TO_SHARED_K8s_PKG"]
  },
  "resources": [
    {
      "apiVersion": "v2alpha1",
      "kind": "Bucket",
      "name": "bucket_1",
      "id": "UUID"
    },
    {
      "apiVersion": "v2alpha1",
      "kind": "Label",
      "name": "label_1",
      "id": "UUID"
    },
    {
      "apiVersion": "v2alpha1",
      "kind": "Dashboard",
      "name": "dash_1",
      "id": "UUID"
    },
    {
      "apiVersion": "v2alpha1",
      "kind": "Dashboard",
      "name": "dash_2",
      "id": "UUID"
    },
    {
      "apiVersion": "v2alpha1",
      "kind": "Task",
      "name": "task_1",
      "id": "UUID"
    }
   ...
  ]
}

The stack record consists of all resources that exist as a result of running the pkg. This issue is to create the foundation for which pkger will use this stack to manage state of its application of a pkg.

A new API endpoint is required

POST /api/v2/packages/stack

with the following req body (optional):

{
   urls: ["URL_TO_PKG_1", "URL_TO_PKG_2", ...]
}

with the following resp body:

{
   "stackID":  "UUID",
   "createdAt": "TIMESTAMP",
   "updatedAt": "TIMESTAMP",
   "config": {
      urls: [...valid urls or empty collection]
   }
}

AC

  • new endpoint POST /api/v2/packages/stack to initialize the stack
    • involves a lot of plumbing
  • stack record includes the following when created:
{
"stack_id": "UUID",
  "created_at": "TIME STAMP",
  "updated_at": "TIME STAMP",
  "config": {
    // if provided
    "urls": ["URL_TO_ORG_PKG"] 
  },
  "resources": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant