Documentation ¶
Index ¶
- Constants
- Variables
- func APIFilterContextMultiplex(path string) func(meta schema.ClientMeta) []schema.ClientMeta
- func Configure(logger hclog.Logger, config interface{}) (schema.ClientMeta, diag.Diagnostics)
- func ContextMultiplex(meta schema.ClientMeta) []schema.ClientMeta
- func DeleteContextFilter(meta schema.ClientMeta, _ *schema.Resource) []interface{}
- func ErrorClassifier(_ schema.ClientMeta, resourceName string, err error) diag.Diagnostics
- func IgnoreForbiddenNotFound(err error) bool
- func K8sMockTestHelper(t *testing.T, table *schema.Table, ...)
- func K8sTestHelper(t *testing.T, table *schema.Table, snapshotDirPath string)
- func OwnerReferenceResolver(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, ...) error
- func ResolveContext(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error
- type Client
- type Config
- type CronJobsClient
- type DaemonSetsClient
- type DeploymentsClient
- type EndpointsClient
- type JobsClient
- type LimitRangesClient
- type NamespacesClient
- type NetworkPoliciesClient
- type NodesClient
- type OwnerReferences
- type PodsClient
- type ReplicaSetsClient
- type ResourceQuotasClient
- type RoleBindingsClient
- type RolesClient
- type ServiceAccountsClient
- type Services
- type ServicesClient
- type StatefulSetsClient
- type TestOptions
Constants ¶
View Source
const ( ContextFieldName = "context" ContextFieldDesc = "Name of the context from k8s configuration." )
Variables ¶
View Source
var CommonContextField = schema.Column{ Name: ContextFieldName, Description: ContextFieldDesc, Type: schema.TypeString, Resolver: ResolveContext, }
Functions ¶
func APIFilterContextMultiplex ¶
func APIFilterContextMultiplex(path string) func(meta schema.ClientMeta) []schema.ClientMeta
APIFilterContextMultiplex returns a list of clients for each context from the cq config
func Configure ¶
func Configure(logger hclog.Logger, config interface{}) (schema.ClientMeta, diag.Diagnostics)
func ContextMultiplex ¶
func ContextMultiplex(meta schema.ClientMeta) []schema.ClientMeta
ContextMultiplex returns a list of clients for each context from the cq config
func DeleteContextFilter ¶
func DeleteContextFilter(meta schema.ClientMeta, _ *schema.Resource) []interface{}
DeleteContextFilter returns a delete filter that cleans up the data belonging to the k8s context.
func ErrorClassifier ¶
func ErrorClassifier(_ schema.ClientMeta, resourceName string, err error) diag.Diagnostics
func IgnoreForbiddenNotFound ¶
func K8sMockTestHelper ¶
func K8sMockTestHelper(t *testing.T, table *schema.Table, builder func(*testing.T, *gomock.Controller) Services, options TestOptions)
func OwnerReferenceResolver ¶
Types ¶
type Client ¶
type Client struct { Log hclog.Logger Context string // contains filtered or unexported fields }
func (*Client) SetServices ¶
func (Client) WithContext ¶
type CronJobsClient ¶
type CronJobsClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*batchv1.CronJobList, error)
}
type DaemonSetsClient ¶
type DaemonSetsClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*appsv1.DaemonSetList, error)
}
type DeploymentsClient ¶
type DeploymentsClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*appsv1.DeploymentList, error)
}
type EndpointsClient ¶
type EndpointsClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*corev1.EndpointsList, error)
}
type JobsClient ¶
type LimitRangesClient ¶
type LimitRangesClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*corev1.LimitRangeList, error)
}
type NamespacesClient ¶
type NamespacesClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error)
}
type NetworkPoliciesClient ¶
type NetworkPoliciesClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.NetworkPolicyList, error)
}
type NodesClient ¶
type OwnerReferences ¶
type OwnerReferences struct { ResourceUID types.UID v1.OwnerReference }
type PodsClient ¶
type ReplicaSetsClient ¶
type ReplicaSetsClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*appsv1.ReplicaSetList, error)
}
type ResourceQuotasClient ¶
type ResourceQuotasClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*corev1.ResourceQuotaList, error)
}
type RoleBindingsClient ¶
type RoleBindingsClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.RoleBindingList, error)
}
type RolesClient ¶
type ServiceAccountsClient ¶
type ServiceAccountsClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceAccountList, error)
}
type Services ¶
type Services struct { Client *kubernetes.Clientset CronJobs CronJobsClient DaemonSets DaemonSetsClient Deployments DeploymentsClient Endpoints EndpointsClient Jobs JobsClient LimitRanges LimitRangesClient Namespaces NamespacesClient NetworkPolicies NetworkPoliciesClient Nodes NodesClient Pods PodsClient ReplicaSets ReplicaSetsClient ResourceQuotas ResourceQuotasClient RoleBindings RoleBindingsClient Roles RolesClient ServiceAccounts ServiceAccountsClient Services ServicesClient StatefulSets StatefulSetsClient }
type ServicesClient ¶
type ServicesClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceList, error)
}
type StatefulSetsClient ¶
type StatefulSetsClient interface {
List(ctx context.Context, opts metav1.ListOptions) (*appsv1.StatefulSetList, error)
}
type TestOptions ¶
type TestOptions struct {
SkipEmptyJsonB bool
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.