2
0
Эх сурвалжийг харах

Merge branch 'nafees/pr-env-validator' into dev

Mohammed Nafees 3 жил өмнө
parent
commit
7df1a08906

+ 5 - 3
cli/cmd/apply.go

@@ -101,10 +101,12 @@ func init() {
 }
 
 func apply(_ *types.GetAuthenticatedUserResponse, client *api.Client, _ []string) error {
-	err := applyValidate()
+	if _, ok := os.LookupEnv("PORTER_VALIDATE_YAML"); ok {
+		err := applyValidate()
 
-	if err != nil {
-		return err
+		if err != nil {
+			return err
+		}
 	}
 
 	fileBytes, err := ioutil.ReadFile(porterYAML)

+ 22 - 12
dashboard/src/main/home/cluster-dashboard/expanded-chart/logs-section/LogsSection.tsx

@@ -193,17 +193,22 @@ const LogsSection: React.FC<Props> = ({
           <span className="line-timestamp">
             {dayjs(log.timestamp).format("MMM D, YYYY HH:mm:ss")}
           </span>
-          {log.line?.map((ansi, j) => {
-            if (ansi.clearLine) {
-              return null;
-            }
-
-            return (
-              <LogSpan key={[log.lineNumber, i, j].join(".")} ansi={ansi}>
-                {ansi.content.replace(/ /g, "\u00a0")}
-              </LogSpan>
-            );
-          })}
+          <LogOuter key={[log.lineNumber, i].join(".")}>
+            {log.line?.map((ansi, j) => {
+              if (ansi.clearLine) {
+                return null;
+              }
+
+              return (
+                <LogInnerSpan
+                  key={[log.lineNumber, i, j].join(".")}
+                  ansi={ansi}
+                >
+                  {ansi.content.replace(/ /g, "\u00a0")}
+                </LogInnerSpan>
+              );
+            })}
+          </LogOuter>
         </Log>
       );
     });
@@ -591,12 +596,17 @@ const Log = styled.div`
   }
 `;
 
-const LogSpan = styled.span`
+const LogOuter = styled.div`
   display: inline-block;
   word-wrap: anywhere;
   flex-grow: 1;
   font-family: monospace, sans-serif;
   font-size: 12px;
+`;
+
+const LogInnerSpan = styled.span`
+  font-family: monospace, sans-serif;
+  font-size: 12px;
   font-weight: ${(props: { ansi: Anser.AnserJsonEntry }) =>
     props.ansi?.decoration && props.ansi?.decoration == "bold" ? "700" : "400"};
   color: ${(props: { ansi: Anser.AnserJsonEntry }) =>

+ 13 - 8
internal/integrations/preview/driver_validators.go

@@ -66,10 +66,7 @@ func deployDriverValidator(resource *types.Resource) error {
 			return fmt.Errorf("for resource '%s': build method must be one of 'docker', 'pack', or 'registry'", resource.Name)
 		}
 
-		if appConfig.Build.Method == "docker" && appConfig.Build.Dockerfile == "" {
-			return fmt.Errorf("for resource '%s': dockerfile cannot be empty when using the 'docker' build method",
-				resource.Name)
-		} else if appConfig.Build.Method == "registry" {
+		if appConfig.Build.Method == "registry" {
 			if appConfig.Build.Image == "" {
 				return fmt.Errorf("for resource '%s': image cannot be empty when using the 'registry' build method",
 					resource.Name)
@@ -123,6 +120,17 @@ func deployDriverValidator(resource *types.Resource) error {
 				}
 			}
 		}
+	} else if source.Repo == "https://chart-addons.getporter.dev" {
+		if len(resource.Config) > 0 {
+			if source.Name == "postgresql" {
+				err := validatePostgresChartValues(resource.Config)
+
+				if err != nil {
+					return fmt.Errorf("for resource '%s': error validating values for postgresql deployment: %w",
+						resource.Name, err)
+				}
+			}
+		}
 	}
 
 	return nil
@@ -166,10 +174,7 @@ func buildImageDriverValidator(resource *types.Resource) error {
 		return fmt.Errorf("for resource '%s': build method must be one of 'docker', 'pack', or 'registry'", resource.Name)
 	}
 
-	if driverConfig.Build.Method == "docker" && driverConfig.Build.Dockerfile == "" {
-		return fmt.Errorf("for resource '%s': dockerfile cannot be empty when using the 'docker' build method",
-			resource.Name)
-	} else if driverConfig.Build.Method == "registry" {
+	if driverConfig.Build.Method == "registry" {
 		if driverConfig.Build.Image == "" {
 			return fmt.Errorf("for resource '%s': image cannot be empty when using the 'registry' build method",
 				resource.Name)

+ 0 - 201
internal/integrations/preview/embed/deploy_driver.schema.json.unused

@@ -1,201 +0,0 @@
-{
-  "$schema": "http://json-schema.org/schema#",
-  "title": "schema for the default deploy driver",
-  "type": "object",
-  "properties": {
-    "name": {
-      "type": "string",
-      "description": "resource name",
-      "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
-      "maxLength": 50
-    },
-    "driver": {
-      "type": "string",
-      "description": "resource driver",
-      "enum": ["deploy", ""]
-    },
-    "depends_on": {
-      "type": "array",
-      "description": "list of resource names this resource depends on",
-      "minItems": 1,
-      "items": {
-        "type": "string",
-        "description": "dependency resource name",
-        "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
-        "maxLength": 50
-      }
-    },
-    "source": {
-      "type": "object",
-      "description": "resource source",
-      "properties": {
-        "name": {
-          "type": "string",
-          "description": "source Helm chart name"
-        },
-        "version": {
-          "type": "string",
-          "description": "source Helm chart version"
-        },
-        "repo": {
-          "type": "string",
-          "description": "source Helm chart repo URL",
-          "default": "https://charts.getporter.dev"
-        }
-      },
-      "required": ["name"]
-    },
-    "target": {
-      "type": "object",
-      "description": "resource target",
-      "properties": {
-        "project": {
-          "type": "integer",
-          "description": "target Porter project ID"
-        },
-        "cluster": {
-          "type": "integer",
-          "description": "target Porter cluster ID"
-        },
-        "namespace": {
-          "type": "string",
-          "description": "target namespace"
-        }
-      }
-    },
-    "config": {
-      "type": "object",
-      "description": "resource configuration",
-      "additionalProperties": true
-    },
-    "if": {
-      "properties": {
-        "source": {
-          "properties": { "repo": { "const": "https://charts.getporter.dev" } }
-        }
-      }
-    },
-    "then": {
-      "properties": {
-        "config": {
-          "properties": {
-            "waitForJob": {
-              "type": "boolean",
-              "description": "wait for job to complete"
-            },
-            "onlyCreate": {
-              "type": "boolean",
-              "description": "only create the resource"
-            },
-            "build": {
-              "type": "object",
-              "description": "build configuration",
-              "properties": {
-                "use_cache": {
-                  "type": "boolean",
-                  "description": "use Porter build cache"
-                },
-                "method": {
-                  "type": "string",
-                  "description": "build method",
-                  "default": "docker",
-                  "enum": ["docker", "pack", "registry"]
-                },
-                "context": {
-                  "type": "string",
-                  "description": "build context"
-                },
-                "dockerfile": {
-                  "type": "string",
-                  "description": "Dockerfile path"
-                },
-                "image": {
-                  "type": "string",
-                  "description": "image name"
-                },
-                "builder": {
-                  "type": "string",
-                  "description": "buildpacks builder image"
-                },
-                "buildpacks": {
-                  "type": "array",
-                  "description": "list of buildpacks",
-                  "minItems": 1,
-                  "items": {
-                    "type": "string",
-                    "description": "buildpack"
-                  }
-                },
-                "env": {
-                  "type": "object",
-                  "description": "build-time environment variables",
-                  "additionalProperties": { "type": "string" }
-                }
-              },
-              "allOf": [
-                {
-                  "if": {
-                    "properties": {
-                      "method": { "const": "docker" }
-                    }
-                  },
-                  "then": {
-                    "dependentRequired": {
-                      "method": ["dockerfile"]
-                    }
-                  }
-                },
-                {
-                  "if": {
-                    "properties": {
-                      "method": { "const": "registry" }
-                    }
-                  },
-                  "then": {
-                    "dependentRequired": {
-                      "method": ["image"]
-                    }
-                  }
-                }
-              ]
-            },
-            "env_groups": {
-              "type": "array",
-              "description": "list of environment groups to use in the deployment",
-              "minItems": 1,
-              "items": {
-                "type": "object",
-                "description": "environment group",
-                "properties": {
-                  "name": {
-                    "type": "string",
-                    "description": "environment group name"
-                  },
-                  "version": {
-                    "type": "integer",
-                    "minimum": 0,
-                    "default": 0,
-                    "description": "environment group version"
-                  },
-                  "namespace": {
-                    "type": "string",
-                    "description": "environment group namespace"
-                  }
-                },
-                "required": ["name"]
-              }
-            },
-            "values": {
-              "type": "object",
-              "description": "Helm values to use for the deployment",
-              "additionalProperties": true
-            }
-          },
-          "required": ["build"]
-        }
-      },
-      "required": ["config"]
-    }
-  },
-  "required": ["name", "source"]
-}

+ 0 - 73
internal/integrations/preview/embed/job.values.schema.json

@@ -1,73 +0,0 @@
-{
-  "$schema": "http://json-schema.org/schema#",
-  "type": "object",
-  "properties": {
-    "replicaCount": {
-      "type": "integer",
-      "minimum": 1,
-      "default": 1
-    },
-    "container": {
-      "type": "object",
-      "properties": {
-        "port": {
-          "type": "integer",
-          "default": 80
-        },
-        "command": {
-          "type": "string"
-        },
-        "env": {
-          "type": "object",
-          "properties": {
-            "normal": {
-              "type": "object",
-              "additionalProperties": {
-                "type": "string"
-              }
-            }
-          }
-        }
-      }
-    },
-    "schedule": {
-      "type": "object",
-      "properties": {
-        "enabled": {
-          "type": "boolean",
-          "default": false
-        },
-        "value": {
-          "type": "string",
-          "default": "*/5 * * * *"
-        },
-        "successfulHistory": {
-          "type": "integer",
-          "default": 20
-        },
-        "failedHistory": {
-          "type": "integer",
-          "default": 20
-        }
-      }
-    },
-    "resources": {
-      "type": "object",
-      "properties": {
-        "requests": {
-          "type": "object",
-          "properties": {
-            "cpu": {
-              "type": "string",
-              "pattern": "^\\d+(m){0,1}$"
-            },
-            "memory": {
-              "type": "string",
-              "pattern": "^\\d+(Ki|Mi|Gi)$"
-            }
-          }
-        }
-      }
-    }
-  }
-}

+ 0 - 90
internal/integrations/preview/embed/porteryaml.schema.json.unused

@@ -1,90 +0,0 @@
-{
-  "$schema": "http://json-schema.org/schema#",
-  "type": "object",
-  "properties": {
-    "version": {
-      "type": "string",
-      "description": "porter.yaml version",
-      "pattern": "^v[1-9][0-9]*$"
-    },
-    "resources": {
-      "type": "array",
-      "description": "list of resources",
-      "minItems": 1,
-      "items": {
-        "type": "object",
-        "properties": {
-          "name": {
-            "type": "string",
-            "description": "resource name",
-            "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
-            "maxLength": 50
-          },
-          "driver": {
-            "type": "string",
-            "description": "resource driver"
-          },
-          "depends_on": {
-            "type": "array",
-            "description": "list of resource names this resource depends on",
-            "minItems": 1,
-            "items": {
-              "type": "string",
-              "description": "dependency resource name",
-              "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
-              "maxLength": 50
-            }
-          },
-          "source": {
-            "type": "object",
-            "description": "resource source",
-            "properties": {
-              "name": {
-                "type": "string",
-                "description": "source Helm chart name"
-              },
-              "version": {
-                "type": "string",
-                "description": "source Helm chart version"
-              },
-              "repo": {
-                "type": "string",
-                "description": "source Helm chart repo URL"
-              }
-            }
-          },
-          "target": {
-            "type": "object",
-            "description": "resource target",
-            "properties": {
-              "project": {
-                "type": "integer",
-                "description": "target Porter project ID"
-              },
-              "cluster": {
-                "type": "integer",
-                "description": "target Porter cluster ID"
-              },
-              "namespace": {
-                "type": "string",
-                "description": "target namespace"
-              },
-              "app_name": {
-                "type": "string",
-                "description": "target app name",
-                "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
-                "maxLength": 50
-              }
-            }
-          },
-          "config": {
-            "type": "object",
-            "description": "resource config"
-          }
-        },
-        "required": ["name"]
-      }
-    }
-  },
-  "required": ["version", "resources"]
-}

+ 0 - 289
internal/integrations/preview/embed/web.values.schema.json

@@ -1,289 +0,0 @@
-{
-  "$schema": "http://json-schema.org/schema#",
-  "type": "object",
-  "properties": {
-    "replicaCount": {
-      "type": "integer",
-      "minimum": 1,
-      "default": 1
-    },
-    "ingress": {
-      "type": "object",
-      "properties": {
-        "enabled": {
-          "type": "boolean",
-          "default": true
-        },
-        "hosts": {
-          "type": "array",
-          "items": {
-            "type": "string"
-          }
-        },
-        "porter_hosts": {
-          "type": "array",
-          "items": {
-            "type": "string"
-          }
-        },
-        "provider": {
-          "type": "string"
-        },
-        "custom_domain": {
-          "type": "boolean",
-          "default": false
-        },
-        "custom_paths": {
-          "type": "string"
-        },
-        "rewriteCustomPathsEnabled": {
-          "type": "boolean",
-          "default": true
-        },
-        "annotations": {
-          "type": "object",
-          "additionalProperties": {
-            "type": "string"
-          }
-        },
-        "wildcard": {
-          "type": "boolean",
-          "default": false
-        },
-        "tls": {
-          "type": "boolean",
-          "default": true
-        },
-        "useDefaultIngressTLSSecret": {
-          "type": "boolean",
-          "default": false
-        }
-      }
-    },
-    "container": {
-      "type": "object",
-      "properties": {
-        "port": {
-          "type": "integer",
-          "default": 80
-        },
-        "command": {
-          "type": "string"
-        },
-        "args": {
-          "type": "array",
-          "items": {
-            "type": "string"
-          }
-        },
-        "env": {
-          "type": "object",
-          "properties": {
-            "normal": {
-              "type": "object",
-              "additionalProperties": {
-                "type": "string"
-              }
-            }
-          }
-        }
-      }
-    },
-    "resources": {
-      "type": "object",
-      "properties": {
-        "requests": {
-          "type": "object",
-          "properties": {
-            "cpu": {
-              "type": "string",
-              "pattern": "^\\d+(m){0,1}$"
-            },
-            "memory": {
-              "type": "string",
-              "pattern": "^\\d+(Ki|Mi|Gi)$"
-            }
-          }
-        }
-      }
-    },
-    "autoscaling": {
-      "type": "object",
-      "properties": {
-        "enabled": {
-          "type": "boolean",
-          "default": false
-        },
-        "minReplicas": {
-          "type": "integer",
-          "default": 1
-        },
-        "maxReplicas": {
-          "type": "integer",
-          "default": 10
-        },
-        "targetCPUUtilizationPercentage": {
-          "type": "integer",
-          "default": 50
-        },
-        "targetMemoryUtilizationPercentage": {
-          "type": "integer",
-          "default": 50
-        }
-      }
-    },
-    "health": {
-      "type": "object",
-      "properties": {
-        "livenessProbe": {
-          "type": "object",
-          "properties": {
-            "enabled": {
-              "type": "boolean",
-              "default": false
-            },
-            "path": {
-              "type": "string",
-              "default": "/livez"
-            },
-            "scheme": {
-              "type": "string",
-              "default": "HTTP"
-            },
-            "initialDelaySeconds": {
-              "type": "integer",
-              "default": 0
-            },
-            "periodSeconds": {
-              "type": "integer",
-              "default": 5
-            },
-            "timeoutSeconds": {
-              "type": "integer",
-              "default": 1
-            },
-            "successThreshold": {
-              "type": "integer",
-              "default": 1
-            },
-            "failureThreshold": {
-              "type": "integer",
-              "default": 3
-            },
-            "auth": {
-              "type": "object",
-              "properties": {
-                "enabled": {
-                  "type": "boolean",
-                  "default": false
-                },
-                "username": {
-                  "type": "string"
-                },
-                "password": {
-                  "type": "string"
-                }
-              }
-            }
-          }
-        },
-        "readinessProbe": {
-          "type": "object",
-          "properties": {
-            "enabled": {
-              "type": "boolean",
-              "default": false
-            },
-            "path": {
-              "type": "string",
-              "default": "/readyz"
-            },
-            "scheme": {
-              "type": "string",
-              "default": "HTTP"
-            },
-            "initialDelaySeconds": {
-              "type": "integer",
-              "default": 0
-            },
-            "periodSeconds": {
-              "type": "integer",
-              "default": 5
-            },
-            "timeoutSeconds": {
-              "type": "integer",
-              "default": 1
-            },
-            "successThreshold": {
-              "type": "integer",
-              "default": 1
-            },
-            "failureThreshold": {
-              "type": "integer",
-              "default": 3
-            },
-            "auth": {
-              "type": "object",
-              "properties": {
-                "enabled": {
-                  "type": "boolean",
-                  "default": false
-                },
-                "username": {
-                  "type": "string"
-                },
-                "password": {
-                  "type": "string"
-                }
-              }
-            }
-          }
-        },
-        "startupProbe": {
-          "type": "object",
-          "properties": {
-            "enabled": {
-              "type": "boolean",
-              "default": false
-            },
-            "path": {
-              "type": "string",
-              "default": "/startupz"
-            },
-            "scheme": {
-              "type": "string",
-              "default": "HTTP"
-            },
-            "failureThreshold": {
-              "type": "integer",
-              "default": 3
-            },
-            "periodSeconds": {
-              "type": "integer",
-              "default": 5
-            },
-            "timeoutSeconds": {
-              "type": "integer",
-              "default": 1
-            },
-            "auth": {
-              "type": "object",
-              "properties": {
-                "enabled": {
-                  "type": "boolean",
-                  "default": false
-                },
-                "username": {
-                  "type": "string"
-                },
-                "password": {
-                  "type": "string"
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-}

+ 0 - 136
internal/integrations/preview/embed/worker.values.schema.json

@@ -1,136 +0,0 @@
-{
-  "$schema": "http://json-schema.org/schema#",
-  "type": "object",
-  "properties": {
-    "replicaCount": {
-      "type": "integer",
-      "minimum": 1,
-      "default": 1
-    },
-    "container": {
-      "type": "object",
-      "properties": {
-        "port": {
-          "type": "integer",
-          "default": 80
-        },
-        "command": {
-          "type": "string"
-        },
-        "env": {
-          "type": "object",
-          "properties": {
-            "normal": {
-              "type": "object",
-              "additionalProperties": {
-                "type": "string"
-              }
-            }
-          }
-        }
-      }
-    },
-    "autoscaling": {
-      "type": "object",
-      "properties": {
-        "enabled": {
-          "type": "boolean",
-          "default": false
-        },
-        "minReplicas": {
-          "type": "integer",
-          "default": 1
-        },
-        "maxReplicas": {
-          "type": "integer",
-          "default": 10
-        },
-        "targetCPUUtilizationPercentage": {
-          "type": "integer",
-          "default": 50
-        },
-        "targetMemoryUtilizationPercentage": {
-          "type": "integer",
-          "default": 50
-        }
-      }
-    },
-    "health": {
-      "type": "object",
-      "properties": {
-        "enabled": {
-          "type": "boolean",
-          "default": false
-        },
-        "command": {
-          "type": "string",
-          "default": "ls -l"
-        },
-        "periodSeconds": {
-          "type": "integer",
-          "default": 5
-        },
-        "failureThreshold": {
-          "type": "integer",
-          "default": 3
-        },
-        "readinessProbe": {
-          "type": "object",
-          "properties": {
-            "enabled": {
-              "type": "boolean",
-              "default": false
-            },
-            "command": {
-              "type": "string",
-              "default": "ls -l"
-            },
-            "periodSeconds": {
-              "type": "integer",
-              "default": 5
-            }
-          }
-        },
-        "startupProbe": {
-          "type": "object",
-          "properties": {
-            "enabled": {
-              "type": "boolean",
-              "default": false
-            },
-            "command": {
-              "type": "string",
-              "default": "ls -l"
-            },
-            "failureThreshold": {
-              "type": "integer",
-              "default": 3
-            },
-            "periodSeconds": {
-              "type": "integer",
-              "default": 5
-            }
-          }
-        }
-      }
-    },
-    "resources": {
-      "type": "object",
-      "properties": {
-        "requests": {
-          "type": "object",
-          "properties": {
-            "cpu": {
-              "type": "string",
-              "pattern": "^\\d+(m){0,1}$"
-            },
-            "memory": {
-              "type": "string",
-              "pattern": "^\\d+(Ki|Mi|Gi)$"
-            }
-          }
-        }
-      }
-    }
-  }
-}

+ 31 - 18
internal/integrations/preview/schema_validate.go

@@ -5,19 +5,16 @@ import (
 	"fmt"
 
 	"github.com/santhosh-tekuri/jsonschema/v5"
+	_ "github.com/santhosh-tekuri/jsonschema/v5/httploader"
 )
 
 func validateWebChartValues(values map[string]interface{}) error {
-	webValuesSchema, err := schemas.ReadFile("embed/web.values.schema.json")
+	compiler := jsonschema.NewCompiler()
 
-	if err != nil {
-		return fmt.Errorf("error reading web chart values schema: %w", err)
-	}
-
-	scm, err := jsonschema.CompileString("web.values.schema.json", string(webValuesSchema))
+	scm, err := compiler.Compile("https://raw.githubusercontent.com/porter-dev/porter-charts/master/applications/web/values.schema.json")
 
 	if err != nil {
-		return fmt.Errorf("error compiling web chart values schema: %w", err)
+		return fmt.Errorf("error compiling job chart values schema: %w", err)
 	}
 
 	jsonBytes, err := json.Marshal(values)
@@ -36,16 +33,12 @@ func validateWebChartValues(values map[string]interface{}) error {
 }
 
 func validateWorkerChartValues(values map[string]interface{}) error {
-	workerValuesSchema, err := schemas.ReadFile("embed/worker.values.schema.json")
-
-	if err != nil {
-		return fmt.Errorf("error reading worker chart values schema: %w", err)
-	}
+	compiler := jsonschema.NewCompiler()
 
-	scm, err := jsonschema.CompileString("worker.values.schema.json", string(workerValuesSchema))
+	scm, err := compiler.Compile("https://raw.githubusercontent.com/porter-dev/porter-charts/master/applications/worker/values.schema.json")
 
 	if err != nil {
-		return fmt.Errorf("error compiling worker chart values schema: %w", err)
+		return fmt.Errorf("error compiling job chart values schema: %w", err)
 	}
 
 	jsonBytes, err := json.Marshal(values)
@@ -64,16 +57,36 @@ func validateWorkerChartValues(values map[string]interface{}) error {
 }
 
 func validateJobChartValues(values map[string]interface{}) error {
-	jobValuesSchema, err := schemas.ReadFile("embed/job.values.schema.json")
+	compiler := jsonschema.NewCompiler()
+
+	scm, err := compiler.Compile("https://raw.githubusercontent.com/porter-dev/porter-charts/master/applications/job/values.schema.json")
 
 	if err != nil {
-		return fmt.Errorf("error reading job chart values schema: %w", err)
+		return fmt.Errorf("error compiling job chart values schema: %w", err)
 	}
 
-	scm, err := jsonschema.CompileString("job.values.schema.json", string(jobValuesSchema))
+	jsonBytes, err := json.Marshal(values)
 
 	if err != nil {
-		return fmt.Errorf("error compiling job chart values schema: %w", err)
+		return fmt.Errorf("error marshalling values to JSON: %w", err)
+	}
+
+	var v interface{}
+
+	if err := json.Unmarshal(jsonBytes, &v); err != nil {
+		return fmt.Errorf("error unmarshalling values JSON to interface: %w", err)
+	}
+
+	return scm.Validate(v)
+}
+
+func validatePostgresChartValues(values map[string]interface{}) error {
+	compiler := jsonschema.NewCompiler()
+
+	scm, err := compiler.Compile("https://raw.githubusercontent.com/porter-dev/porter-charts/master/addons/postgresql/values.schema.json")
+
+	if err != nil {
+		return fmt.Errorf("error compiling postgres chart values schema: %w", err)
 	}
 
 	jsonBytes, err := json.Marshal(values)

+ 0 - 4
internal/integrations/preview/validate.go

@@ -1,7 +1,6 @@
 package preview
 
 import (
-	"embed"
 	"errors"
 	"fmt"
 
@@ -10,9 +9,6 @@ import (
 	"k8s.io/apimachinery/pkg/util/validation"
 )
 
-//go:embed embed/*.schema.json
-var schemas embed.FS
-
 var (
 	ErrNoPorterYAMLFile    = errors.New("porter.yaml does not exist in the root of this repository")
 	ErrEmptyPorterYAMLFile = errors.New("porter.yaml is empty")