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

Align management state constant with other constants #1988

Merged
merged 4 commits into from
Aug 4, 2023
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
8 changes: 4 additions & 4 deletions apis/v1alpha1/opentelemetrycollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ import (

// ManagementStateType defines the type for CR management states.
//
// +kubebuilder:validation:Enum=Managed;Unmanaged
// +kubebuilder:validation:Enum=managed;unmanaged
type ManagementStateType string

const (
// ManagementStateManaged when the OpenTelemetryCollector custom resource should be
// reconciled by the operator.
ManagementStateManaged ManagementStateType = "Managed"
ManagementStateManaged ManagementStateType = "managed"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use constants with capital letters in the codebase.


// ManagementStateUnmanaged when the OpenTelemetryCollector custom resource should not be
// reconciled by the operator.
ManagementStateUnmanaged ManagementStateType = "Unmanaged"
ManagementStateUnmanaged ManagementStateType = "unmanaged"
)

// Ingress is used to specify how OpenTelemetry Collector is exposed. This
Expand Down Expand Up @@ -89,7 +89,7 @@ type OpenTelemetryCollectorSpec struct {
//
// +required
// +kubebuilder:validation:Required
// +kubebuilder:default:=Managed
// +kubebuilder:default:=managed
ManagementState ManagementStateType `json:"managementState,omitempty"`
// Resources to set on the OpenTelemetry Collector pods.
// +optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ metadata:
categories: Logging & Tracing
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
createdAt: "2023-07-05T18:15:51Z"
createdAt: "2023-08-04T13:28:05Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2926,12 +2926,12 @@ spec:
type: integer
type: object
managementState:
default: Managed
default: managed
description: ManagementState defines if the CR should be managed by
the operator or not. Default is managed.
enum:
- Managed
- Unmanaged
- managed
- unmanaged
type: string
maxReplicas:
description: 'MaxReplicas sets an upper bound to the autoscaling feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2923,12 +2923,12 @@ spec:
type: integer
type: object
managementState:
default: Managed
default: managed
description: ManagementState defines if the CR should be managed by
the operator or not. Default is managed.
enum:
- Managed
- Unmanaged
- managed
- unmanaged
type: string
maxReplicas:
description: 'MaxReplicas sets an upper bound to the autoscaling feature.
Expand Down
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3708,8 +3708,8 @@ OpenTelemetryCollectorSpec defines the desired state of OpenTelemetryCollector.
<td>
ManagementState defines if the CR should be managed by the operator or not. Default is managed.<br/>
<br/>
<i>Enum</i>: Managed, Unmanaged<br/>
<i>Default</i>: Managed<br/>
<i>Enum</i>: managed, unmanaged<br/>
<i>Default</i>: managed<br/>
</td>
<td>false</td>
</tr><tr>
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/managed-reconcile/01-disable-reconciliation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: OpenTelemetryCollector
metadata:
name: simplest
spec:
managementState: Unmanaged
managementState: unmanaged
config: |
receivers:
otlp:
Expand Down Expand Up @@ -48,4 +48,4 @@ data:
traces:
receivers: [jaeger, otlp]
processors: []
exporters: [logging]
exporters: [logging]
4 changes: 2 additions & 2 deletions tests/e2e/managed-reconcile/02-enable-reconciliation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: OpenTelemetryCollector
metadata:
name: simplest
spec:
managementState: Managed
managementState: managed
config: |
receivers:
otlp:
Expand All @@ -20,4 +20,4 @@ spec:
traces:
receivers: [otlp]
processors: []
exporters: [logging]
exporters: [logging]
Loading