Full ProxySpec/ProxyStatus/Proxy types per the plan: PlacementSpec,
CloudInitSpec, EndpointSpec, HealthCheckSpec, SecretKeySelector, all
defaults, and 7 CEL XValidation rules enforcing mode/provider
immutability, provider/endpoint required-iff-Managed/External, and
cloud-init exactly-one-of inline/secretRef.
Applies the four corrections identified during planning that would
otherwise be silent bugs: MaxLeases as *int32 (so an explicit 0 survives
Go round-trips instead of re-defaulting to 5), HealthCheck's
default={} marker (so nested defaults apply even when the field is
omitted entirely), MinLength=1 on Provider/CloudInit.Inline (so the CEL
has() checks stay simple), and listType=map on Conditions.
Adds pure helpers (EffectivePort, EffectiveHost, HealthCheckOrDefault,
MaxLeasesOrDefault) with table-driven tests, for use by the health
engine, discovery API, and spec-hash computation in later steps.
Patches the scaffolded placeholder controller test's resource literal to
a schema-valid spec so it survives the new CRD validation — the test
itself is rewritten wholesale in Step 4 alongside the real reconciler.
Regenerated deepcopy and the CRD; make test green (envtest confirmed all
7 CEL rules enforced by a real apiserver).
Co-Authored-By: Claude <noreply@anthropic.com>
244 lines
6.6 KiB
Go
244 lines
6.6 KiB
Go
//go:build !ignore_autogenerated
|
|
|
|
/*
|
|
Copyright 2026.
|
|
|
|
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.
|
|
*/
|
|
|
|
// Code generated by controller-gen. DO NOT EDIT.
|
|
|
|
package v1alpha1
|
|
|
|
import (
|
|
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
"k8s.io/apimachinery/pkg/runtime"
|
|
)
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *CloudInitSpec) DeepCopyInto(out *CloudInitSpec) {
|
|
*out = *in
|
|
if in.SecretRef != nil {
|
|
in, out := &in.SecretRef, &out.SecretRef
|
|
*out = new(SecretKeySelector)
|
|
**out = **in
|
|
}
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudInitSpec.
|
|
func (in *CloudInitSpec) DeepCopy() *CloudInitSpec {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(CloudInitSpec)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *EndpointSpec) DeepCopyInto(out *EndpointSpec) {
|
|
*out = *in
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointSpec.
|
|
func (in *EndpointSpec) DeepCopy() *EndpointSpec {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(EndpointSpec)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *HealthCheckSpec) DeepCopyInto(out *HealthCheckSpec) {
|
|
*out = *in
|
|
if in.ExpectedStatusCodes != nil {
|
|
in, out := &in.ExpectedStatusCodes, &out.ExpectedStatusCodes
|
|
*out = make([]int32, len(*in))
|
|
copy(*out, *in)
|
|
}
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckSpec.
|
|
func (in *HealthCheckSpec) DeepCopy() *HealthCheckSpec {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(HealthCheckSpec)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *PlacementSpec) DeepCopyInto(out *PlacementSpec) {
|
|
*out = *in
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementSpec.
|
|
func (in *PlacementSpec) DeepCopy() *PlacementSpec {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(PlacementSpec)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *Proxy) DeepCopyInto(out *Proxy) {
|
|
*out = *in
|
|
out.TypeMeta = in.TypeMeta
|
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
|
in.Spec.DeepCopyInto(&out.Spec)
|
|
in.Status.DeepCopyInto(&out.Status)
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Proxy.
|
|
func (in *Proxy) DeepCopy() *Proxy {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(Proxy)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
func (in *Proxy) 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 *ProxyList) DeepCopyInto(out *ProxyList) {
|
|
*out = *in
|
|
out.TypeMeta = in.TypeMeta
|
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
|
if in.Items != nil {
|
|
in, out := &in.Items, &out.Items
|
|
*out = make([]Proxy, len(*in))
|
|
for i := range *in {
|
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
|
}
|
|
}
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyList.
|
|
func (in *ProxyList) DeepCopy() *ProxyList {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(ProxyList)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
func (in *ProxyList) 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 *ProxySpec) DeepCopyInto(out *ProxySpec) {
|
|
*out = *in
|
|
if in.Placement != nil {
|
|
in, out := &in.Placement, &out.Placement
|
|
*out = new(PlacementSpec)
|
|
**out = **in
|
|
}
|
|
if in.CloudInit != nil {
|
|
in, out := &in.CloudInit, &out.CloudInit
|
|
*out = new(CloudInitSpec)
|
|
(*in).DeepCopyInto(*out)
|
|
}
|
|
if in.Endpoint != nil {
|
|
in, out := &in.Endpoint, &out.Endpoint
|
|
*out = new(EndpointSpec)
|
|
**out = **in
|
|
}
|
|
if in.Attributes != nil {
|
|
in, out := &in.Attributes, &out.Attributes
|
|
*out = make(map[string]string, len(*in))
|
|
for key, val := range *in {
|
|
(*out)[key] = val
|
|
}
|
|
}
|
|
if in.HealthCheck != nil {
|
|
in, out := &in.HealthCheck, &out.HealthCheck
|
|
*out = new(HealthCheckSpec)
|
|
(*in).DeepCopyInto(*out)
|
|
}
|
|
if in.MaxLeases != nil {
|
|
in, out := &in.MaxLeases, &out.MaxLeases
|
|
*out = new(int32)
|
|
**out = **in
|
|
}
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxySpec.
|
|
func (in *ProxySpec) DeepCopy() *ProxySpec {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(ProxySpec)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *ProxyStatus) DeepCopyInto(out *ProxyStatus) {
|
|
*out = *in
|
|
if in.Conditions != nil {
|
|
in, out := &in.Conditions, &out.Conditions
|
|
*out = make([]v1.Condition, len(*in))
|
|
for i := range *in {
|
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
|
}
|
|
}
|
|
if in.LastHealthCheckTime != nil {
|
|
in, out := &in.LastHealthCheckTime, &out.LastHealthCheckTime
|
|
*out = (*in).DeepCopy()
|
|
}
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyStatus.
|
|
func (in *ProxyStatus) DeepCopy() *ProxyStatus {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(ProxyStatus)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector) {
|
|
*out = *in
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeySelector.
|
|
func (in *SecretKeySelector) DeepCopy() *SecretKeySelector {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(SecretKeySelector)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|