kubeclient
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
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
- func IsNotFoundErr(err error) bool
- func SetRootPathForTesting(p string)
- type Client
- type FakeClient
- func (fc *FakeClient) CheckSecretPermissions(ctx context.Context, name string) (bool, bool, error)
- func (fc *FakeClient) CreateSecret(ctx context.Context, secret *kubeapi.Secret) error
- func (fc *FakeClient) Event(context.Context, string, string, string) error
- func (fc *FakeClient) GetSecret(ctx context.Context, name string) (*kubeapi.Secret, error)
- func (fc *FakeClient) JSONPatchResource(ctx context.Context, resource, name string, patches []JSONPatch) error
- func (fc *FakeClient) ListSecrets(ctx context.Context, selector map[string]string) (*kubeapi.SecretList, error)
- func (fc *FakeClient) SetDialer(dialer func(ctx context.Context, network, addr string) (net.Conn, error))
- func (fc *FakeClient) SetURL(_ string)
- func (fc *FakeClient) StrategicMergePatchSecret(ctx context.Context, name string, s *kubeapi.Secret, fieldManager string) error
- func (fc *FakeClient) UpdateSecret(ctx context.Context, secret *kubeapi.Secret) error
- type JSONPatch
Constants¶
const (TypeSecrets = "secrets")Variables¶
This section is empty.
Functions¶
funcIsNotFoundErr¶
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.
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 (*FakeClient)CreateSecret¶
func (*FakeClient)JSONPatchResource¶added inv1.78.0
func (*FakeClient)ListSecrets¶added inv1.82.0
func (fc *FakeClient) ListSecrets(ctxcontext.Context, selector map[string]string) (*kubeapi.SecretList,error)
func (*FakeClient)SetURL¶
func (fc *FakeClient) SetURL(_string)