-
Notifications
You must be signed in to change notification settings - Fork 18
/
managedosversionchannel_types.go
76 lines (63 loc) · 2.6 KB
/
managedosversionchannel_types.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
Copyright © 2022 - 2024 SUSE LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
upgradev1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
type ManagedOSVersionChannel struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ManagedOSVersionChannelSpec `json:"spec,omitempty"`
Status ManagedOSVersionChannelStatus `json:"status,omitempty"`
}
type ManagedOSVersionChannelSpec struct {
// +optional
Type string `json:"type,omitempty"`
// +optional
// +kubebuilder:default:="1h"
SyncInterval string `json:"syncInterval,omitempty"`
// +kubebuilder:validation:Schemaless
// +kubebuilder:validation:XPreserveUnknownFields
// +optional
Options map[string]runtime.RawExtension `json:"options,omitempty"`
// +optional
UpgradeContainer *upgradev1.ContainerSpec `json:"upgradeContainer,omitempty"`
}
type ManagedOSVersionChannelStatus struct {
// Conditions describe the state of the managed OS version object.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
// LastSyncedTime is the timestamp of the last synchronization
// +optional
LastSyncedTime *metav1.Time `json:"lastSyncedTime,omitempty"`
// FailedSynchronizationAttempts counts the number of consecutive synchronization failures
// +optional
FailedSynchronizationAttempts int `json:"failedSynchronizationAttempts,omitempty"`
// SyncedGeneration tracks the spec generation of the last synchronization
// +optional
SyncedGeneration int64 `json:"syncedGeneration,omitempty"`
}
// +kubebuilder:object:root=true
// ManagedOSVersionChannelList contains a list of ManagedOSVersionChannels.
type ManagedOSVersionChannelList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ManagedOSVersionChannel `json:"items"`
}
func init() {
SchemeBuilder.Register(&ManagedOSVersionChannel{}, &ManagedOSVersionChannelList{})
}