Skip to content

Commit e16b40e

Browse files
committed
program: deprecate LogSize and VerifierError.Truncated
We removed LogSize and VerifierError.Truncated in a previous commit, but this causes lots of headache when trying to update the dependency in cilium/cilium and cilium/tetragon. We won't be the only ones suffering, so deprecate the field instead of removing it outright. Signed-off-by: Lorenz Bauer <[email protected]>
1 parent 63c6cf8 commit e16b40e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

internal/errors.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func ErrorWithLog(source string, err error, log []byte) *VerifierError {
2323

2424
log = bytes.Trim(log, whitespace)
2525
if len(log) == 0 {
26-
return &VerifierError{source, err, nil}
26+
return &VerifierError{source, err, nil, false}
2727
}
2828

2929
logLines := bytes.Split(log, []byte{'\n'})
@@ -34,7 +34,7 @@ func ErrorWithLog(source string, err error, log []byte) *VerifierError {
3434
lines = append(lines, string(bytes.TrimRight(line, whitespace)))
3535
}
3636

37-
return &VerifierError{source, err, lines}
37+
return &VerifierError{source, err, lines, false}
3838
}
3939

4040
// VerifierError includes information from the eBPF verifier.
@@ -46,6 +46,8 @@ type VerifierError struct {
4646
Cause error
4747
// The verifier output split into lines.
4848
Log []string
49+
// Deprecated: the log is never truncated anymore.
50+
Truncated bool
4951
}
5052

5153
func (le *VerifierError) Unwrap() error {

prog.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ type ProgramOptions struct {
6969
// attempt at loading the program.
7070
LogLevel LogLevel
7171

72+
// Deprecated: the correct log buffer size is determined automatically
73+
// and this field is ignored.
74+
LogSize int
75+
7276
// Disables the verifier log completely, regardless of other options.
7377
LogDisabled bool
7478

0 commit comments

Comments
 (0)