@@ -107,6 +107,15 @@ type RunPod struct {
107107 PodSpec corev1.PodSpec `json:"podSpec,omitempty" yaml:"podSpec,omitempty"`
108108}
109109
110+ type RunDaemonSet struct {
111+ CollectorMeta `json:",inline" yaml:",inline"`
112+ Name string `json:"name,omitempty" yaml:"name,omitempty"`
113+ Namespace string `json:"namespace" yaml:"namespace"`
114+ Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"`
115+ ImagePullSecret * ImagePullSecrets `json:"imagePullSecret,omitempty" yaml:"imagePullSecret,omitempty"`
116+ PodSpec corev1.PodSpec `json:"podSpec,omitempty" yaml:"podSpec,omitempty"`
117+ }
118+
110119type ImagePullSecrets struct {
111120 Name string `json:"name,omitempty" yaml:"name,omitempty"`
112121 Data map [string ]string `json:"data,omitempty" yaml:"data,omitempty"`
@@ -282,6 +291,7 @@ type Collect struct {
282291 Logs * Logs `json:"logs,omitempty" yaml:"logs,omitempty"`
283292 Run * Run `json:"run,omitempty" yaml:"run,omitempty"`
284293 RunPod * RunPod `json:"runPod,omitempty" yaml:"runPod,omitempty"`
294+ RunDaemonSet * RunDaemonSet `json:"runDaemonSet,omitempty" yaml:"runDaemonSet,omitempty"`
285295 Exec * Exec `json:"exec,omitempty" yaml:"exec,omitempty"`
286296 Data * Data `json:"data,omitempty" yaml:"data,omitempty"`
287297 Copy * Copy `json:"copy,omitempty" yaml:"copy,omitempty"`
@@ -432,6 +442,19 @@ func (c *Collect) AccessReviewSpecs(overrideNS string) []authorizationv1.SelfSub
432442 },
433443 NonResourceAttributes : nil ,
434444 })
445+ } else if c .RunDaemonSet != nil {
446+ result = append (result , authorizationv1.SelfSubjectAccessReviewSpec {
447+ ResourceAttributes : & authorizationv1.ResourceAttributes {
448+ Namespace : pickNamespaceOrDefault (c .RunDaemonSet .Namespace , overrideNS ),
449+ Verb : "create" ,
450+ Group : "" ,
451+ Version : "" ,
452+ Resource : "pods" ,
453+ Subresource : "" ,
454+ Name : "" ,
455+ },
456+ NonResourceAttributes : nil ,
457+ })
435458 } else if c .Exec != nil {
436459 result = append (result , authorizationv1.SelfSubjectAccessReviewSpec {
437460 ResourceAttributes : & authorizationv1.ResourceAttributes {
@@ -542,6 +565,10 @@ func (c *Collect) GetName() string {
542565 collector = "run-pod"
543566 name = c .RunPod .CollectorName
544567 }
568+ if c .RunDaemonSet != nil {
569+ collector = "run-daemonset"
570+ name = c .RunDaemonSet .CollectorName
571+ }
545572 if c .Exec != nil {
546573 collector = "exec"
547574 name = c .Exec .CollectorName
0 commit comments