Documentation
¶
Index ¶
Constants ¶
const APIServerClusterName = "cluster"
APIServerClusterName is the singleton apiserver.config.openshift.io object.
Variables ¶
var DefaultCurvePreferences = []tls.CurveID{ tls.X25519, tls.CurveP256, tls.CurveP384, tls.CurveP521, }
DefaultCurvePreferences is the explicit key-exchange curve order for TLS clients (and can be reused for servers) when the cluster TLS profile API does not yet expose curve preferences.
Functions ¶
func ClientTLSConfig ¶
ClientTLSConfig returns a tls.Config for outbound HTTPS/TLS clients, or nil if no cluster TLS profile is configured. rootCAs, if non-nil, is used to verify the remote server's certificate chain.
func GetOperandTLSArgs ¶
func GetOperandTLSArgs() []string
GetOperandTLSArgs returns the --tls-min-version/--tls-ciphers args for the honored cluster TLS profile, or nil if none is configured.
func ServerTLSConfig ¶
ServerTLSConfig returns a tls.Config for serving HTTPS/TLS, or nil if no cluster TLS profile is configured. clientCAs, if non-nil, is used to verify client certificates presented during the handshake (mTLS).
func SetTLSConfig ¶
func SetTLSConfig(spec *configv1.TLSProfileSpec) error
SetTLSConfig resolves spec into the cached TLS settings and the operand --tls-min-version/--tls-ciphers args derived from them. A nil spec clears the cache: ClientTLSConfig/ServerTLSConfig/GetOperandTLSArgs then report nothing configured.
Callers decide whether the profile should be honored at all using github.com/openshift/library-go/pkg/crypto.ShouldHonorClusterTLSProfile before calling this with a non-nil spec.
Types ¶
type FetchAPIServerFunc ¶
FetchAPIServerFunc retrieves apiserver.config.openshift.io/cluster.
func NewClientReaderAPIServerFetch ¶
func NewClientReaderAPIServerFetch(r ObjectGetter) FetchAPIServerFunc
NewClientReaderAPIServerFetch returns a controller-runtime fetcher for the cluster APIServer.
type ObjectGetter ¶
type ObjectGetter interface {
Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
}
ObjectGetter is the Get subset used to fetch APIServer.
func NewClientReaderObjectGetter ¶
func NewClientReaderObjectGetter(r client.Reader) ObjectGetter
NewClientReaderObjectGetter adapts a controller-runtime client.Reader to the ObjectGetter interface.