Make reviewable

Signed-off-by: Christian Artin <cartin@genetec.com>
This commit is contained in:
Christian Artin 2025-01-17 17:07:08 -05:00
parent b979fc43fe
commit 4ed417c837
4 changed files with 49 additions and 5 deletions

View File

@ -16,11 +16,14 @@ limitations under the License.
package v1
import "k8s.io/apimachinery/pkg/runtime"
// See https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
// A Status reflects the observed status of a resource.
type Status map[string]interface{}
type Status map[string]runtime.RawExtension
// A Statused resource is one that has a status.
type Statused struct {
Status Status `json:"status"`
}

View File

@ -541,6 +541,49 @@ func (in *Selector) DeepCopy() *Selector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in Status) DeepCopyInto(out *Status) {
{
in := &in
*out = make(Status, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.
func (in Status) DeepCopy() Status {
if in == nil {
return nil
}
out := new(Status)
in.DeepCopyInto(out)
return *out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Statused) DeepCopyInto(out *Statused) {
*out = *in
if in.Status != nil {
in, out := &in.Status, &out.Status
*out = make(Status, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Statused.
func (in *Statused) DeepCopy() *Statused {
if in == nil {
return nil
}
out := new(Statused)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TargetSpec) DeepCopyInto(out *TargetSpec) {
*out = *in

View File

@ -21,7 +21,6 @@ package fake
import (
"encoding/json"
"reflect"
"github.com/go-logr/logr"

View File

@ -89,17 +89,16 @@ func (cr *Unstructured) SetConditions(c ...xpv1.Condition) {
_ = fieldpath.Pave(cr.Object).SetValue("status.conditions", conditioned.Conditions)
}
// GetCondition of this Composed resource.
// GetStatus of this Composed resource.
func (cr *Unstructured) GetStatus() xpv1.Status {
status := xpv1.Statused{}
// The path is directly `status` because conditions are inline.
if err := fieldpath.Pave(cr.Object).GetValueInto("status", &status); err != nil {
return xpv1.Status{}
}
return status.Status
}
// SetConditions of this Composed resource.
// SetStatus of this Composed resource.
func (cr *Unstructured) SetStatus(s xpv1.Status) {
_ = fieldpath.Pave(cr.Object).SetValue("status", s)
}