Skip to content

Commit

Permalink
feat: add type field in Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusfm committed Aug 11, 2023
1 parent 1017ac2 commit c05f3a7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/zora/v1alpha1/plugin_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ import (

// PluginSpec defines the desired state of Plugin
type PluginSpec struct {

// Indicates what this plugin reports
// +kubebuilder:validation:Enum=misconfiguration;vulnerability
// +kubebuilder:default=misconfiguration
Type string `json:"type"`

// Docker image name.
// More info: https://kubernetes.io/docs/concepts/containers/images
Image string `json:"image"`
Expand Down Expand Up @@ -92,6 +98,7 @@ type PluginStatus struct {
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Image",type="string",JSONPath=".spec.image"
//+kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type"
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

// Plugin is the Schema for the plugins API
Expand Down
11 changes: 11 additions & 0 deletions charts/zora/crds/zora.undistro.io_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ spec:
- jsonPath: .spec.image
name: Image
type: string
- jsonPath: .spec.type
name: Type
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down Expand Up @@ -454,8 +457,16 @@ spec:
type: string
type: object
type: object
type:
default: misconfiguration
description: Indicates what this plugin reports
enum:
- misconfiguration
- vulnerability
type: string
required:
- image
- type
type: object
status:
description: PluginStatus defines the observed state of Plugin
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/zora.undistro.io_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ spec:
- jsonPath: .spec.image
name: Image
type: string
- jsonPath: .spec.type
name: Type
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down Expand Up @@ -440,8 +443,16 @@ spec:
type: string
type: object
type: object
type:
default: misconfiguration
description: Indicates what this plugin reports
enum:
- misconfiguration
- vulnerability
type: string
required:
- image
- type
type: object
status:
description: PluginStatus defines the observed state of Plugin
Expand Down

0 comments on commit c05f3a7

Please sign in to comment.