fix(ci): support current QuickStack app write contract
This commit is contained in:
@@ -23,7 +23,7 @@ const APP_FIELDS = [
|
||||
"securityContextRunAsGroup", "securityContextFsGroup", "securityContextPrivileged",
|
||||
"gitUrl", "gitBranch", "gitUsername", "gitToken", "dockerfilePath", "replicas",
|
||||
"envVars", "memoryReservation", "memoryLimit", "cpuReservation", "cpuLimit",
|
||||
"webhookId", "ingressNetworkPolicy", "egressNetworkPolicy", "useNetworkPolicy",
|
||||
"webhookId", "useNetworkPolicy",
|
||||
"healthChechHttpGetPath", "healthCheckHttpScheme", "healthCheckHttpHeadersJson",
|
||||
"healthCheckHttpPort", "healthCheckPeriodSeconds", "healthCheckTimeoutSeconds",
|
||||
"healthCheckFailureThreshold", "healthCheckTcpPort",
|
||||
@@ -31,7 +31,6 @@ const APP_FIELDS = [
|
||||
|
||||
const COLLECTION_FIELDS = {
|
||||
appDomains: ["id", "hostname", "port", "useSsl", "redirectHttps"],
|
||||
appPorts: ["id", "port"],
|
||||
appNodePorts: ["id", "port", "nodePort", "protocol"],
|
||||
appFileMounts: ["id", "containerMountPath", "content"],
|
||||
appVolumes: [
|
||||
@@ -58,6 +57,11 @@ export function toSavePayload(app) {
|
||||
for (const [name, fields] of Object.entries(COLLECTION_FIELDS)) {
|
||||
payload[name] = Array.isArray(app[name]) ? app[name].map((item) => pick(item, fields)) : [];
|
||||
}
|
||||
payload.appNetworkPolicy = app.appNetworkPolicy ? {
|
||||
...pick(app.appNetworkPolicy, ["id", "allowInternetAccess"]),
|
||||
rules: app.appNetworkPolicy.rules.map((rule) =>
|
||||
pick(rule, ["id", "type", "targetAppId", "targetAgentId", "port", "protocol"])),
|
||||
} : null;
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user