File tree 4 files changed +8
-7
lines changed
4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,9 @@ type ISO struct {
17
17
Description string
18
18
Type ISOType
19
19
Architecture * Architecture
20
- Deprecated time.Time
21
- }
22
-
23
- // IsDeprecated returns true if the ISO is deprecated.
24
- func (iso * ISO ) IsDeprecated () bool {
25
- return ! iso .Deprecated .IsZero ()
20
+ // Deprecated: Use [ISO.Deprecation] instead.
21
+ Deprecated time.Time
22
+ DeprecatableResource
26
23
}
27
24
28
25
// ISOType specifies the type of an ISO image.
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ func TestISOIsDeprecated(t *testing.T) {
20
20
21
21
t .Run ("deprecated" , func (t * testing.T ) {
22
22
iso := & ISO {
23
- Deprecated : time .Now (),
23
+ DeprecatableResource : DeprecatableResource { Deprecation : & DeprecationInfo { Announced : time .Now ()}} ,
24
24
}
25
25
if ! iso .IsDeprecated () {
26
26
t .Errorf ("unexpected value for IsDeprecated: %v" , iso .IsDeprecated ())
Original file line number Diff line number Diff line change @@ -124,6 +124,9 @@ func ISOFromSchema(s schema.ISO) *ISO {
124
124
Description : s .Description ,
125
125
Type : ISOType (s .Type ),
126
126
Deprecated : s .Deprecated ,
127
+ DeprecatableResource : DeprecatableResource {
128
+ DeprecationFromSchema (s .Deprecation ),
129
+ },
127
130
}
128
131
if s .Architecture != nil {
129
132
iso .Architecture = Ptr (Architecture (* s .Architecture ))
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ type ISO struct {
10
10
Type string `json:"type"`
11
11
Architecture * string `json:"architecture"`
12
12
Deprecated time.Time `json:"deprecated"`
13
+ DeprecatableResource
13
14
}
14
15
15
16
// ISOGetResponse defines the schema of the response when retrieving a single ISO.
You can’t perform that action at this time.
0 commit comments