/
util.go
41 lines (37 loc) · 980 Bytes
/
util.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2020 the Drone Authors. All rights reserved.
// Use of this source code is governed by the Blue Oak Model License
// that can be found in the LICENSE file.
package plugin
import (
"fmt"
)
func verifyArgs(args Args) error {
if args.ModelName == "" {
return fmt.Errorf("missing model name")
}
if args.ExecutionRoleArn == "" {
return fmt.Errorf("missing execution role arn")
}
if args.ImageURL == "" {
return fmt.Errorf("missing image url")
}
if args.ModelDataUrl == "" {
return fmt.Errorf("missing model data url")
}
if args.EndpointConfigName == "" {
return fmt.Errorf("missing endpoint config name")
}
if args.EndpointName == "" {
return fmt.Errorf("missing endpoint name")
}
if args.InstanceType == "" {
return fmt.Errorf("missing instance type")
}
if args.InitialInstanceCount == 0 {
return fmt.Errorf("missing initial instance count")
}
if args.VariantName == "" {
return fmt.Errorf("missing variant name")
}
return nil
}