mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: Bump sigs.k8s.io/controller-runtime
Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.15.1-0.20230524200249-30eae58f1b98 to 0.15.1. - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/commits/v0.15.1) --- updated-dependencies: - dependency-name: sigs.k8s.io/controller-runtime dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
874d0bcf4b
commit
6ca8550ba1
5
vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go
generated
vendored
5
vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go
generated
vendored
@ -236,6 +236,11 @@ func New(config *rest.Config, opts Options) (Cache, error) {
|
||||
}
|
||||
|
||||
func defaultOpts(config *rest.Config, opts Options) (Options, error) {
|
||||
config = rest.CopyConfig(config)
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
logger := log.WithName("setup")
|
||||
|
||||
// Use the rest HTTP client for the provided config if unset
|
||||
|
8
vendor/sigs.k8s.io/controller-runtime/pkg/client/client.go
generated
vendored
8
vendor/sigs.k8s.io/controller-runtime/pkg/client/client.go
generated
vendored
@ -110,6 +110,11 @@ func newClient(config *rest.Config, options Options) (*client, error) {
|
||||
return nil, fmt.Errorf("must provide non-nil rest.Config to client.New")
|
||||
}
|
||||
|
||||
config = rest.CopyConfig(config)
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
if !options.WarningHandler.SuppressWarnings {
|
||||
// surface warnings
|
||||
logger := log.Log.WithName("KubeAPIWarningLogger")
|
||||
@ -117,7 +122,6 @@ func newClient(config *rest.Config, options Options) (*client, error) {
|
||||
// is log.KubeAPIWarningLogger with deduplication enabled.
|
||||
// See log.KubeAPIWarningLoggerOptions for considerations
|
||||
// regarding deduplication.
|
||||
config = rest.CopyConfig(config)
|
||||
config.WarningHandler = log.NewKubeAPIWarningLogger(
|
||||
logger,
|
||||
log.KubeAPIWarningLoggerOptions{
|
||||
@ -160,7 +164,7 @@ func newClient(config *rest.Config, options Options) (*client, error) {
|
||||
unstructuredResourceByType: make(map[schema.GroupVersionKind]*resourceMeta),
|
||||
}
|
||||
|
||||
rawMetaClient, err := metadata.NewForConfigAndClient(config, options.HTTPClient)
|
||||
rawMetaClient, err := metadata.NewForConfigAndClient(metadata.ConfigFor(config), options.HTTPClient)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to construct metadata-only client for use as part of client: %w", err)
|
||||
}
|
||||
|
20
vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go
generated
vendored
20
vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go
generated
vendored
@ -513,8 +513,15 @@ type MatchingLabels map[string]string
|
||||
// ApplyToList applies this configuration to the given list options.
|
||||
func (m MatchingLabels) ApplyToList(opts *ListOptions) {
|
||||
// TODO(directxman12): can we avoid reserializing this over and over?
|
||||
sel := labels.SelectorFromValidatedSet(map[string]string(m))
|
||||
opts.LabelSelector = sel
|
||||
if opts.LabelSelector == nil {
|
||||
opts.LabelSelector = labels.NewSelector()
|
||||
}
|
||||
// If there's already a selector, we need to AND the two together.
|
||||
noValidSel := labels.SelectorFromValidatedSet(map[string]string(m))
|
||||
reqs, _ := noValidSel.Requirements()
|
||||
for _, req := range reqs {
|
||||
opts.LabelSelector = opts.LabelSelector.Add(req)
|
||||
}
|
||||
}
|
||||
|
||||
// ApplyToDeleteAllOf applies this configuration to the given an List options.
|
||||
@ -528,14 +535,17 @@ type HasLabels []string
|
||||
|
||||
// ApplyToList applies this configuration to the given list options.
|
||||
func (m HasLabels) ApplyToList(opts *ListOptions) {
|
||||
sel := labels.NewSelector()
|
||||
if opts.LabelSelector == nil {
|
||||
opts.LabelSelector = labels.NewSelector()
|
||||
}
|
||||
// TODO: ignore invalid labels will result in an empty selector.
|
||||
// This is inconsistent to the that of MatchingLabels.
|
||||
for _, label := range m {
|
||||
r, err := labels.NewRequirement(label, selection.Exists, nil)
|
||||
if err == nil {
|
||||
sel = sel.Add(*r)
|
||||
opts.LabelSelector = opts.LabelSelector.Add(*r)
|
||||
}
|
||||
}
|
||||
opts.LabelSelector = sel
|
||||
}
|
||||
|
||||
// ApplyToDeleteAllOf applies this configuration to the given an List options.
|
||||
|
9
vendor/sigs.k8s.io/controller-runtime/pkg/cluster/cluster.go
generated
vendored
9
vendor/sigs.k8s.io/controller-runtime/pkg/cluster/cluster.go
generated
vendored
@ -179,6 +179,13 @@ func New(config *rest.Config, opts ...Option) (Cluster, error) {
|
||||
return nil, errors.New("must specify Config")
|
||||
}
|
||||
|
||||
originalConfig := config
|
||||
|
||||
config = rest.CopyConfig(config)
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
options := Options{}
|
||||
for _, opt := range opts {
|
||||
opt(&options)
|
||||
@ -275,7 +282,7 @@ func New(config *rest.Config, opts ...Option) (Cluster, error) {
|
||||
}
|
||||
|
||||
return &cluster{
|
||||
config: config,
|
||||
config: originalConfig,
|
||||
httpClient: options.HTTPClient,
|
||||
scheme: options.Scheme,
|
||||
cache: cache,
|
||||
|
9
vendor/sigs.k8s.io/controller-runtime/pkg/manager/manager.go
generated
vendored
9
vendor/sigs.k8s.io/controller-runtime/pkg/manager/manager.go
generated
vendored
@ -19,6 +19,7 @@ package manager
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -391,6 +392,9 @@ type LeaderElectionRunnable interface {
|
||||
|
||||
// New returns a new Manager for creating Controllers.
|
||||
func New(config *rest.Config, options Options) (Manager, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("must specify Config")
|
||||
}
|
||||
// Set default values for options fields
|
||||
options = setOptionsDefaults(options)
|
||||
|
||||
@ -412,6 +416,11 @@ func New(config *rest.Config, options Options) (Manager, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
config = rest.CopyConfig(config)
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
// Create the recorder provider to inject event recorders for the components.
|
||||
// TODO(directxman12): the log for the event provider should have a context (name, tags, etc) specific
|
||||
// to the particular controller that it's being injected into, rather than a generic one like is here.
|
||||
|
Reference in New Issue
Block a user