Movatterモバイル変換


[0]ホーム

URL:


kubeclient

package
v1.92.2Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:19Imported by:2

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package kubeclient provides a client to interact with Kubernetes.This package is Tailscale-internal and not meant for external consumption.Further, the API should not be considered stable.Client is split into a separate package for consumption ofnon-Kubernetes shared libraries and binaries. Be mindful of not increasingdependency size for those consumers when adding anything new here.

Index

Constants

View Source
const (TypeSecrets = "secrets")

Variables

This section is empty.

Functions

funcIsNotFoundErr

func IsNotFoundErr(errerror)bool

funcSetRootPathForTesting

func SetRootPathForTesting(pstring)

SetRootPathForTesting sets the path to the service account directory.

Types

typeClient

type Client interface {GetSecret(context.Context,string) (*kubeapi.Secret,error)ListSecrets(context.Context, map[string]string) (*kubeapi.SecretList,error)UpdateSecret(context.Context, *kubeapi.Secret)errorCreateSecret(context.Context, *kubeapi.Secret)error// Event attempts to ensure an event with the specified options associated with the Pod in which we are// currently running. This is best effort - if the client is not able to create events, this operation will be a// no-op. If there is already an Event with the given reason for the current Pod, it will get updated (only// count and timestamp are expected to change), else a new event will be created.Event(_context.Context, typ, reason, msgstring)errorStrategicMergePatchSecret(context.Context,string, *kubeapi.Secret,string)errorJSONPatchResource(_context.Context, resourceNamestring, resourceTypestring, patches []JSONPatch)errorCheckSecretPermissions(context.Context,string) (bool,bool,error)SetDialer(dialer func(context.Context,string,string) (net.Conn,error))SetURL(string)}

Client handles connections to Kubernetes.It expects to be run inside a cluster.

funcNew

func New(namestring) (Client,error)

New returns a new client

typeFakeClient

type FakeClient struct {GetSecretImpl                 func(context.Context,string) (*kubeapi.Secret,error)CheckSecretPermissionsImpl    func(ctxcontext.Context, namestring) (bool,bool,error)CreateSecretImpl              func(context.Context, *kubeapi.Secret)errorUpdateSecretImpl              func(context.Context, *kubeapi.Secret)errorJSONPatchResourceImpl         func(context.Context,string,string, []JSONPatch)errorListSecretsImpl               func(context.Context, map[string]string) (*kubeapi.SecretList,error)StrategicMergePatchSecretImpl func(context.Context,string, *kubeapi.Secret,string)error}

func (*FakeClient)CheckSecretPermissions

func (fc *FakeClient) CheckSecretPermissions(ctxcontext.Context, namestring) (bool,bool,error)

func (*FakeClient)CreateSecret

func (fc *FakeClient) CreateSecret(ctxcontext.Context, secret *kubeapi.Secret)error

func (*FakeClient)Eventadded inv1.78.0

func (*FakeClient)GetSecret

func (fc *FakeClient) GetSecret(ctxcontext.Context, namestring) (*kubeapi.Secret,error)

func (*FakeClient)JSONPatchResourceadded inv1.78.0

func (fc *FakeClient) JSONPatchResource(ctxcontext.Context, resource, namestring, patches []JSONPatch)error

func (*FakeClient)ListSecretsadded inv1.82.0

func (fc *FakeClient) ListSecrets(ctxcontext.Context, selector map[string]string) (*kubeapi.SecretList,error)

func (*FakeClient)SetDialer

func (fc *FakeClient) SetDialer(dialer func(ctxcontext.Context, network, addrstring) (net.Conn,error))

func (*FakeClient)SetURL

func (fc *FakeClient) SetURL(_string)

func (*FakeClient)StrategicMergePatchSecret

func (fc *FakeClient) StrategicMergePatchSecret(ctxcontext.Context, namestring, s *kubeapi.Secret, fieldManagerstring)error

func (*FakeClient)UpdateSecret

func (fc *FakeClient) UpdateSecret(ctxcontext.Context, secret *kubeapi.Secret)error

typeJSONPatch

type JSONPatch struct {Opstring `json:"op"`Pathstring `json:"path"`Valueany    `json:"value,omitempty"`}

JSONPatch is a JSON patch operation.It currently (2024-11-15) only supports "add", "remove" and "replace" operations.

https://tools.ietf.org/html/rfc6902

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp