Skip to content

Commit cf54771

Browse files
Add workload cluster events (#62864)
* feat(api/proto): add WorkloadCluster events * feat(api/types): regenerate events * feat(api/types): support oneof for workload cluster events * feat(lib/events): support workload cluster events * feat(web/packages): support workload events * docs: regenerate audit-events * fix(web/packages): add user to audit event format
1 parent 41fbc5c commit cf54771

File tree

11 files changed

+4569
-2973
lines changed

11 files changed

+4569
-2973
lines changed

api/proto/teleport/legacy/types/events/events.proto

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4927,6 +4927,9 @@ message OneOf {
49274927
events.VnetConfigCreate VnetConfigCreate = 232;
49284928
events.VnetConfigUpdate VnetConfigUpdate = 233;
49294929
events.VnetConfigDelete VnetConfigDelete = 234;
4930+
events.WorkloadClusterCreate WorkloadClusterCreate = 235;
4931+
events.WorkloadClusterUpdate WorkloadClusterUpdate = 236;
4932+
events.WorkloadClusterDelete WorkloadClusterDelete = 237;
49304933
}
49314934
}
49324935

@@ -9474,3 +9477,117 @@ message VnetConfigDelete {
94749477
(gogoproto.jsontag) = ""
94759478
];
94769479
}
9480+
9481+
// WorkloadClusterCreate is emitted when a workload cluster is created.
9482+
message WorkloadClusterCreate {
9483+
// Metadata is a common event metadata
9484+
Metadata Metadata = 1 [
9485+
(gogoproto.nullable) = false,
9486+
(gogoproto.embed) = true,
9487+
(gogoproto.jsontag) = ""
9488+
];
9489+
9490+
// ResourceMetadata is a common resource event metadata
9491+
ResourceMetadata Resource = 2 [
9492+
(gogoproto.nullable) = false,
9493+
(gogoproto.embed) = true,
9494+
(gogoproto.jsontag) = ""
9495+
];
9496+
9497+
// User is a common user event metadata
9498+
UserMetadata User = 3 [
9499+
(gogoproto.nullable) = false,
9500+
(gogoproto.embed) = true,
9501+
(gogoproto.jsontag) = ""
9502+
];
9503+
9504+
// ConnectionMetadata holds information about the connection
9505+
ConnectionMetadata Connection = 4 [
9506+
(gogoproto.nullable) = false,
9507+
(gogoproto.embed) = true,
9508+
(gogoproto.jsontag) = ""
9509+
];
9510+
9511+
// Status indicates whether the creation was successful.
9512+
Status Status = 5 [
9513+
(gogoproto.nullable) = false,
9514+
(gogoproto.embed) = true,
9515+
(gogoproto.jsontag) = ""
9516+
];
9517+
}
9518+
9519+
// WorkloadClusterUpdate is emitted when a workload cluster is updated.
9520+
message WorkloadClusterUpdate {
9521+
// Metadata is a common event metadata
9522+
Metadata Metadata = 1 [
9523+
(gogoproto.nullable) = false,
9524+
(gogoproto.embed) = true,
9525+
(gogoproto.jsontag) = ""
9526+
];
9527+
9528+
// Status indicates whether the update was successful.
9529+
Status Status = 2 [
9530+
(gogoproto.nullable) = false,
9531+
(gogoproto.embed) = true,
9532+
(gogoproto.jsontag) = ""
9533+
];
9534+
9535+
// User is a common user event metadata
9536+
UserMetadata User = 3 [
9537+
(gogoproto.nullable) = false,
9538+
(gogoproto.embed) = true,
9539+
(gogoproto.jsontag) = ""
9540+
];
9541+
9542+
// ConnectionMetadata holds information about the connection
9543+
ConnectionMetadata Connection = 4 [
9544+
(gogoproto.nullable) = false,
9545+
(gogoproto.embed) = true,
9546+
(gogoproto.jsontag) = ""
9547+
];
9548+
9549+
// ResourceMetadata is a common resource event metadata
9550+
ResourceMetadata Resource = 5 [
9551+
(gogoproto.nullable) = false,
9552+
(gogoproto.embed) = true,
9553+
(gogoproto.jsontag) = ""
9554+
];
9555+
}
9556+
9557+
// WorkloadClusterDelete is emitted when a workload cluster is deleted.
9558+
message WorkloadClusterDelete {
9559+
// Metadata is a common event metadata
9560+
Metadata Metadata = 1 [
9561+
(gogoproto.nullable) = false,
9562+
(gogoproto.embed) = true,
9563+
(gogoproto.jsontag) = ""
9564+
];
9565+
9566+
// ResourceMetadata is a common resource event metadata
9567+
ResourceMetadata Resource = 2 [
9568+
(gogoproto.nullable) = false,
9569+
(gogoproto.embed) = true,
9570+
(gogoproto.jsontag) = ""
9571+
];
9572+
9573+
// User is a common user event metadata
9574+
UserMetadata User = 3 [
9575+
(gogoproto.nullable) = false,
9576+
(gogoproto.embed) = true,
9577+
(gogoproto.jsontag) = ""
9578+
];
9579+
9580+
// ConnectionMetadata holds information about the connection
9581+
ConnectionMetadata Connection = 4 [
9582+
(gogoproto.nullable) = false,
9583+
(gogoproto.embed) = true,
9584+
(gogoproto.jsontag) = ""
9585+
];
9586+
9587+
// Status indicates whether the deletion was successful.
9588+
Status Status = 5 [
9589+
(gogoproto.nullable) = false,
9590+
(gogoproto.embed) = true,
9591+
(gogoproto.jsontag) = ""
9592+
];
9593+
}

api/types/events/events.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,3 +2794,15 @@ func (m *VnetConfigUpdate) TrimToMaxSize(int) AuditEvent {
27942794
func (m *VnetConfigDelete) TrimToMaxSize(int) AuditEvent {
27952795
return m
27962796
}
2797+
2798+
func (m *WorkloadClusterCreate) TrimToMaxSize(_ int) AuditEvent {
2799+
return m
2800+
}
2801+
2802+
func (m *WorkloadClusterUpdate) TrimToMaxSize(_ int) AuditEvent {
2803+
return m
2804+
}
2805+
2806+
func (m *WorkloadClusterDelete) TrimToMaxSize(_ int) AuditEvent {
2807+
return m
2808+
}

0 commit comments

Comments
 (0)