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

Buildpack lifecycle stack should be optional #2811

Open
danail-branekov opened this issue Aug 21, 2023 · 0 comments
Open

Buildpack lifecycle stack should be optional #2811

danail-branekov opened this issue Aug 21, 2023 · 0 comments
Labels
bug Something isn't working mta support the MTA controller

Comments

@danail-branekov
Copy link
Member

Background

According to the cf api docs "If a stack is not specified, then the app will default to the operator-configured default stack", meaning that the lifecycle stack should be optional

Acceptance

WHEN I create an app via the floowing request

curl "https://api.example.org/v3/apps" \
  -X POST \
  -H "Authorization: bearer [token]" \
  -H "Content-type: application/json" \
  -d '{
    "name": "my_app",
    "relationships": {
      "space": {
        "data": {
          "guid": "2f35885d-0c9d-4423-83ad-fd05066f8576"
        }
      }
    },
    "lifecycle": {
      "type": "buildpack",
    }
  }'

THEN I see the request succeed and I get a response saying that the stack has been defaulted

HTTP/1.1 201 Created
Content-Type: application/json

{
  "guid": "1cb006ee-fb05-47e1-b541-c34179ddc446",
  "name": "my_app",
  "state": "STOPPED",
  "created_at": "2016-03-17T21:41:30Z",
  "updated_at": "2016-06-08T16:41:26Z",
  "lifecycle": {
    "type": "buildpack",
    "data": {
      "stack": "cflinuxfs4"
    }
  },
  "relationships": {
    "space": {
      "data": {
        "guid": "2f35885d-0c9d-4423-83ad-fd05066f8576"
      }
    }
  }
}

Dev notes

We should basically get rid of this method:

func (d LifecycleData) Validate() error {
return jellidation.ValidateStruct(&d,
jellidation.Field(&d.Stack, jellidation.Required),
)
}

@danail-branekov danail-branekov added bug Something isn't working mta support the MTA controller labels Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mta support the MTA controller
Projects
Status: 🧊 Icebox
Development

No branches or pull requests

1 participant