Skip to content

Commit

Permalink
tracingpoilcy: add creationTimestamp in metadata
Browse files Browse the repository at this point in the history
When we generate tracing policies in the previous patches, there is no
easy way to omit the creationTimestamp field (see
kubernetes/kubernetes#67610). So, this patch
addes creationTimestamp to the non-k8s policy metadata. This enables the
generated policies to be loaded directly.

Signed-off-by: Kornilios Kourtis <[email protected]>
  • Loading branch information
kkourt committed Aug 25, 2023
1 parent 0a0c617 commit 091fbcb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/tracingpolicy/generictracingpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"os"
"strings"
"time"

"github.com/cilium/tetragon/pkg/k8s/apis/cilium.io/v1alpha1"

Expand All @@ -15,8 +16,9 @@ import (
)

type Metadata struct {
Name string `yaml:"name"`
Annotations map[string]string `yaml:"annotations"`
Name string `json:"name"`
Annotations map[string]string `json:"annotations"`
CreationTimestamp time.Time `json:"creationTimestamp,omitempty"`
}

type GenericTracingPolicy struct {
Expand Down

0 comments on commit 091fbcb

Please sign in to comment.