Skip to content

Commit 6c73c06

Browse files
fix: skip volume fields for serverless templates, add tests field to hub release
- serverless template creation via REST fails because the api rejects volumeInGb on serverless templates even when set to 0; skip sending volume fields when --serverless is set - include tests field in hub release get response so agents can use the pre-built test payloads to call deployed endpoints
1 parent 1910767 commit 6c73c06

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

cmd/template/create.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ func runCreate(cmd *cobra.Command, args []string) error {
6262
ImageName: createImageName,
6363
IsServerless: createIsServerless,
6464
ContainerDiskInGb: createContainerDiskInGb,
65-
VolumeInGb: createVolumeInGb,
66-
VolumeMountPath: createVolumeMountPath,
6765
Readme: createReadme,
6866
}
6967

68+
// serverless templates do not support volume fields
69+
if !createIsServerless {
70+
req.VolumeInGb = createVolumeInGb
71+
req.VolumeMountPath = createVolumeMountPath
72+
}
73+
7074
if createPorts != "" {
7175
req.Ports = strings.Split(createPorts, ",")
7276
}

internal/api/hub.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type HubRelease struct {
4545
ReleasedAt string `json:"releasedAt"`
4646
UpdatedAt string `json:"updatedAt"`
4747
Build *GitBuild `json:"build,omitempty"`
48+
Tests string `json:"tests,omitempty"`
4849
}
4950

5051
// GitBuild represents a build from a hub release
@@ -210,6 +211,7 @@ const listingFullFields = `
210211
build {
211212
imageName
212213
}
214+
tests
213215
}
214216
`
215217

0 commit comments

Comments
 (0)