diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml index 24483150..2ca8f410 100644 --- a/.github/workflows/kind.yml +++ b/.github/workflows/kind.yml @@ -55,6 +55,7 @@ jobs: - name: Verify deploy/operator.yaml run: | + make generate make generate-operator-yaml git diff --exit-code diff --git a/Makefile b/Makefile index 457437c7..88a165f5 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ KIND_NAME ?= test-$(MANAGED_CLUSTER_NAME) KIND_CLUSTER_NAME ?= kind-$(KIND_NAME) KIND_NAMESPACE ?= $(CONTROLLER_NAMESPACE) # Test coverage threshold -export COVERAGE_MIN ?= 75 +export COVERAGE_MIN ?= 74 COVERAGE_E2E_OUT ?= coverage_e2e.out # Image URL to use all building/pushing image targets; diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 35a60029..84e3e0a9 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -9,16 +9,40 @@ package v1beta1 import ( + "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" + apiv1 "open-cluster-management.io/config-policy-controller/api/v1" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroup) DeepCopyInto(out *OperatorGroup) { + *out = *in + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = make([]TargetNsOrSelector, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroup. +func (in *OperatorGroup) DeepCopy() *OperatorGroup { + if in == nil { + return nil + } + out := new(OperatorGroup) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OperatorPolicy) DeepCopyInto(out *OperatorPolicy) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorPolicy. @@ -74,6 +98,19 @@ func (in *OperatorPolicyList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OperatorPolicySpec) DeepCopyInto(out *OperatorPolicySpec) { *out = *in + if in.OperatorGroup != nil { + in, out := &in.OperatorGroup, &out.OperatorGroup + *out = new(OperatorGroup) + (*in).DeepCopyInto(*out) + } + in.Subscription.DeepCopyInto(&out.Subscription) + if in.Versions != nil { + in, out := &in.Versions, &out.Versions + *out = make([]apiv1.NonEmptyString, len(*in)) + copy(*out, *in) + } + out.RemovalBehavior = in.RemovalBehavior + out.StatusConfig = in.StatusConfig } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorPolicySpec. @@ -89,6 +126,14 @@ func (in *OperatorPolicySpec) DeepCopy() *OperatorPolicySpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OperatorPolicyStatus) DeepCopyInto(out *OperatorPolicyStatus) { *out = *in + if in.Condition != nil { + in, out := &in.Condition, &out.Condition + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.RelatedObject.DeepCopyInto(&out.RelatedObject) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorPolicyStatus. @@ -100,3 +145,74 @@ func (in *OperatorPolicyStatus) DeepCopy() *OperatorPolicyStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RemovalBehavior) DeepCopyInto(out *RemovalBehavior) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemovalBehavior. +func (in *RemovalBehavior) DeepCopy() *RemovalBehavior { + if in == nil { + return nil + } + out := new(RemovalBehavior) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatusConfig) DeepCopyInto(out *StatusConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusConfig. +func (in *StatusConfig) DeepCopy() *StatusConfig { + if in == nil { + return nil + } + out := new(StatusConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionSpec) DeepCopyInto(out *SubscriptionSpec) { + *out = *in + in.SubscriptionSpec.DeepCopyInto(&out.SubscriptionSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionSpec. +func (in *SubscriptionSpec) DeepCopy() *SubscriptionSpec { + if in == nil { + return nil + } + out := new(SubscriptionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetNsOrSelector) DeepCopyInto(out *TargetNsOrSelector) { + *out = *in + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetNsOrSelector. +func (in *TargetNsOrSelector) DeepCopy() *TargetNsOrSelector { + if in == nil { + return nil + } + out := new(TargetNsOrSelector) + in.DeepCopyInto(out) + return out +} diff --git a/build/common/Makefile.common.mk b/build/common/Makefile.common.mk index d59d9a51..d6479c92 100755 --- a/build/common/Makefile.common.mk +++ b/build/common/Makefile.common.mk @@ -74,7 +74,7 @@ fmt-dependencies: fmt: fmt-dependencies find . -not \( -path "./.go" -prune \) -name "*.go" | xargs gofmt -s -w find . -not \( -path "./.go" -prune \) -name "*.go" | xargs gofumpt -l -w - find . -not \( -path "./.go" -prune \) -name "*.go" | xargs gci write -s standard -s default -s "prefix($(shell cat go.mod | head -1 | cut -d " " -f 2))" + find . -not \( -path "./.go" -prune \) -name "*.go" | xargs gci write --skip-generated -s standard -s default -s "prefix($(shell cat go.mod | head -1 | cut -d " " -f 2))" ############################################################ # Unit Test