Documentation ¶
Index ¶
- Constants
- func Version(deploy *appsv1.Deployment) string
- type Agent
- type Client
- type MockClient
- func (m *MockClient) Agent(ctx context.Context) (*Agent, error)
- func (m *MockClient) ClusterRole(ctx context.Context) (*rbacv1.ClusterRole, error)
- func (m *MockClient) ClusterRoleBinding(ctx context.Context) (*rbacv1.ClusterRoleBinding, error)
- func (m *MockClient) DaemonSet(ctx context.Context, name string) (*appsv1.DaemonSet, error)
- func (m *MockClient) Deployment(ctx context.Context, name string) (*appsv1.Deployment, error)
- func (m *MockClient) Namespace(ctx context.Context) (*v1.Namespace, error)
- func (m *MockClient) Pods(ctx context.Context, labelSelector string) (*v1.PodList, error)
- func (m *MockClient) Resources(ctx context.Context) ([]string, error)
- func (m *MockClient) Secret(ctx context.Context) (*v1.Secret, error)
- func (m *MockClient) ServiceAccount(ctx context.Context) (*v1.ServiceAccount, error)
Constants ¶
View Source
const ( // Namespace is the namespace where the Buoyant Cloud agent is installed. Namespace = "buoyant-cloud" // AgentName is the name of the Buoyant Cloud Agent deployment. AgentName = "buoyant-cloud-agent" // MetricsName is the name of the Buoyant Cloud Metrics deployment. MetricsName = "buoyant-cloud-metrics" // VersionLabel is the label key for the agent's version VersionLabel = "app.kubernetes.io/version" )
View Source
const ( // PartOfKey is the label key found on all Buoyant Cloud resources. PartOfKey = "app.kubernetes.io/part-of" // PartOfVal is the label value found on all Buoyant Cloud resources. PartOfVal = "buoyant-cloud" )
Variables ¶
This section is empty.
Functions ¶
func Version ¶
func Version(deploy *appsv1.Deployment) string
Version returns the label value of app.kubernetes.io/version.
Types ¶
type Agent ¶
Agent represents the Buoyant Cloud agent. Any of these fields may not be present, depending on which resources are already on the cluster.
type Client ¶
type Client interface { // Namespace retrieves the buoyant-cloud Namespace. Namespace(ctx context.Context) (*v1.Namespace, error) // ClusterRole retrieves the buoyant-cloud-agent CR. ClusterRole(ctx context.Context) (*rbacv1.ClusterRole, error) // ClusterRoleBinding retrieves the buoyant-cloud-agent CRB. ClusterRoleBinding(ctx context.Context) (*rbacv1.ClusterRoleBinding, error) // Secret retrieves the buoyant-cloud-id Secret. Secret(ctx context.Context) (*v1.Secret, error) // ServiceAccount retrieves the buoyant-cloud-agent ServiceAccount. ServiceAccount(ctx context.Context) (*v1.ServiceAccount, error) // DaemonSet retrieves a DaemonSet by name in the buoyant-cloud namespace. DaemonSet(ctx context.Context, name string) (*appsv1.DaemonSet, error) // Deployment retrieves a Deployment by name in the buoyant-cloud namespace. Deployment(ctx context.Context, name string) (*appsv1.Deployment, error) // Pods retrieves a PodList by labelSelector from the buoyant-cloud // namespace. Pods(ctx context.Context, labelSelector string) (*v1.PodList, error) // Agent retrieves the Buoyant Cloud agent from Kubernetes, and returns the // agent's name, version, and url. If Agent is not found, it will return a // nil Agent with no error. Agent(ctx context.Context) (*Agent, error) // Resources returns all linkerd-buoyant resources required for deletion. // Specifically, these three resource types matching the label // app.kubernetes.io/part-of=buoyant-cloud: // - ClusterRole // - ClusterRoleBinding // - Namespace Resources(ctx context.Context) ([]string, error) }
Client defines the interface for linkerd-buoyant's Kubernetes client
type MockClient ¶
type MockClient struct { MockNamespace *v1.Namespace MockClusterRole *rbacv1.ClusterRole MockClusterRoleBinding *rbacv1.ClusterRoleBinding MockSecret *v1.Secret MockServiceAccount *v1.ServiceAccount MockDaemonSet *appsv1.DaemonSet MockDeployment *appsv1.Deployment MockPods *v1.PodList MockAgent *Agent MockResources []string }
MockClient provides a mock Kubernetes client for testing
func (*MockClient) Agent ¶
func (m *MockClient) Agent(ctx context.Context) (*Agent, error)
Agent returns a mock Buoyant Cloud agent.
func (*MockClient) ClusterRole ¶
func (m *MockClient) ClusterRole(ctx context.Context) (*rbacv1.ClusterRole, error)
ClusterRole returns a mock ClusterRole object.
func (*MockClient) ClusterRoleBinding ¶
func (m *MockClient) ClusterRoleBinding(ctx context.Context) (*rbacv1.ClusterRoleBinding, error)
ClusterRoleBinding returns a mock ClusterRoleBinding object.
func (*MockClient) Deployment ¶
func (m *MockClient) Deployment(ctx context.Context, name string) (*appsv1.Deployment, error)
Deployment returns a mock Deployment object.
func (*MockClient) Resources ¶
func (m *MockClient) Resources(ctx context.Context) ([]string, error)
Resources returns mock Buoyant Cloud agent resources.
func (*MockClient) ServiceAccount ¶
func (m *MockClient) ServiceAccount(ctx context.Context) (*v1.ServiceAccount, error)
ServiceAccount returns a mock ServiceAccount object.
Click to show internal directories.
Click to hide internal directories.