Skip to content

Commit

Permalink
Document properties of lookup crd
Browse files Browse the repository at this point in the history
  • Loading branch information
MrLarssonJr committed Jul 12, 2024
1 parent bf187ca commit 08365c2
Show file tree
Hide file tree
Showing 4 changed files with 437 additions and 8 deletions.
28 changes: 28 additions & 0 deletions apis/druid/v1alpha1/druidlookup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,46 +31,74 @@ import (
type DruidLookupSpec struct {
// Important: Run "make" to regenerate code after modifying this file

// The name of the druid cluster to apply the lookup in.
//
// Assumed to be within the same k8s namespace.
// +required
DruidCluster v1.LocalObjectReference `json:"druidCluster"`

// The tier to put the lookup in.
// +optional
// +kubebuilder:default:=__default
Tier string `json:"tier"`

// Lookup template.
//
// Any stringified json value that is applicable in the `lookupExtractorFactory` field.
//
// Please see https://druid.apache.org/docs/latest/api-reference/lookups-api#update-lookup.
// +required
Template string `json:"template"`
}

// DruidLookupStatus defines the observed state of DruidLookup
type DruidLookupStatus struct {

// `true` if the druid cluster has reported that the lookup is loaded on all relevant nodes, otherwise false.
// +optional
Loaded *bool `json:"loaded,omitempty"`

// A list of the nodes that the druid cluster reports to yet have loaded the lookup.
// +optional
PendingNodes []string `json:"pendingNodes,omitempty"`

// The number of nodes that the druid cluster reports to yet have loaded the lookup.
//
// (Exists in conjunction with `PendingNodes` to facilitate displaying this summary using kubebuilders print column feature.)
// +optional
NumberOfPendingNodes *int `json:"numberOfPendingNodes,omitempty"`

// The druid cluster that the last successful application of this lookup happened in.
//
// Used to determine if changes require old lookup to be deleted.
// +optional
LastClusterAppliedIn v1.LocalObjectReference `json:"lastClusterAppliedIn"`

// The tier that the last successful application of this lookup happened in.
//
// Used to determine if changes require old lookup to be deleted.
// +optional
LastTierAppliedIn string `json:"lastTierAppliedIn"`

// The template that the last successful application of this lookup applied.
//
// Used to determine if changes require old lookup to be deleted.
// +optional
LastAppliedTemplate string `json:"lastAppliedTemplate,omitempty"`

// The time that the last successful application of this lookup happened at.
// +optional
LastSuccessfulUpdateAt *metav1.Time `json:"lastSuccessfulUpdateAt,omitempty"`

// The time that the last attempt to apply this lookup happened at.
// +optional
LastUpdateAttemptAt *metav1.Time `json:"lastUpdateAttemptAt,omitempty"`

// `true` if the last application attempt were successful, `false` otherwise.
// +optional
LastUpdateAttemptSuccessful bool `json:"lastUpdateAttemptSuccessful,omitempty"`

// If the last application attempt failed, this property contains the associated error message, otherwise unset.
// +optional
ErrorMessage string `json:"errorMessage,omitempty"`
}
Expand Down
48 changes: 44 additions & 4 deletions chart/crds/druid.apache.org_druidlookups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ spec:
properties:
druidCluster:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
The name of the druid cluster to apply the lookup in.
Assumed to be within the same k8s namespace.
properties:
name:
description: |-
Expand All @@ -78,9 +80,18 @@ spec:
type: object
x-kubernetes-map-type: atomic
template:
description: |-
Lookup template.
Any stringified json value that is applicable in the `lookupExtractorFactory` field.
Please see https://druid.apache.org/docs/latest/api-reference/lookups-api#update-lookup.
type: string
tier:
default: __default
description: The tier to put the lookup in.
type: string
required:
- druidCluster
Expand All @@ -90,13 +101,22 @@ spec:
description: DruidLookupStatus defines the observed state of DruidLookup
properties:
errorMessage:
description: If the last application attempt failed, this property
contains the associated error message, otherwise unset.
type: string
lastAppliedTemplate:
description: |-
The template that the last successful application of this lookup applied.
Used to determine if changes require old lookup to be deleted.
type: string
lastClusterAppliedIn:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
The druid cluster that the last successful application of this lookup happened in.
Used to determine if changes require old lookup to be deleted.
properties:
name:
description: |-
Expand All @@ -107,20 +127,40 @@ spec:
type: object
x-kubernetes-map-type: atomic
lastSuccessfulUpdateAt:
description: The time that the last successful application of this
lookup happened at.
format: date-time
type: string
lastTierAppliedIn:
description: |-
The tier that the last successful application of this lookup happened in.
Used to determine if changes require old lookup to be deleted.
type: string
lastUpdateAttemptAt:
description: The time that the last attempt to apply this lookup happened
at.
format: date-time
type: string
lastUpdateAttemptSuccessful:
description: '`true` if the last application attempt were successful,
`false` otherwise.'
type: boolean
loaded:
description: '`true` if the druid cluster has reported that the lookup
is loaded on all relevant nodes, otherwise false.'
type: boolean
numberOfPendingNodes:
description: |-
The number of nodes that the druid cluster reports to yet have loaded the lookup.
(Exists in conjunction with `PendingNodes` to facilitate displaying this summary using kubebuilders print column feature.)
type: integer
pendingNodes:
description: A list of the nodes that the druid cluster reports to
yet have loaded the lookup.
items:
type: string
type: array
Expand Down
48 changes: 44 additions & 4 deletions config/crd/bases/druid.apache.org_druidlookups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ spec:
properties:
druidCluster:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
The name of the druid cluster to apply the lookup in.
Assumed to be within the same k8s namespace.
properties:
name:
description: |-
Expand All @@ -78,9 +80,18 @@ spec:
type: object
x-kubernetes-map-type: atomic
template:
description: |-
Lookup template.
Any stringified json value that is applicable in the `lookupExtractorFactory` field.
Please see https://druid.apache.org/docs/latest/api-reference/lookups-api#update-lookup.
type: string
tier:
default: __default
description: The tier to put the lookup in.
type: string
required:
- druidCluster
Expand All @@ -90,13 +101,22 @@ spec:
description: DruidLookupStatus defines the observed state of DruidLookup
properties:
errorMessage:
description: If the last application attempt failed, this property
contains the associated error message, otherwise unset.
type: string
lastAppliedTemplate:
description: |-
The template that the last successful application of this lookup applied.
Used to determine if changes require old lookup to be deleted.
type: string
lastClusterAppliedIn:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
The druid cluster that the last successful application of this lookup happened in.
Used to determine if changes require old lookup to be deleted.
properties:
name:
description: |-
Expand All @@ -107,20 +127,40 @@ spec:
type: object
x-kubernetes-map-type: atomic
lastSuccessfulUpdateAt:
description: The time that the last successful application of this
lookup happened at.
format: date-time
type: string
lastTierAppliedIn:
description: |-
The tier that the last successful application of this lookup happened in.
Used to determine if changes require old lookup to be deleted.
type: string
lastUpdateAttemptAt:
description: The time that the last attempt to apply this lookup happened
at.
format: date-time
type: string
lastUpdateAttemptSuccessful:
description: '`true` if the last application attempt were successful,
`false` otherwise.'
type: boolean
loaded:
description: '`true` if the druid cluster has reported that the lookup
is loaded on all relevant nodes, otherwise false.'
type: boolean
numberOfPendingNodes:
description: |-
The number of nodes that the druid cluster reports to yet have loaded the lookup.
(Exists in conjunction with `PendingNodes` to facilitate displaying this summary using kubebuilders print column feature.)
type: integer
pendingNodes:
description: A list of the nodes that the druid cluster reports to
yet have loaded the lookup.
items:
type: string
type: array
Expand Down
Loading

0 comments on commit 08365c2

Please sign in to comment.