Wire the fourth mandated §23 metric to a real producer. The histogram spans two reconcile passes, so anchor and observation must persist in status: - Add status.startRequestedAt, set once on the first Starting reconcile of a start attempt and cleared on Stopped so the next start re-anchors. - Observe felis_start_duration_seconds exactly when readiness is first reached (ReadySignalAt - StartRequestedAt), guarded so a server that reaches ready without a Starting pass records nothing. - Mirror the field into the deepcopy and the structural CRD schema so the apiserver does not prune it on patchStatus round-trips. - Promote prometheus/client_golang and client_model to direct deps now that the operator and its tests import them. Tests drive a step clock through Starting -> Running asserting the exact observed duration, and through Running -> Stopped asserting the metric is observed once and the anchor clears.
139 lines
3.3 KiB
Go
139 lines
3.3 KiB
Go
//go:build !ignore_autogenerated
|
|
|
|
// Code in this file is hand-written to the same contract controller-gen would
|
|
// emit (DeepCopyInto/DeepCopy/DeepCopyObject) so the package needs no codegen
|
|
// toolchain to compile and satisfy runtime.Object.
|
|
|
|
package v1alpha1
|
|
|
|
import (
|
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
|
)
|
|
|
|
// DeepCopyInto copies the receiver into out.
|
|
func (in *MinecraftServer) DeepCopyInto(out *MinecraftServer) {
|
|
*out = *in
|
|
out.TypeMeta = in.TypeMeta
|
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
|
in.Spec.DeepCopyInto(&out.Spec)
|
|
in.Status.DeepCopyInto(&out.Status)
|
|
}
|
|
|
|
// DeepCopy returns a deep copy of the receiver.
|
|
func (in *MinecraftServer) DeepCopy() *MinecraftServer {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(MinecraftServer)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyObject implements runtime.Object.
|
|
func (in *MinecraftServer) DeepCopyObject() runtime.Object {
|
|
if c := in.DeepCopy(); c != nil {
|
|
return c
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// DeepCopyInto copies the receiver into out.
|
|
func (in *MinecraftServerList) DeepCopyInto(out *MinecraftServerList) {
|
|
*out = *in
|
|
out.TypeMeta = in.TypeMeta
|
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
|
if in.Items != nil {
|
|
l := make([]MinecraftServer, len(in.Items))
|
|
for i := range in.Items {
|
|
in.Items[i].DeepCopyInto(&l[i])
|
|
}
|
|
out.Items = l
|
|
}
|
|
}
|
|
|
|
// DeepCopy returns a deep copy of the receiver.
|
|
func (in *MinecraftServerList) DeepCopy() *MinecraftServerList {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(MinecraftServerList)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyObject implements runtime.Object.
|
|
func (in *MinecraftServerList) DeepCopyObject() runtime.Object {
|
|
if c := in.DeepCopy(); c != nil {
|
|
return c
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// DeepCopyInto copies the receiver into out.
|
|
func (in *MinecraftServerSpec) DeepCopyInto(out *MinecraftServerSpec) {
|
|
*out = *in
|
|
if in.JavaFlags != nil {
|
|
l := make([]string, len(in.JavaFlags))
|
|
copy(l, in.JavaFlags)
|
|
out.JavaFlags = l
|
|
}
|
|
if in.Args != nil {
|
|
l := make([]string, len(in.Args))
|
|
copy(l, in.Args)
|
|
out.Args = l
|
|
}
|
|
if in.Env != nil {
|
|
l := make([]EnvVar, len(in.Env))
|
|
copy(l, in.Env)
|
|
out.Env = l
|
|
}
|
|
out.Motd = in.Motd
|
|
out.Rcon = in.Rcon
|
|
out.Storage = in.Storage
|
|
in.Resources.DeepCopyInto(&out.Resources)
|
|
out.Lifecycle = in.Lifecycle
|
|
out.Startup = in.Startup
|
|
out.Idle = in.Idle
|
|
}
|
|
|
|
// DeepCopy returns a deep copy of the receiver.
|
|
func (in *MinecraftServerSpec) DeepCopy() *MinecraftServerSpec {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(MinecraftServerSpec)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto copies the receiver into out.
|
|
func (in *MinecraftServerStatus) DeepCopyInto(out *MinecraftServerStatus) {
|
|
*out = *in
|
|
out.Endpoint = in.Endpoint
|
|
out.Players = in.Players
|
|
if in.ReadySignalAt != nil {
|
|
out.ReadySignalAt = in.ReadySignalAt.DeepCopy()
|
|
}
|
|
if in.StartRequestedAt != nil {
|
|
out.StartRequestedAt = in.StartRequestedAt.DeepCopy()
|
|
}
|
|
if in.Conditions != nil {
|
|
l := make([]metav1.Condition, len(in.Conditions))
|
|
for i := range in.Conditions {
|
|
in.Conditions[i].DeepCopyInto(&l[i])
|
|
}
|
|
out.Conditions = l
|
|
}
|
|
}
|
|
|
|
// DeepCopy returns a deep copy of the receiver.
|
|
func (in *MinecraftServerStatus) DeepCopy() *MinecraftServerStatus {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(MinecraftServerStatus)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|