mabumusa1/kub8-api

Create install does not respect sizes

Closed this issue · 2 comments

At the current code base when we want to create, copy, or move an install the creation process does not respect the size of the pod to be created based on the subscription size, this needs to be changed and the YAML must be changed to accommodate the pod size changes.

This is how the request is being interpreted by the system

    id: schema.string({}, [rules.regex(/^[a-z0-9_-]*$/)]),
    env_type: schema.enum(['dev', 'stg', 'prd'] as const),
    size: schema.enum(['s1', 's2', 's3', 's4', 's5', 'custom'] as const),
    domain: schema.string({}, [
      rules.regex(/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/),
    ]),
    region: schema.string.optional(),
    custom: schema.object.optional([rules.requiredWhen('size', '=', 'custom')]).members({
      cpu: schema.number([rules.range(1, 40)]), //TODO: Implement validation for specific type so of CPU
      memory: schema.number([rules.range(1, 32)]), //TODO: Implement validation for specific type of memory
    }),
  })


Solved by #25

Solved by #29