-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv3.go
29 lines (24 loc) · 815 Bytes
/
v3.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
// Copyright 2020 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package specs
import (
"github.com/juju/errors"
)
// PodSpecV3 defines the data values used to configure
// a pod on the CAAS substrate for version 3.
type PodSpecV3 struct {
podSpecBase `json:",inline" yaml:",inline"`
ServiceAccount *PrimeServiceAccountSpecV3 `json:"serviceAccount,omitempty" yaml:"serviceAccount,omitempty"`
}
// Version3 defines the version number for pod spec version 3.
const Version3 Version = 3
// Validate returns an error if the spec is not valid.
func (spec *PodSpecV3) Validate() error {
if err := spec.podSpecBase.Validate(Version3); err != nil {
return errors.Trace(err)
}
if spec.ServiceAccount != nil {
return errors.Trace(spec.ServiceAccount.Validate())
}
return nil
}