Skip to content

Commit 21d79f5

Browse files
Merge pull request #468 from periklis/status-subresource
Bug 1871737: Update status using subresource /status
2 parents c530617 + 77ca0e1 commit 21d79f5

13 files changed

+602
-59
lines changed

bundle/manifests/elasticsearch-operator.v4.6.0.clusterserviceversion.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ spec:
150150
- configmaps
151151
- secrets
152152
- serviceaccounts
153+
- services/finalizers
153154
verbs:
154155
- "*"
155156
- apiGroups:

bundle/manifests/logging.openshift.io_elasticsearches_crd.yaml

Lines changed: 229 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ spec:
3434
- es
3535
singular: elasticsearch
3636
scope: Namespaced
37-
subresources: {}
37+
subresources:
38+
status: {}
3839
validation:
3940
openAPIV3Schema:
4041
description: Elasticsearch is the Schema for the elasticsearches API
@@ -401,6 +402,233 @@ spec:
401402
- redundancyPolicy
402403
type: object
403404
status:
405+
description: ElasticsearchStatus defines the observed state of Elasticsearch
406+
properties:
407+
cluster:
408+
properties:
409+
activePrimaryShards:
410+
format: int32
411+
type: integer
412+
activeShards:
413+
format: int32
414+
type: integer
415+
initializingShards:
416+
format: int32
417+
type: integer
418+
numDataNodes:
419+
format: int32
420+
type: integer
421+
numNodes:
422+
format: int32
423+
type: integer
424+
pendingTasks:
425+
format: int32
426+
type: integer
427+
relocatingShards:
428+
format: int32
429+
type: integer
430+
status:
431+
type: string
432+
unassignedShards:
433+
format: int32
434+
type: integer
435+
required:
436+
- activePrimaryShards
437+
- activeShards
438+
- initializingShards
439+
- numDataNodes
440+
- numNodes
441+
- pendingTasks
442+
- relocatingShards
443+
- status
444+
- unassignedShards
445+
type: object
446+
clusterHealth:
447+
type: string
448+
conditions:
449+
items:
450+
properties:
451+
lastTransitionTime:
452+
description: Last time the condition transitioned from one status
453+
to another.
454+
format: date-time
455+
type: string
456+
message:
457+
description: Human-readable message indicating details about last
458+
transition.
459+
type: string
460+
reason:
461+
description: Unique, one-word, CamelCase reason for the condition's
462+
last transition.
463+
type: string
464+
status:
465+
type: string
466+
type:
467+
description: ClusterConditionType is a valid value for ClusterCondition.Type
468+
type: string
469+
required:
470+
- lastTransitionTime
471+
- status
472+
- type
473+
type: object
474+
type: array
475+
indexManagement:
476+
properties:
477+
lastUpdated:
478+
format: date-time
479+
type: string
480+
mappings:
481+
items:
482+
properties:
483+
conditions:
484+
description: Reasons for the state of the corresponding mapping
485+
for this status
486+
items:
487+
properties:
488+
message:
489+
type: string
490+
reason:
491+
type: string
492+
status:
493+
type: string
494+
type:
495+
type: string
496+
type: object
497+
type: array
498+
lastUpdated:
499+
description: LastUpdated represents the last time that the
500+
status was updated.
501+
format: date-time
502+
type: string
503+
message:
504+
type: string
505+
name:
506+
description: Name of the corresponding mapping for this status
507+
type: string
508+
reason:
509+
type: string
510+
state:
511+
description: State of the corresponding mapping for this status
512+
type: string
513+
type: object
514+
type: array
515+
message:
516+
type: string
517+
policies:
518+
items:
519+
properties:
520+
conditions:
521+
description: Reasons for the state of the corresponding policy
522+
for this status
523+
items:
524+
properties:
525+
message:
526+
type: string
527+
reason:
528+
type: string
529+
status:
530+
type: string
531+
type:
532+
type: string
533+
type: object
534+
type: array
535+
lastUpdated:
536+
description: LastUpdated represents the last time that the
537+
status was updated.
538+
format: date-time
539+
type: string
540+
message:
541+
description: Message about the corresponding policy
542+
type: string
543+
name:
544+
description: Name of the corresponding policy for this status
545+
type: string
546+
reason:
547+
description: Reasons for the state of the corresponding policy
548+
for this status
549+
type: string
550+
state:
551+
description: State of the corresponding policy for this status
552+
type: string
553+
type: object
554+
type: array
555+
reason:
556+
type: string
557+
state:
558+
description: IndexManagementState of IndexManagment
559+
type: string
560+
type: object
561+
nodes:
562+
items:
563+
description: ElasticsearchNodeStatus represents the status of individual
564+
Elasticsearch node
565+
properties:
566+
conditions:
567+
items:
568+
properties:
569+
lastTransitionTime:
570+
description: Last time the condition transitioned from one
571+
status to another.
572+
format: date-time
573+
type: string
574+
message:
575+
description: Human-readable message indicating details about
576+
last transition.
577+
type: string
578+
reason:
579+
description: Unique, one-word, CamelCase reason for the
580+
condition's last transition.
581+
type: string
582+
status:
583+
type: string
584+
type:
585+
description: ClusterConditionType is a valid value for ClusterCondition.Type
586+
type: string
587+
required:
588+
- lastTransitionTime
589+
- status
590+
- type
591+
type: object
592+
type: array
593+
deploymentName:
594+
type: string
595+
roles:
596+
items:
597+
enum:
598+
- master
599+
- client
600+
- data
601+
type: string
602+
type: array
603+
statefulSetName:
604+
type: string
605+
status:
606+
type: string
607+
upgradeStatus:
608+
properties:
609+
scheduledCertRedeploy:
610+
type: string
611+
scheduledRedeploy:
612+
type: string
613+
scheduledUpgrade:
614+
type: string
615+
underUpgrade:
616+
type: string
617+
upgradePhase:
618+
type: string
619+
type: object
620+
type: object
621+
type: array
622+
pods:
623+
additionalProperties:
624+
additionalProperties:
625+
items:
626+
type: string
627+
type: array
628+
type: object
629+
type: object
630+
shardAllocationEnabled:
631+
type: string
404632
type: object
405633
type: object
406634
version: v1

