Skip to content

Commit ce7ca88

Browse files
committed
CSPL-3551 Fixes and enhancements
1 parent 0e36568 commit ce7ca88

File tree

9 files changed

+163
-151
lines changed

9 files changed

+163
-151
lines changed

api/v4/ingestorcluster_types.go

Lines changed: 39 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ const (
3333
IngestorClusterPausedAnnotation = "ingestorcluster.enterprise.splunk.com/paused"
3434
)
3535

36-
// IngestorClusterSpec defines the spec of Ingestor Cluster pods
36+
// IngestorClusterSpec defines the spec of Ingestor Cluster
3737
type IngestorClusterSpec struct {
38-
// Common SPlunk spec
38+
// Common Splunk spec
3939
CommonSplunkSpec `json:",inline"`
4040

41-
// Number of ingestion pods
41+
// Number of ingestor pods
4242
Replicas int32 `json:"replicas"`
4343

4444
// Splunk Enterprise app repository that specifies remote app location and scope for Splunk app management
@@ -83,15 +83,15 @@ type PipelineConfigSpec struct {
8383
IndexerPipe bool `json:"indexerPipe"`
8484
}
8585

86-
// IngestorClusterStatus defines the observed state of Ingestor Cluster pods
86+
// IngestorClusterStatus defines the observed state of Ingestor Cluster
8787
type IngestorClusterStatus struct {
88-
// Phase of the ingestion pods
88+
// Phase of the ingestor pods
8989
Phase Phase `json:"phase"`
9090

91-
// Number of desired ingestion pods
91+
// Number of desired ingestor pods
9292
Replicas int32 `json:"replicas"`
9393

94-
// Number of ready ingestion pods
94+
// Number of ready ingestor pods
9595
ReadyReplicas int32 `json:"readyReplicas"`
9696

9797
// Selector for pods used by HorizontalPodAutoscaler
@@ -134,210 +134,192 @@ type IngestorCluster struct {
134134
Status IngestorClusterStatus `json:"status,omitempty,omitzero"`
135135
}
136136

137-
// DeepCopyObject implements common.MetaObject.
137+
// DeepCopyObject implements client.Object.
138138
func (ic *IngestorCluster) DeepCopyObject() runtime.Object {
139139
panic("unimplemented")
140140
}
141141

142-
// GetAnnotations implements common.MetaObject.
142+
// GetAnnotations implements client.Object.
143143
// Subtle: this method shadows the method (ObjectMeta).GetAnnotations of IngestorCluster.ObjectMeta.
144144
func (ic *IngestorCluster) GetAnnotations() map[string]string {
145145
panic("unimplemented")
146146
}
147147

148-
// GetCreationTimestamp implements common.MetaObject.
148+
// GetCreationTimestamp implements client.Object.
149149
// Subtle: this method shadows the method (ObjectMeta).GetCreationTimestamp of IngestorCluster.ObjectMeta.
150150
func (ic *IngestorCluster) GetCreationTimestamp() metav1.Time {
151151
panic("unimplemented")
152152
}
153153

154-
// GetDeletionGracePeriodSeconds implements common.MetaObject.
154+
// GetDeletionGracePeriodSeconds implements client.Object.
155155
// Subtle: this method shadows the method (ObjectMeta).GetDeletionGracePeriodSeconds of IngestorCluster.ObjectMeta.
156156
func (ic *IngestorCluster) GetDeletionGracePeriodSeconds() *int64 {
157157
panic("unimplemented")
158158
}
159159

160-
// GetDeletionTimestamp implements common.MetaObject.
160+
// GetDeletionTimestamp implements client.Object.
161161
// Subtle: this method shadows the method (ObjectMeta).GetDeletionTimestamp of IngestorCluster.ObjectMeta.
162162
func (ic *IngestorCluster) GetDeletionTimestamp() *metav1.Time {
163163
panic("unimplemented")
164164
}
165165

166-
// GetFinalizers implements common.MetaObject.
166+
// GetFinalizers implements client.Object.
167167
// Subtle: this method shadows the method (ObjectMeta).GetFinalizers of IngestorCluster.ObjectMeta.
168168
func (ic *IngestorCluster) GetFinalizers() []string {
169169
panic("unimplemented")
170170
}
171171

172-
// GetGenerateName implements common.MetaObject.
172+
// GetGenerateName implements client.Object.
173173
// Subtle: this method shadows the method (ObjectMeta).GetGenerateName of IngestorCluster.ObjectMeta.
174174
func (ic *IngestorCluster) GetGenerateName() string {
175175
panic("unimplemented")
176176
}
177177

178-
// GetGeneration implements common.MetaObject.
178+
// GetGeneration implements client.Object.
179179
// Subtle: this method shadows the method (ObjectMeta).GetGeneration of IngestorCluster.ObjectMeta.
180180
func (ic *IngestorCluster) GetGeneration() int64 {
181181
panic("unimplemented")
182182
}
183183

184-
// GetLabels implements common.MetaObject.
184+
// GetLabels implements client.Object.
185185
// Subtle: this method shadows the method (ObjectMeta).GetLabels of IngestorCluster.ObjectMeta.
186186
func (ic *IngestorCluster) GetLabels() map[string]string {
187187
panic("unimplemented")
188188
}
189189

190-
// GetManagedFields implements common.MetaObject.
190+
// GetManagedFields implements client.Object.
191191
// Subtle: this method shadows the method (ObjectMeta).GetManagedFields of IngestorCluster.ObjectMeta.
192192
func (ic *IngestorCluster) GetManagedFields() []metav1.ManagedFieldsEntry {
193193
panic("unimplemented")
194194
}
195195

196-
// GetName implements common.MetaObject.
196+
// GetName implements client.Object.
197197
// Subtle: this method shadows the method (ObjectMeta).GetName of IngestorCluster.ObjectMeta.
198198
func (ic *IngestorCluster) GetName() string {
199199
panic("unimplemented")
200200
}
201201

202-
// GetNamespace implements common.MetaObject.
202+
// GetNamespace implements client.Object.
203203
// Subtle: this method shadows the method (ObjectMeta).GetNamespace of IngestorCluster.ObjectMeta.
204204
func (ic *IngestorCluster) GetNamespace() string {
205205
panic("unimplemented")
206206
}
207207

208-
// GetObjectKind implements common.MetaObject.
208+
// GetObjectKind implements client.Object.
209209
// Subtle: this method shadows the method (TypeMeta).GetObjectKind of IngestorCluster.TypeMeta.
210210
func (ic *IngestorCluster) GetObjectKind() schema.ObjectKind {
211211
panic("unimplemented")
212212
}
213213

214-
// GetObjectMeta implements common.MetaObject.
215-
// Subtle: this method shadows the method (ObjectMeta).GetObjectMeta of IngestorCluster.ObjectMeta.
216-
func (ic *IngestorCluster) GetObjectMeta() metav1.Object {
217-
panic("unimplemented")
218-
}
219-
220-
// GetOwnerReferences implements common.MetaObject.
214+
// GetOwnerReferences implements client.Object.
221215
// Subtle: this method shadows the method (ObjectMeta).GetOwnerReferences of IngestorCluster.ObjectMeta.
222216
func (ic *IngestorCluster) GetOwnerReferences() []metav1.OwnerReference {
223217
panic("unimplemented")
224218
}
225219

226-
// GetResourceVersion implements common.MetaObject.
220+
// GetResourceVersion implements client.Object.
227221
// Subtle: this method shadows the method (ObjectMeta).GetResourceVersion of IngestorCluster.ObjectMeta.
228222
func (ic *IngestorCluster) GetResourceVersion() string {
229223
panic("unimplemented")
230224
}
231225

232-
// GetSelfLink implements common.MetaObject.
226+
// GetSelfLink implements client.Object.
233227
// Subtle: this method shadows the method (ObjectMeta).GetSelfLink of IngestorCluster.ObjectMeta.
234228
func (ic *IngestorCluster) GetSelfLink() string {
235229
panic("unimplemented")
236230
}
237231

238-
// GetUID implements common.MetaObject.
232+
// GetUID implements client.Object.
239233
// Subtle: this method shadows the method (ObjectMeta).GetUID of IngestorCluster.ObjectMeta.
240234
func (ic *IngestorCluster) GetUID() types.UID {
241235
panic("unimplemented")
242236
}
243237

244-
// GroupVersionKind implements common.MetaObject.
245-
// Subtle: this method shadows the method (TypeMeta).GroupVersionKind of IngestorCluster.TypeMeta.
246-
func (ic *IngestorCluster) GroupVersionKind() schema.GroupVersionKind {
247-
panic("unimplemented")
248-
}
249-
250-
// SetAnnotations implements common.MetaObject.
238+
// SetAnnotations implements client.Object.
251239
// Subtle: this method shadows the method (ObjectMeta).SetAnnotations of IngestorCluster.ObjectMeta.
252240
func (ic *IngestorCluster) SetAnnotations(annotations map[string]string) {
253241
panic("unimplemented")
254242
}
255243

256-
// SetCreationTimestamp implements common.MetaObject.
244+
// SetCreationTimestamp implements client.Object.
257245
// Subtle: this method shadows the method (ObjectMeta).SetCreationTimestamp of IngestorCluster.ObjectMeta.
258246
func (ic *IngestorCluster) SetCreationTimestamp(timestamp metav1.Time) {
259247
panic("unimplemented")
260248
}
261249

262-
// SetDeletionGracePeriodSeconds implements common.MetaObject.
250+
// SetDeletionGracePeriodSeconds implements client.Object.
263251
// Subtle: this method shadows the method (ObjectMeta).SetDeletionGracePeriodSeconds of IngestorCluster.ObjectMeta.
264252
func (ic *IngestorCluster) SetDeletionGracePeriodSeconds(*int64) {
265253
panic("unimplemented")
266254
}
267255

268-
// SetDeletionTimestamp implements common.MetaObject.
256+
// SetDeletionTimestamp implements client.Object.
269257
// Subtle: this method shadows the method (ObjectMeta).SetDeletionTimestamp of IngestorCluster.ObjectMeta.
270258
func (ic *IngestorCluster) SetDeletionTimestamp(timestamp *metav1.Time) {
271259
panic("unimplemented")
272260
}
273261

274-
// SetFinalizers implements common.MetaObject.
262+
// SetFinalizers implements client.Object.
275263
// Subtle: this method shadows the method (ObjectMeta).SetFinalizers of IngestorCluster.ObjectMeta.
276264
func (ic *IngestorCluster) SetFinalizers(finalizers []string) {
277265
panic("unimplemented")
278266
}
279267

280-
// SetGenerateName implements common.MetaObject.
268+
// SetGenerateName implements client.Object.
281269
// Subtle: this method shadows the method (ObjectMeta).SetGenerateName of IngestorCluster.ObjectMeta.
282270
func (ic *IngestorCluster) SetGenerateName(name string) {
283271
panic("unimplemented")
284272
}
285273

286-
// SetGeneration implements common.MetaObject.
274+
// SetGeneration implements client.Object.
287275
// Subtle: this method shadows the method (ObjectMeta).SetGeneration of IngestorCluster.ObjectMeta.
288276
func (ic *IngestorCluster) SetGeneration(generation int64) {
289277
panic("unimplemented")
290278
}
291279

292-
// SetGroupVersionKind implements common.MetaObject.
293-
// Subtle: this method shadows the method (TypeMeta).SetGroupVersionKind of IngestorCluster.TypeMeta.
294-
func (ic *IngestorCluster) SetGroupVersionKind(kind schema.GroupVersionKind) {
295-
panic("unimplemented")
296-
}
297-
298-
// SetLabels implements common.MetaObject.
280+
// SetLabels implements client.Object.
299281
// Subtle: this method shadows the method (ObjectMeta).SetLabels of IngestorCluster.ObjectMeta.
300282
func (ic *IngestorCluster) SetLabels(labels map[string]string) {
301283
panic("unimplemented")
302284
}
303285

304-
// SetManagedFields implements common.MetaObject.
286+
// SetManagedFields implements client.Object.
305287
// Subtle: this method shadows the method (ObjectMeta).SetManagedFields of IngestorCluster.ObjectMeta.
306288
func (ic *IngestorCluster) SetManagedFields(managedFields []metav1.ManagedFieldsEntry) {
307289
panic("unimplemented")
308290
}
309291

310-
// SetName implements common.MetaObject.
292+
// SetName implements client.Object.
311293
// Subtle: this method shadows the method (ObjectMeta).SetName of IngestorCluster.ObjectMeta.
312294
func (ic *IngestorCluster) SetName(name string) {
313295
panic("unimplemented")
314296
}
315297

316-
// SetNamespace implements common.MetaObject.
298+
// SetNamespace implements client.Object.
317299
// Subtle: this method shadows the method (ObjectMeta).SetNamespace of IngestorCluster.ObjectMeta.
318300
func (ic *IngestorCluster) SetNamespace(namespace string) {
319301
panic("unimplemented")
320302
}
321303

322-
// SetOwnerReferences implements common.MetaObject.
304+
// SetOwnerReferences implements client.Object.
323305
// Subtle: this method shadows the method (ObjectMeta).SetOwnerReferences of IngestorCluster.ObjectMeta.
324306
func (ic *IngestorCluster) SetOwnerReferences([]metav1.OwnerReference) {
325307
panic("unimplemented")
326308
}
327309

328-
// SetResourceVersion implements common.MetaObject.
310+
// SetResourceVersion implements client.Object.
329311
// Subtle: this method shadows the method (ObjectMeta).SetResourceVersion of IngestorCluster.ObjectMeta.
330312
func (ic *IngestorCluster) SetResourceVersion(version string) {
331313
panic("unimplemented")
332314
}
333315

334-
// SetSelfLink implements common.MetaObject.
316+
// SetSelfLink implements client.Object.
335317
// Subtle: this method shadows the method (ObjectMeta).SetSelfLink of IngestorCluster.ObjectMeta.
336318
func (ic *IngestorCluster) SetSelfLink(selfLink string) {
337319
panic("unimplemented")
338320
}
339321

340-
// SetUID implements common.MetaObject.
322+
// SetUID implements client.Object.
341323
// Subtle: this method shadows the method (ObjectMeta).SetUID of IngestorCluster.ObjectMeta.
342324
func (ic *IngestorCluster) SetUID(uid types.UID) {
343325
panic("unimplemented")

config/rbac/ingestorcluster_admin_role.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

config/rbac/ingestorcluster_editor_role.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
apiVersion: rbac.authorization.k8s.io/v1
99
kind: ClusterRole
1010
metadata:
11-
labels:
12-
app.kubernetes.io/name: splunk-operator
13-
app.kubernetes.io/managed-by: kustomize
1411
name: ingestorcluster-editor-role
1512
rules:
1613
- apiGroups:

config/rbac/ingestorcluster_viewer_role.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
apiVersion: rbac.authorization.k8s.io/v1
99
kind: ClusterRole
1010
metadata:
11-
labels:
12-
app.kubernetes.io/name: splunk-operator
13-
app.kubernetes.io/managed-by: kustomize
1411
name: ingestorcluster-viewer-role
1512
rules:
1613
- apiGroups:

config/rbac/kustomization.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,3 @@ resources:
1616
- auth_proxy_role.yaml
1717
- auth_proxy_role_binding.yaml
1818
- auth_proxy_client_clusterrole.yaml
19-
# For each CRD, "Admin", "Editor" and "Viewer" roles are scaffolded by
20-
# default, aiding admins in cluster management. Those roles are
21-
# not used by the splunk-operator itself. You can comment the following lines
22-
# if you do not want those helpers be installed with your Project.
23-
- ingestorcluster_admin_role.yaml
24-
- ingestorcluster_editor_role.yaml
25-
- ingestorcluster_viewer_role.yaml
26-
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
apiVersion: enterprise.splunk.com/v4
22
kind: IngestorCluster
33
metadata:
4-
labels:
5-
app.kubernetes.io/name: splunk-operator
6-
app.kubernetes.io/managed-by: kustomize
74
name: ingestorcluster-sample
85
spec:
96
# TODO(user): Add fields here

internal/controller/ingestorcluster_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,10 @@ func (r *IngestorClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
110110
common.AnnotationChangedPredicate(),
111111
common.LabelChangedPredicate(),
112112
common.SecretChangedPredicate(),
113+
common.ConfigMapChangedPredicate(),
113114
common.StatefulsetChangedPredicate(),
114115
common.PodChangedPredicate(),
115-
common.ConfigMapChangedPredicate(),
116-
common.ClusterManagerChangedPredicate(),
117-
common.ClusterMasterChangedPredicate(),
116+
common.CrdChangedPredicate(),
118117
)).
119118
Watches(&appsv1.StatefulSet{},
120119
handler.EnqueueRequestForOwner(

internal/controller/suite_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ import (
3333
logf "sigs.k8s.io/controller-runtime/pkg/log"
3434
"sigs.k8s.io/controller-runtime/pkg/log/zap"
3535

36-
"k8s.io/client-go/kubernetes/scheme"
3736
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
3837
ctrl "sigs.k8s.io/controller-runtime"
3938

4039
enterpriseApiV3 "github.com/splunk/splunk-operator/api/v3"
4140
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
42-
enterprisev4 "github.com/splunk/splunk-operator/api/v4"
4341
//+kubebuilder:scaffold:imports
4442
)
4543

@@ -94,9 +92,6 @@ var _ = BeforeSuite(func(ctx context.Context) {
9492
err = enterpriseApi.AddToScheme(clientgoscheme.Scheme)
9593
Expect(err).NotTo(HaveOccurred())
9694

97-
err = enterprisev4.AddToScheme(scheme.Scheme)
98-
Expect(err).NotTo(HaveOccurred())
99-
10095
//+kubebuilder:scaffold:scheme
10196

10297
// Create New Manager for controller

0 commit comments

Comments
 (0)