Skip to content

Commit

Permalink
fix: create yaml bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mlhiter committed Sep 27, 2024
1 parent 291e33e commit 222c20d
Showing 1 changed file with 40 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,18 @@ const ErrorModal = dynamic(() => import('@/components/modals/ErrorModal'))
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz', 12)

const formData2Yamls = (data: DevboxEditType) => [
{
filename: 'service.yaml',
value: json2Service(data)
},
{
filename: 'devbox.yaml',
value: json2Devbox(data, runtimeNamespaceMap, DEVBOX_AFFINITY_ENABLE, SQUASH_ENABLE)
},
...(data.networks.length > 0
? [
{
filename: 'service.yaml',
value: json2Service(data)
}
]
: []),
...(data.networks.find((item) => item.openPublicDomain)
? [
{
Expand Down Expand Up @@ -128,14 +132,22 @@ const DevboxCreatePage = () => {
filename: 'devbox.yaml',
value: json2Devbox(data, runtimeNamespaceMap, DEVBOX_AFFINITY_ENABLE, SQUASH_ENABLE)
},
{
filename: 'service.yaml',
value: json2Service(data)
},
{
filename: 'ingress.yaml',
value: json2Ingress(data)
}
...(data.networks.length > 0
? [
{
filename: 'service.yaml',
value: json2Service(data)
}
]
: []),
...(data.networks.find((item) => item.openPublicDomain)
? [
{
filename: 'ingress.yaml',
value: json2Ingress(data)
}
]
: [])
]
}

Expand Down Expand Up @@ -175,14 +187,22 @@ const DevboxCreatePage = () => {
SQUASH_ENABLE
)
},
{
filename: 'service.yaml',
value: json2Service(defaultEdit)
},
{
filename: 'ingress.yaml',
value: json2Ingress(defaultEdit)
}
...(defaultEdit.networks.length > 0
? [
{
filename: 'service.yaml',
value: json2Service(defaultEdit)
}
]
: []),
...(defaultEdit.networks.find((item) => item.openPublicDomain)
? [
{
filename: 'ingress.yaml',
value: json2Ingress(defaultEdit)
}
]
: [])
])
return null
}
Expand Down

0 comments on commit 222c20d

Please sign in to comment.