Documentation
¶
Index ¶
- Variables
- func PolicyDir(namespace, policyName string) string
- func PolicyYAMLSetMode(data []byte, mode string) ([]byte, error)
- func TpLongname(tp TracingPolicy) string
- type GenericTracingPolicy
- type GenericTracingPolicyNamespaced
- func (gtp *GenericTracingPolicyNamespaced) GetObjectMetaStruct() *metav1.ObjectMeta
- func (gtp *GenericTracingPolicyNamespaced) TpInfo() string
- func (gtp *GenericTracingPolicyNamespaced) TpName() string
- func (gtp *GenericTracingPolicyNamespaced) TpNamespace() string
- func (gtp *GenericTracingPolicyNamespaced) TpSpec() *v1alpha1.TracingPolicySpec
- type ObjectMeta
- type PolicyEvent
- type PolicyInfo
- type TracingPolicy
- type TypeMeta
- type Unstructured
Constants ¶
This section is empty.
Variables ¶
var ( TPContext *crdutils.CRDContext[*GenericTracingPolicy] TPNContext *crdutils.CRDContext[*GenericTracingPolicyNamespaced] )
Functions ¶
func PolicyDir ¶ added in v1.4.0
PolicyDir returns the directory of the policy in tetragon's bpf fs hierearchy
func PolicyYAMLSetMode ¶ added in v1.4.0
PolicyYAMLSetMode modifies a yaml file to set the mode of the policy
func TpLongname ¶ added in v1.5.0
func TpLongname(tp TracingPolicy) string
TpLongname returns a long name of a tracing policy: name if the policy is not namespaced, or namespace/name if it is
Types ¶
type GenericTracingPolicy ¶ added in v0.10.0
type GenericTracingPolicy struct {
TypeMeta
Metadata ObjectMeta `json:"metadata"`
Spec v1alpha1.TracingPolicySpec `json:"spec"`
}
GenericTracingPolicy represents TracingPolicy CRD. It implements TracingPolicy and CRDObject interfaces with pointer receivers.
func (*GenericTracingPolicy) GetObjectMetaStruct ¶ added in v1.4.0
func (gtp *GenericTracingPolicy) GetObjectMetaStruct() *metav1.ObjectMeta
func (*GenericTracingPolicy) TpInfo ¶ added in v0.10.0
func (gtp *GenericTracingPolicy) TpInfo() string
func (*GenericTracingPolicy) TpName ¶ added in v0.10.0
func (gtp *GenericTracingPolicy) TpName() string
func (*GenericTracingPolicy) TpNamespace ¶ added in v1.7.0
func (gtp *GenericTracingPolicy) TpNamespace() string
func (*GenericTracingPolicy) TpSpec ¶ added in v0.10.0
func (gtp *GenericTracingPolicy) TpSpec() *v1alpha1.TracingPolicySpec
type GenericTracingPolicyNamespaced ¶ added in v0.10.0
type GenericTracingPolicyNamespaced struct {
metav1.TypeMeta
Metadata metav1.ObjectMeta `json:"metadata"`
Spec v1alpha1.TracingPolicySpec `json:"spec"`
}
GenericTracingPolicyNamespaced represents TracingPolicyNamespaced CRD. It implements TracingPolicy and CRDObject interfaces with pointer receivers.
func (*GenericTracingPolicyNamespaced) GetObjectMetaStruct ¶ added in v1.4.0
func (gtp *GenericTracingPolicyNamespaced) GetObjectMetaStruct() *metav1.ObjectMeta
func (*GenericTracingPolicyNamespaced) TpInfo ¶ added in v0.10.0
func (gtp *GenericTracingPolicyNamespaced) TpInfo() string
func (*GenericTracingPolicyNamespaced) TpName ¶ added in v0.10.0
func (gtp *GenericTracingPolicyNamespaced) TpName() string
func (*GenericTracingPolicyNamespaced) TpNamespace ¶ added in v0.10.0
func (gtp *GenericTracingPolicyNamespaced) TpNamespace() string
func (*GenericTracingPolicyNamespaced) TpSpec ¶ added in v0.10.0
func (gtp *GenericTracingPolicyNamespaced) TpSpec() *v1alpha1.TracingPolicySpec
type ObjectMeta ¶ added in v1.7.0
type ObjectMeta = metav1.ObjectMeta
type PolicyEvent ¶ added in v0.10.0
type PolicyEvent interface {
PolicyInfo() PolicyInfo
}
type PolicyInfo ¶ added in v0.10.0
type TracingPolicy ¶
type TracingPolicy interface {
// TpName returns the name of the policy.
TpName() string
// TpSpec returns the specification of the policy
TpSpec() *v1alpha1.TracingPolicySpec
// TpInfo returns a description of the policy
TpInfo() string
TpNamespace() string
}
TracingPolicy is a tracing policy interface. It is implemented by v1alpha1.types.TracingPolicy and config.GenericTracingConf. The former is what is the k8s API server uses, and the latter is used when we load files directly (e.g., via the cli).
func FromFile ¶ added in v1.0.0
func FromFile(path string) (TracingPolicy, error)
FromFile loads a CRD object from a YAML file at the given path.
func FromYAML ¶ added in v1.0.0
func FromYAML(data string) (TracingPolicy, error)
FromYAML inspects the YAML input to determine the kind, then dispatches to the generic FromYAML function.