feat: remove preheat tag validate with required (#1363)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2022-06-06 15:26:19 +08:00
parent c8ea36186f
commit 866eafe2c7
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
2 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,7 @@ package job
type PreheatRequest struct { type PreheatRequest struct {
URL string `json:"url" validate:"required,url"` URL string `json:"url" validate:"required,url"`
Tag string `json:"tag" validate:"required"` Tag string `json:"tag" validate:"omitempty"`
Digest string `json:"digest" validate:"omitempty"` Digest string `json:"digest" validate:"omitempty"`
Filter string `json:"filter" validate:"omitempty"` Filter string `json:"filter" validate:"omitempty"`
Headers map[string]string `json:"headers" validate:"omitempty"` Headers map[string]string `json:"headers" validate:"omitempty"`

View File

@ -47,11 +47,15 @@ var tracer = otel.Tracer("manager")
type PreheatType string type PreheatType string
const ( const (
// PreheatImageType is image type of preheat job.
PreheatImageType PreheatType = "image" PreheatImageType PreheatType = "image"
// PreheatFileType is file type of preheat job.
PreheatFileType PreheatType = "file" PreheatFileType PreheatType = "file"
) )
const ( const (
// Timeout is the default timeout of http client.
timeout = 1 * time.Minute timeout = 1 * time.Minute
) )