bba0f3a230
This change updates our clients to always set an owner ref when: 1. The operation is a create 2. The object does not already have an owner ref set Signed-off-by: Monis Khan <mok@vmware.com>
26 lines
541 B
Go
26 lines
541 B
Go
// Copyright 2021 the Pinniped contributors. All Rights Reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package kubeclient
|
|
|
|
import restclient "k8s.io/client-go/rest"
|
|
|
|
type Option func(*clientConfig)
|
|
|
|
type clientConfig struct {
|
|
config *restclient.Config
|
|
middlewares []Middleware
|
|
}
|
|
|
|
func WithConfig(config *restclient.Config) Option {
|
|
return func(c *clientConfig) {
|
|
c.config = config
|
|
}
|
|
}
|
|
|
|
func WithMiddleware(middleware Middleware) Option {
|
|
return func(c *clientConfig) {
|
|
c.middlewares = append(c.middlewares, middleware)
|
|
}
|
|
}
|