Skip to content

Commit

Permalink
Merge pull request crossplane#4124 from jbw976/cc-depr-note
Browse files Browse the repository at this point in the history
Clarify ControllerConfig deprecation message to reduce confusion
  • Loading branch information
jbw976 authored Jun 7, 2023
2 parents d95414e + c0f03f9 commit 2994bb9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apis/pkg/v1alpha1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ type PodObjectMeta struct {
// https://github.com/crossplane/crossplane/issues/3601 for more information.
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:deprecatedversion:warning="This API is deprecated and is scheduled to be removed in a future release."
// +kubebuilder:deprecatedversion:warning="ControllerConfig.pkg.crossplane.io/v1alpha1 has been deprecated and will be removed in a future release, but only after a comparable alternative is available."
type ControllerConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
5 changes: 3 additions & 2 deletions cluster/crds/pkg.crossplane.io_controllerconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ spec:
name: AGE
type: date
deprecated: true
deprecationWarning: This API is deprecated and is scheduled to be removed in a
future release.
deprecationWarning: ControllerConfig.pkg.crossplane.io/v1alpha1 has been deprecated
and will be removed in a future release, but only after a comparable alternative
is available.
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down
7 changes: 7 additions & 0 deletions cmd/crossplane/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ package core
import (
"net/http"
"net/http/pprof"
"os"
"path/filepath"
"time"

"github.com/alecthomas/kong"
"github.com/google/go-containerregistry/pkg/name"
"github.com/spf13/afero"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/leaderelection/resourcelock"
ctrl "sigs.k8s.io/controller-runtime"

Expand Down Expand Up @@ -136,6 +138,11 @@ func (c *startCommand) Run(s *runtime.Scheme, log logging.Logger) error { //noli
return errors.Wrap(err, "Cannot get config")
}

cfg.WarningHandler = rest.NewWarningWriter(os.Stderr, rest.WarningWriterOptions{
// Warnings from API requests should be deduplicated so they are only logged once
Deduplicate: true,
})

mgr, err := ctrl.NewManager(ratelimiter.LimitRESTConfig(cfg, c.MaxReconcileRate), ctrl.Options{
Scheme: s,
SyncPeriod: &c.SyncInterval,
Expand Down
2 changes: 1 addition & 1 deletion contributing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ make
./cluster/local/kind.sh help

# Start a new kind cluster. Specifying KUBE_IMAGE is optional.
KUBE_IMAGE=kindest/node:v1.23.0 ./cluster/local/kind.sh up
KUBE_IMAGE=kindest/node:v1.27.1 ./cluster/local/kind.sh up

# Use Helm to deploy the local build of Crossplane.
./cluster/local/kind.sh helm-install
Expand Down

0 comments on commit 2994bb9

Please sign in to comment.