client

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDClient

type CRDClient interface {
	// EnsureCreated ensures a CRD exists and is ready
	Ensure(ctx context.Context, crd v1.CustomResourceDefinition) error

	// Delete removes a CRD if it exists
	Delete(ctx context.Context, name string) error

	// Get retrieves a CRD by name
	Get(ctx context.Context, name string) (*v1.CustomResourceDefinition, error)
}

CRDClient represents operations for managing CustomResourceDefinitions

type CRDWrapper

type CRDWrapper struct {
	// contains filtered or unexported fields
}

CRDWrapper provides a simplified interface for CRD operations

func (*CRDWrapper) Delete

func (w *CRDWrapper) Delete(ctx context.Context, name string) error

Delete removes a CRD if it exists

func (*CRDWrapper) Ensure

Ensure ensures a CRD exists, up-to-date, and is ready. This can be a dangerous operation as it will update the CRD if it already exists.

The caller is responsible for ensuring the CRD, isn't introducing breaking changes.

func (*CRDWrapper) Get

Get retrieves a CRD by name

type CRDWrapperConfig

type CRDWrapperConfig struct {
	Client       *apiextensionsv1.ApiextensionsV1Client
	Log          logr.Logger
	PollInterval time.Duration
	Timeout      time.Duration
}

CRDWrapperConfig contains configuration for the CRD wrapper

func DefaultCRDWrapperConfig

func DefaultCRDWrapperConfig() CRDWrapperConfig

DefaultConfig returns a CRDWrapperConfig with default values

type Config

type Config struct {
	RestConfig      *rest.Config
	ImpersonateUser string
	QPS             float32
	Burst           int
}

Config holds configuration for client creation

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set provides a unified interface for different Kubernetes clients

func NewSet

func NewSet(cfg Config) (*Set, error)

NewSet creates a new client Set with the given config

func (*Set) APIExtensionsV1

func (c *Set) APIExtensionsV1() *apiextensionsv1.ApiextensionsV1Client

APIExtensionsV1 returns the API extensions client

func (*Set) CRD

func (s *Set) CRD(cfg CRDWrapperConfig) *CRDWrapper

CRD returns a new CRDWrapper instance

func (*Set) Dynamic

func (c *Set) Dynamic() *dynamic.DynamicClient

Dynamic returns the dynamic client

func (*Set) Kubernetes

func (c *Set) Kubernetes() *kubernetes.Clientset

Kubernetes returns the standard Kubernetes clientset

func (*Set) RESTConfig

func (c *Set) RESTConfig() *rest.Config

RESTConfig returns a copy of the underlying REST config

func (*Set) WithImpersonation

func (c *Set) WithImpersonation(user string) (*Set, error)

WithImpersonation returns a new client that impersonates the given user

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL