Skip to content

Commit

Permalink
Update ovnKubernetesConfig.policyAuditConfig Default
Browse files Browse the repository at this point in the history
We need to initialize `ovnKubernetesConfig.policyAuditConfig`
so that the proper defaults are populated when a CNO config
object is created

It would be better to do this using the `+kubebuilder:default`
flag however it is broken for this case as described in this
[upstream issue](kubernetes-sigs/controller-tools#622)

Signed-off-by: astoycos <astoycos@redhat.com>
  • Loading branch information
astoycos committed Sep 22, 2021
1 parent 21ac9e0 commit aeb12f5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion operator/v1/0000_70_cluster-network-operator_01.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ spec:
format: int32
minimum: 0
policyAuditConfig:
description: policyAuditConfig is the configuration for network policy audit events. If unset, reported defaults are used.
description: 'policyAuditConfig is the configuration for network policy audit events. If unset, reported defaults are used. This config is replaced during a strategic merge patch TODO(astoycos): once https://github.com/kubernetes-sigs/controller-tools/issues/622 is resolved convert back to using kubebuilder'
type: object
properties:
destination:
Expand Down
Empty file.
3 changes: 3 additions & 0 deletions operator/v1/types_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ type OVNKubernetesConfig struct {
IPsecConfig *IPsecConfig `json:"ipsecConfig,omitempty"`
// policyAuditConfig is the configuration for network policy audit events. If unset,
// reported defaults are used.
// This config is replaced during a strategic merge patch
// TODO(astoycos): once https://github.com/kubernetes-sigs/controller-tools/issues/622
// is resolved convert back to using kubebuilder
// +optional
PolicyAuditConfig *PolicyAuditConfig `json:"policyAuditConfig,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aeb12f5

Please sign in to comment.