diff --git a/Dockerfile b/Dockerfile index 783257f6..a2f613e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,6 @@ WORKDIR / COPY --from=builder /workspace/controller . COPY LICENSE README.md SECURITY.md /licenses/ -USER nonroot:nonroot +USER 65532:65532 ENTRYPOINT ["/controller"] diff --git a/apis/core/v1alpha2/zz_generated.deepcopy.go b/apis/core/v1alpha2/zz_generated.deepcopy.go index 88e7c47f..d8abbb38 100644 --- a/apis/core/v1alpha2/zz_generated.deepcopy.go +++ b/apis/core/v1alpha2/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/controller/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go b/pkg/controller/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go index ede02629..2e08d2bf 100644 --- a/pkg/controller/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go +++ b/pkg/controller/v1alpha2/core/traits/manualscalertrait/manualscalertrait_controller.go @@ -198,9 +198,11 @@ func (r *Reconciler) scaleResources(ctx context.Context, mLog logr.Logger, } // locateReplicaField call openapi RESTFUL end point to fetch the schema of a given resource and try to see -// if it has a spec.replicas filed that is of type integer. We will apply duck typing to modify the fields there -// assuming that the fields is used to control the number of instances of this resource -// NOTE: This only works if the resource CRD has a structural schema, all `apiextensions.k8s.io/v1` CRDs do +// +// if it has a spec.replicas filed that is of type integer. We will apply duck typing to modify the fields there +// assuming that the fields is used to control the number of instances of this resource +// NOTE: This only works if the resource CRD has a structural schema, all `apiextensions.k8s.io/v1` CRDs do +// // https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#specifying-a-structural-schema func locateReplicaField(document openapi.Resources, res *unstructured.Unstructured) bool { // this is the most common path for replicas fields diff --git a/pkg/webhook/v1alpha2/component/validating_handler.go b/pkg/webhook/v1alpha2/component/validating_handler.go index 69fb17d8..f52dca8a 100644 --- a/pkg/webhook/v1alpha2/component/validating_handler.go +++ b/pkg/webhook/v1alpha2/component/validating_handler.go @@ -107,6 +107,7 @@ func ValidateComponentObject(obj *v1alpha2.Component) field.ErrorList { var _ inject.Client = &ValidatingHandler{} // InjectClient injects the client into the ComponentValidatingHandler + func (h *ValidatingHandler) InjectClient(c client.Client) error { h.Client = c return nil