Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make fields optional on webhook options #818

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions config/crds/policyreporter.kyverno.io_targetconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,7 @@ spec:
webhook:
type: string
required:
- certificate
- channel
- headers
- skipTLS
- webhook
type: object
sources:
Expand All @@ -337,9 +334,6 @@ spec:
webhook:
type: string
required:
- certificate
- headers
- skipTLS
- webhook
type: object
telegram:
Expand All @@ -359,10 +353,7 @@ spec:
webhook:
type: string
required:
- certificate
- chatId
- headers
- skipTLS
- token
- webhook
type: object
Expand All @@ -379,9 +370,6 @@ spec:
webhook:
type: string
required:
- certificate
- headers
- skipTLS
- webhook
type: object
type: object
Expand Down
11 changes: 7 additions & 4 deletions pkg/crd/api/targetconfig/v1alpha1/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ type AWSConfig struct {
}

type WebhookOptions struct {
Webhook string `mapstructure:"webhook" json:"webhook"`
SkipTLS bool `mapstructure:"skipTLS" json:"skipTLS"`
Certificate string `mapstructure:"certificate" json:"certificate"`
Headers map[string]string `mapstructure:"headers" json:"headers"`
Webhook string `mapstructure:"webhook" json:"webhook"`
// +optional
SkipTLS bool `mapstructure:"skipTLS" json:"skipTLS"`
// +optional
Certificate string `mapstructure:"certificate" json:"certificate"`
// +optional
Headers map[string]string `mapstructure:"headers" json:"headers"`
}

type HostOptions struct {
Expand Down