show server version in ark version output using ServerStatusRequest CRD

Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
Steve Kriss
2019-01-23 12:51:13 -07:00
committed by Steve Kriss
parent 5847dcabba
commit 8a58b217be
23 changed files with 1368 additions and 5 deletions
+1
View File
@@ -69,6 +69,7 @@ func CustomResources() map[string]typeInfo {
"ResticRepository": newTypeInfo("resticrepositories", &ResticRepository{}, &ResticRepositoryList{}),
"BackupStorageLocation": newTypeInfo("backupstoragelocations", &BackupStorageLocation{}, &BackupStorageLocationList{}),
"VolumeSnapshotLocation": newTypeInfo("volumesnapshotlocations", &VolumeSnapshotLocation{}, &VolumeSnapshotLocationList{}),
"ServerStatusRequest": newTypeInfo("serverstatusrequests", &ServerStatusRequest{}, &ServerStatusRequestList{}),
}
}
+68
View File
@@ -0,0 +1,68 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 v1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ServerStatusRequest is a request to access current status information about
// the Ark server.
type ServerStatusRequest struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec ServerStatusRequestSpec `json:"spec"`
Status ServerStatusRequestStatus `json:"status,omitempty"`
}
// ServerStatusRequestSpec is the specification for a ServerStatusRequest.
type ServerStatusRequestSpec struct {
}
// ServerStatusRequestPhase represents the lifecycle phase of a ServerStatusRequest.
type ServerStatusRequestPhase string
const (
// ServerStatusRequestPhaseNew means the ServerStatusRequest has not been processed yet.
ServerStatusRequestPhaseNew ServerStatusRequestPhase = "New"
// ServerStatusRequestPhaseProcessed means the ServerStatusRequest has been processed.
ServerStatusRequestPhaseProcessed ServerStatusRequestPhase = "Processed"
)
// ServerStatusRequestStatus is the current status of a ServerStatusRequest.
type ServerStatusRequestStatus struct {
// Phase is the current lifecycle phase of the ServerStatusRequest.
Phase ServerStatusRequestPhase `json:"phase"`
// ProcessedTimestamp is when the ServerStatusRequest was processed
// by the ServerStatusRequestController.
ProcessedTimestamp metav1.Time `json:"processedTimestamp"`
// ServerVersion is the Ark server version.
ServerVersion string `json:"serverVersion"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ServerStatusRequestList is a list of ServerStatusRequests.
type ServerStatusRequestList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ServerStatusRequest `json:"items"`
}
+94
View File
@@ -1235,6 +1235,100 @@ func (in *ScheduleStatus) DeepCopy() *ScheduleStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServerStatusRequest) DeepCopyInto(out *ServerStatusRequest) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerStatusRequest.
func (in *ServerStatusRequest) DeepCopy() *ServerStatusRequest {
if in == nil {
return nil
}
out := new(ServerStatusRequest)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ServerStatusRequest) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServerStatusRequestList) DeepCopyInto(out *ServerStatusRequestList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ServerStatusRequest, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerStatusRequestList.
func (in *ServerStatusRequestList) DeepCopy() *ServerStatusRequestList {
if in == nil {
return nil
}
out := new(ServerStatusRequestList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ServerStatusRequestList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServerStatusRequestSpec) DeepCopyInto(out *ServerStatusRequestSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerStatusRequestSpec.
func (in *ServerStatusRequestSpec) DeepCopy() *ServerStatusRequestSpec {
if in == nil {
return nil
}
out := new(ServerStatusRequestSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServerStatusRequestStatus) DeepCopyInto(out *ServerStatusRequestStatus) {
*out = *in
in.ProcessedTimestamp.DeepCopyInto(&out.ProcessedTimestamp)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerStatusRequestStatus.
func (in *ServerStatusRequestStatus) DeepCopy() *ServerStatusRequestStatus {
if in == nil {
return nil
}
out := new(ServerStatusRequestStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StorageType) DeepCopyInto(out *StorageType) {
*out = *in