gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

Validate gitpod config patch, rendered gitpod installer YAML in preflight checks

Open adrienthebo opened this issue 2 years ago • 0 comments

The gitpod config patch provides a very low level interface to modify Gitpod's installation configuration. A malformed config patch can produce invalid YAML, or valid YAML that doesn't follow the gitpod-installer config schema.

Malformed configuration should be caught at the preflight check and should ideally provide some level of diagnostics about what's failing and how to fix it.

  • The gitpod config patch file is valid YAML
  • The merge result of the gitpod config patch and the gitpod installer config is valid YAML
  • The final gitpod config YAML follows the gitpod-installer schema (as validated with /app/installer validate)

Steps to reproduce

The following YAML patch will fail on current versions of gitpod:


experimental:
  webapp:
    proxy:
      # allowed values are "ClusterIP", "LoadBalancer", "NodePort", "ExternalName" consistent with https://pkg.go.dev/k8s.io/api/core/v1#ServiceType
      serviceType: "NodePort"
# /app/installer validate config -c config.yaml 
{
  "valid": false,
  "warn": [
    "Deprecated config parameter: experimental.webapp.proxy.serviceType=NodePort"
  ],
  "fatal": [
    "Cannot set proxy service type in both components and experimental"
  ]
}
Error: configuration invalid
Usage:
  gitpod-installer validate config [flags]

adrienthebo avatar Aug 09 '22 22:08 adrienthebo

👋

Un-assigning myself as this is now planned to be done differently with the new installer env abstraction. Happy to take it up in the new path too if you haven't already made progress @MrSimonEmms

Pothulapati avatar Sep 06 '22 14:09 Pothulapati

Thanks @Pothulapati. I've added this to the main refactoring ticket

mrsimonemms avatar Sep 10 '22 20:09 mrsimonemms