Skip to content

Commit e352df4

Browse files
committed
Make existing controllers work with new CRDs
Limitation: They only work with a single attach point per program. Signed-off-by: Andre Fredette <[email protected]>
1 parent aa91d11 commit e352df4

File tree

61 files changed

+1064
-882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1064
-882
lines changed

apis/v1alpha1/bpfapplication_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ type BpfApplication struct {
155155
metav1.TypeMeta `json:",inline"`
156156
metav1.ObjectMeta `json:"metadata,omitempty"`
157157

158-
Spec BpfApplicationSpec `json:"spec,omitempty"`
159-
Status BpfApplicationStatus `json:"status,omitempty"`
158+
Spec BpfApplicationSpec `json:"spec,omitempty"`
159+
Status BpfAppStatus `json:"status,omitempty"`
160160
}
161161

162162
// +kubebuilder:object:root=true

apis/v1alpha1/fentryProgram_types.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ type FentryProgram struct {
3737
metav1.TypeMeta `json:",inline"`
3838
metav1.ObjectMeta `json:"metadata,omitempty"`
3939

40-
Spec FentryProgramSpec `json:"spec"`
40+
Spec FentryProgramSpec `json:"spec"`
41+
Status BpfAppStatus `json:"status,omitempty"`
4142
}
4243

4344
// FentryProgramSpec defines the desired state of FentryProgram
@@ -51,11 +52,11 @@ type FentryProgramSpec struct {
5152
type FentryProgramInfo struct {
5253
BpfProgramCommon `json:",inline"`
5354
FentryLoadInfo `json:",inline"`
54-
// Whether the program should be attached to the function.
55-
// This may be updated after the program has been loaded.
55+
// Whether the program should be attached to the function.
56+
// This may be updated after the program has been loaded.
5657
// +optional
5758
// +kubebuilder:default=false
58-
attach bool `json:"attach,omitempty"`
59+
Attach bool `json:"attach,omitempty"`
5960
}
6061

6162
// FentryLoadInfo contains the program-specific load information for Fentry

apis/v1alpha1/fexitProgram_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ type FexitProgram struct {
3737
metav1.TypeMeta `json:",inline"`
3838
metav1.ObjectMeta `json:"metadata,omitempty"`
3939

40-
Spec FexitProgramSpec `json:"spec"`
40+
Spec FexitProgramSpec `json:"spec"`
41+
Status BpfAppStatus `json:"status,omitempty"`
4142
}
4243

4344
// FexitProgramSpec defines the desired state of FexitProgram
@@ -55,7 +56,7 @@ type FexitProgramInfo struct {
5556
// This may be updated after the program has been loaded.
5657
// +optional
5758
// +kubebuilder:default=false
58-
attach bool `json:"attach,omitempty"`
59+
Attach bool `json:"attach,omitempty"`
5960
}
6061

6162
// FexitLoadInfo contains the program-specific load information for Fexit

apis/v1alpha1/kprobeProgram_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ type KprobeProgram struct {
3939
metav1.TypeMeta `json:",inline"`
4040
metav1.ObjectMeta `json:"metadata,omitempty"`
4141

42-
Spec KprobeProgramSpec `json:"spec"`
42+
Spec KprobeProgramSpec `json:"spec"`
43+
Status BpfAppStatus `json:"status,omitempty"`
4344
}
4445

4546
// KprobeProgramSpec defines the desired state of KprobeProgram

apis/v1alpha1/shared_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ type BpfAppCommon struct {
8585
// Bytecode configures where the bpf program's bytecode should be loaded
8686
// from.
8787
ByteCode BytecodeSelector `json:"bytecode"`
88-
89-
// Status of the BpfApp
90-
Status BpfAppStatus `json:"status,omitempty"`
9188
}
9289

9390
// BpfAppStatus defines the BpfProgram status

apis/v1alpha1/tcProgram_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ type TcProgram struct {
4040
metav1.TypeMeta `json:",inline"`
4141
metav1.ObjectMeta `json:"metadata,omitempty"`
4242

43-
Spec TcProgramSpec `json:"spec"`
43+
Spec TcProgramSpec `json:"spec"`
44+
Status BpfAppStatus `json:"status,omitempty"`
4445
}
4546

4647
// +kubebuilder:validation:Enum=unspec;ok;reclassify;shot;pipe;stolen;queued;repeat;redirect;trap;dispatcher_return

apis/v1alpha1/tcxProgram_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ type TcxProgram struct {
4040
metav1.TypeMeta `json:",inline"`
4141
metav1.ObjectMeta `json:"metadata,omitempty"`
4242

43-
Spec TcxProgramSpec `json:"spec"`
43+
Spec TcxProgramSpec `json:"spec"`
44+
Status BpfAppStatus `json:"status,omitempty"`
4445
}
4546

4647
// TcxProgramSpec defines the desired state of TcxProgram

apis/v1alpha1/tracepointProgram_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ type TracepointProgram struct {
3737
metav1.TypeMeta `json:",inline"`
3838
metav1.ObjectMeta `json:"metadata,omitempty"`
3939

40-
Spec TracepointProgramSpec `json:"spec"`
40+
Spec TracepointProgramSpec `json:"spec"`
41+
Status BpfAppStatus `json:"status,omitempty"`
4142
}
4243

4344
// TracepointProgramSpec defines the desired state of TracepointProgram

apis/v1alpha1/uprobeProgram_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ type UprobeProgram struct {
4141
metav1.TypeMeta `json:",inline"`
4242
metav1.ObjectMeta `json:"metadata,omitempty"`
4343

44-
Spec UprobeProgramSpec `json:"spec"`
44+
Spec UprobeProgramSpec `json:"spec"`
45+
Status BpfAppStatus `json:"status,omitempty"`
4546
}
4647

4748
// UprobeProgramSpec defines the desired state of UprobeProgram

apis/v1alpha1/xdpProgram_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ type XdpProgram struct {
3939
metav1.TypeMeta `json:",inline"`
4040
metav1.ObjectMeta `json:"metadata,omitempty"`
4141

42-
Spec XdpProgramSpec `json:"spec"`
42+
Spec XdpProgramSpec `json:"spec"`
43+
Status BpfAppStatus `json:"status,omitempty"`
4344
}
4445

4546
// +kubebuilder:validation:Enum=aborted;drop;pass;tx;redirect;dispatcher_return

0 commit comments

Comments
 (0)