bundle/manifests/logging.openshift.io_kibanas_crd.yaml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,55 @@ spec:
156156
- managementState
157157
type: object
158158
status:
159-
type: object
159+
items:
160+
description: KibanaStatus defines the observed state of Kibana
161+
properties:
162+
clusterCondition:
163+
additionalProperties:
164+
items:
165+
properties:
166+
lastTransitionTime:
167+
description: Last time the condition transitioned from one
168+
status to another.
169+
format: date-time
170+
type: string
171+
message:
172+
description: Human-readable message indicating details about
173+
last transition.
174+
type: string
175+
reason:
176+
description: Unique, one-word, CamelCase reason for the condition's
177+
last transition.
178+
type: string
179+
status:
180+
type: string
181+
type:
182+
description: ClusterConditionType is a valid value for ClusterCondition.Type
183+
type: string
184+
required:
185+
- lastTransitionTime
186+
- status
187+
- type
188+
type: object
189+
type: array
190+
type: object
191+
deployment:
192+
type: string
193+
pods:
194+
additionalProperties:
195+
items:
196+
type: string
197+
type: array
198+
type: object
199+
replicaSets:
200+
items:
201+
type: string
202+
type: array
203+
replicas:
204+
format: int32
205+
type: integer
206+
type: object
207+
type: array
160208
type: object
161209
version: v1
162210
versions:

hack/generate-crd.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ source .bingo/variables.env
55
set -euo pipefail
66

77
MANIFESTS_DIR=${1:-"manifests/${OCP_VERSION}"}
8-
ES_CRD_FILE="logging.openshift.io_elasticsearches_crd.yaml"
9-
KB_CRD_FILE="logging.openshift.io_kibanas_crd.yaml"
108

119
echo "--------------------------------------------------------------"
1210
echo "Generate k8s golang code"
@@ -19,14 +17,6 @@ echo "--------------------------------------------------------------"
1917
$OPERATOR_SDK generate crds --crd-version v1beta1
2018
mv deploy/crds/*.yaml "${MANIFESTS_DIR}"
2119

22-
echo "---------------------------------------------------------------"
23-
echo "Kustomize: Patch CRDs for backward-compatibility"
24-
echo "---------------------------------------------------------------"
25-
oc kustomize "${MANIFESTS_DIR}" | \
26-
awk -v es="${MANIFESTS_DIR}/${ES_CRD_FILE}" \
27-
-v kb="${MANIFESTS_DIR}/${KB_CRD_FILE}"\
28-
'BEGIN{filename = es} /---/ {getline; filename = kb}{print $0> filename}'
29-
3020
echo "---------------------------------------------------------------"
3121
echo "Cleanup operator-sdk generation folder"
3222
echo "---------------------------------------------------------------"

manifests/4.6/crd-drop-status-validation-patch.yaml

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

manifests/4.6/kustomization.yaml

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

0 commit comments

Comments
 (0)