Skip to content

Commit 62b81d1

Browse files
api: add v1beta1 types for operatorconfig
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
1 parent c772118 commit 62b81d1

File tree

14 files changed

+7412
-10
lines changed

14 files changed

+7412
-10
lines changed

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,12 @@ resources:
8383
kind: Driver
8484
path: github.com/ceph/ceph-csi-operator/api/v1beta1
8585
version: v1beta1
86+
- api:
87+
crdVersion: v1
88+
namespaced: true
89+
domain: ceph.io
90+
group: csi
91+
kind: OperatorConfig
92+
path: github.com/ceph/ceph-csi-operator/api/v1beta1
93+
version: v1beta1
8694
version: "3"

api/v1alpha1/operatorconfig_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type OperatorConfigStatus struct {
4444
}
4545

4646
//+kubebuilder:object:root=true
47+
//+kubebuilder:deprecatedversion:warning="v1alpha1 is deprecated, please use v1beta1"
4748
//+kubebuilder:subresource:status
4849

4950
// OperatorConfig is the Schema for the operatorconfigs API

api/v1beta1/groupversion_info.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
4444
&ClientProfile{}, &ClientProfileList{},
4545
&ClientProfileMapping{}, &ClientProfileMappingList{},
4646
&Driver{}, &DriverList{},
47+
&OperatorConfig{}, &OperatorConfigList{},
4748
)
4849
metav1.AddToGroupVersion(scheme, GroupVersion)
4950
return nil
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
Copyright 2024.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1beta1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// OperatorLogSpec provide log related settings for the operator
24+
type OperatorLogSpec struct {
25+
// Operator's log level
26+
//+kubebuilder:validation:Optional
27+
//+kubebuilder:validation:Minimum=0
28+
//+kubebuilder:validation:Maximum=3
29+
Verbosity int `json:"verbosity,omitempty"`
30+
}
31+
32+
// OperatorConfigSpec defines the desired state of OperatorConfig
33+
type OperatorConfigSpec struct {
34+
//+kubebuilder:validation:Optional
35+
Log *OperatorLogSpec `json:"log,omitempty"`
36+
37+
// Allow overwrite of hardcoded defaults for any driver managed by this operator
38+
//+kubebuilder:validation:Optional
39+
DriverSpecDefaults *DriverSpec `json:"driverSpecDefaults,omitempty"`
40+
}
41+
42+
// OperatorConfigStatus defines the observed state of OperatorConfig
43+
type OperatorConfigStatus struct {
44+
}
45+
46+
//+kubebuilder:object:root=true
47+
//+kubebuilder:storageversion
48+
//+kubebuilder:subresource:status
49+
50+
// OperatorConfig is the Schema for the operatorconfigs API
51+
type OperatorConfig struct {
52+
metav1.TypeMeta `json:",inline"`
53+
metav1.ObjectMeta `json:"metadata,omitempty"`
54+
55+
Spec OperatorConfigSpec `json:"spec,omitempty"`
56+
Status OperatorConfigStatus `json:"status,omitempty"`
57+
}
58+
59+
//+kubebuilder:object:root=true
60+
61+
// OperatorConfigList contains a list of OperatorConfig
62+
type OperatorConfigList struct {
63+
metav1.TypeMeta `json:",inline"`
64+
metav1.ListMeta `json:"metadata,omitempty"`
65+
Items []OperatorConfig `json:"items"`
66+
}

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)