Skip to content

Commit

Permalink
NETOBSERV-904: Make v1beta1 the storage version (#308)
Browse files Browse the repository at this point in the history
* NETOBSERV-904: Make v1beta1 the stored version

Signed-off-by: msherif1234 <[email protected]>

* use none default value when update flowcollector object to recreate SM

Signed-off-by: msherif1234 <[email protected]>

---------

Signed-off-by: msherif1234 <[email protected]>
  • Loading branch information
msherif1234 authored Mar 30, 2023
1 parent 55f6bd7 commit e1532e4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
15 changes: 7 additions & 8 deletions api/v1alpha1/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,14 +654,13 @@ type FlowCollectorStatus struct {
Namespace string `json:"namespace,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:printcolumn:name="Agent",type="string",JSONPath=`.spec.agent.type`
//+kubebuilder:printcolumn:name="Sampling (EBPF)",type="string",JSONPath=`.spec.agent.ebpf.sampling`
//+kubebuilder:printcolumn:name="Deployment Model",type="string",JSONPath=`.spec.deploymentModel`
//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[*].reason"
// +kubebuilder:storageversion
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:printcolumn:name="Agent",type="string",JSONPath=`.spec.agent.type`
// +kubebuilder:printcolumn:name="Sampling (EBPF)",type="string",JSONPath=`.spec.agent.ebpf.sampling`
// +kubebuilder:printcolumn:name="Deployment Model",type="string",JSONPath=`.spec.deploymentModel`
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[*].reason"

// FlowCollector is the Schema for the flowcollectors API, which pilots and configures netflow collection.
type FlowCollector struct {
Expand Down
2 changes: 2 additions & 0 deletions api/v1beta1/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ type FlowCollectorStatus struct {
// +kubebuilder:printcolumn:name="Sampling (EBPF)",type="string",JSONPath=`.spec.agent.ebpf.sampling`
// +kubebuilder:printcolumn:name="Deployment Model",type="string",JSONPath=`.spec.deploymentModel`
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[*].reason"
// +kubebuilder:storageversion

// FlowCollector is the Schema for the flowcollectors API, which pilots and configures netflow collection.
type FlowCollector struct {
metav1.TypeMeta `json:",inline"`
Expand Down
4 changes: 2 additions & 2 deletions bundle/manifests/flows.netobserv.io_flowcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2153,7 +2153,7 @@ spec:
type: object
type: object
served: true
storage: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
Expand Down Expand Up @@ -4386,7 +4386,7 @@ spec:
type: object
type: object
served: true
storage: false
storage: true
subresources:
status: {}
status:
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/flows.netobserv.io_flowcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2140,7 +2140,7 @@ spec:
type: object
type: object
served: true
storage: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
Expand Down Expand Up @@ -4373,7 +4373,7 @@ spec:
type: object
type: object
served: true
storage: false
storage: true
subresources:
status: {}
status:
Expand Down
2 changes: 1 addition & 1 deletion controllers/flowcollector_controller_console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func flowCollectorConsolePluginSpecs() {

// Do a dummy change that will trigger reconcile, and make sure SM is created again
UpdateCR(crKey, func(fc *flowslatest.FlowCollector) {
fc.Spec.Processor.LogLevel = "info"
fc.Spec.Processor.LogLevel = "trace"
})
By("Expecting ServiceMonitor to exist")
Eventually(func() interface{} {
Expand Down

0 comments on commit e1532e4

Please sign in to comment.