Skip to content
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
18 changes: 18 additions & 0 deletions apis/apps/v1alpha1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,10 @@ type VarSource struct {
// +optional
CredentialVarRef *CredentialVarSelector `json:"credentialVarRef,omitempty"`

// Selects a defined var of the TLS.
// +optional
TLSVarRef *TLSVarSelector `json:"tlsVarRef,omitempty"`

// Selects a defined var of a ServiceRef.
// +optional
ServiceRefVarRef *ServiceRefVarSelector `json:"serviceRefVarRef,omitempty"`
Expand Down Expand Up @@ -1127,6 +1131,12 @@ type CredentialVars struct {
Password *VarOption `json:"password,omitempty"`
}

// TLSVars defines the vars that can be referenced from the TLS.
type TLSVars struct {
// +optional
Enabled *VarOption `json:"enabled,omitempty"`
}

// ServiceRefVars defines the vars that can be referenced from a ServiceRef.
type ServiceRefVars struct {
// +optional
Expand Down Expand Up @@ -1166,6 +1176,14 @@ type CredentialVarSelector struct {
CredentialVars `json:",inline"`
}

// TLSVarSelector selects a var from the TLS.
type TLSVarSelector struct {
// The Component to select from.
ClusterObjectReference `json:",inline"`

TLSVars `json:",inline"`
}

// ServiceRefVarSelector selects a var from a ServiceRefDeclaration.
type ServiceRefVarSelector struct {
// The ServiceRefDeclaration to select from.
Expand Down
42 changes: 42 additions & 0 deletions apis/apps/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14612,6 +14612,86 @@ spec:
type: string
type: object
type: object
tlsVarRef:
description: Selects a defined var of the TLS.
properties:
compDef:
description: |-
Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition
custom resource (CR) used by the component that the referent object resident in.


If not specified, the component itself will be used.
type: string
enabled:
description: VarOption defines whether a variable is
required or optional.
enum:
- Required
- Optional
type: string
multipleClusterObjectOption:
description: |-
This option defines the behavior when multiple component objects match the specified @CompDef.
If not provided, an error will be raised when handling multiple matches.
properties:
combinedOption:
description: |-
Define the options for handling combined variables.
Valid only when the strategy is set to "combined".
properties:
flattenFormat:
description: 'The flatten format, default is:
$(comp-name-1):value,$(comp-name-2):value.'
properties:
delimiter:
default: ','
description: Pair delimiter.
type: string
keyValueDelimiter:
default: ':'
description: Key-value delimiter.
type: string
required:
- delimiter
- keyValueDelimiter
type: object
newVarSuffix:
description: |-
If set, the existing variable will be kept, and a new variable will be defined with the specified suffix
in pattern: $(var.name)_$(suffix).
The new variable will be auto-created and placed behind the existing one.
If not set, the existing variable will be reused with the value format defined below.
type: string
valueFormat:
default: Flatten
description: The format of the value that the
operator will use to compose values from multiple
components.
type: string
type: object
requireAllComponentObjects:
description: |-
RequireAllComponentObjects controls whether all component objects must exist before resolving.
If set to true, resolving will only proceed if all component objects are present.
type: boolean
strategy:
description: Define the strategy for handling multiple
cluster objects.
enum:
- individual
- combined
type: string
required:
- strategy
type: object
name:
description: Name of the referent object.
type: string
optional:
description: Specify whether the object must be defined.
type: boolean
type: object
type: object
required:
- name
Expand Down
80 changes: 80 additions & 0 deletions deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14612,6 +14612,86 @@ spec:
type: string
type: object
type: object
tlsVarRef:
description: Selects a defined var of the TLS.
properties:
compDef:
description: |-
Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition
custom resource (CR) used by the component that the referent object resident in.


If not specified, the component itself will be used.
type: string
enabled:
description: VarOption defines whether a variable is
required or optional.
enum:
- Required
- Optional
type: string
multipleClusterObjectOption:
description: |-
This option defines the behavior when multiple component objects match the specified @CompDef.
If not provided, an error will be raised when handling multiple matches.
properties:
combinedOption:
description: |-
Define the options for handling combined variables.
Valid only when the strategy is set to "combined".
properties:
flattenFormat:
description: 'The flatten format, default is:
$(comp-name-1):value,$(comp-name-2):value.'
properties:
delimiter:
default: ','
description: Pair delimiter.
type: string
keyValueDelimiter:
default: ':'
description: Key-value delimiter.
type: string
required:
- delimiter
- keyValueDelimiter
type: object
newVarSuffix:
description: |-
If set, the existing variable will be kept, and a new variable will be defined with the specified suffix
in pattern: $(var.name)_$(suffix).
The new variable will be auto-created and placed behind the existing one.
If not set, the existing variable will be reused with the value format defined below.
type: string
valueFormat:
default: Flatten
description: The format of the value that the
operator will use to compose values from multiple
components.
type: string
type: object
requireAllComponentObjects:
description: |-
RequireAllComponentObjects controls whether all component objects must exist before resolving.
If set to true, resolving will only proceed if all component objects are present.
type: boolean
strategy:
description: Define the strategy for handling multiple
cluster objects.
enum:
- individual
- combined
type: string
required:
- strategy
type: object
name:
description: Name of the referent object.
type: string
optional:
description: Specify whether the object must be defined.
type: boolean
type: object
type: object
required:
- name
Expand Down
98 changes: 96 additions & 2 deletions docs/developer_docs/api-reference/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -6439,7 +6439,7 @@ bool
<h3 id="apps.kubeblocks.io/v1alpha1.ClusterObjectReference">ClusterObjectReference
</h3>
<p>
(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.ComponentVarSelector">ComponentVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.CredentialVarSelector">CredentialVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.HostNetworkVarSelector">HostNetworkVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.ServiceRefVarSelector">ServiceRefVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.ServiceVarSelector">ServiceVarSelector</a>)
(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.ComponentVarSelector">ComponentVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.CredentialVarSelector">CredentialVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.HostNetworkVarSelector">HostNetworkVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.ServiceRefVarSelector">ServiceRefVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.ServiceVarSelector">ServiceVarSelector</a>, <a href="#apps.kubeblocks.io/v1alpha1.TLSVarSelector">TLSVarSelector</a>)
</p>
<div>
<p>ClusterObjectReference defines information to let you locate the referenced object inside the same Cluster.</p>
Expand Down Expand Up @@ -21914,6 +21914,86 @@ string
</tr>
</tbody>
</table>
<h3 id="apps.kubeblocks.io/v1alpha1.TLSVarSelector">TLSVarSelector
</h3>
<p>
(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.VarSource">VarSource</a>)
</p>
<div>
<p>TLSVarSelector selects a var from the TLS.</p>
</div>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>ClusterObjectReference</code><br/>
<em>
<a href="#apps.kubeblocks.io/v1alpha1.ClusterObjectReference">
ClusterObjectReference
</a>
</em>
</td>
<td>
<p>
(Members of <code>ClusterObjectReference</code> are embedded into this type.)
</p>
<p>The Component to select from.</p>
</td>
</tr>
<tr>
<td>
<code>TLSVars</code><br/>
<em>
<a href="#apps.kubeblocks.io/v1alpha1.TLSVars">
TLSVars
</a>
</em>
</td>
<td>
<p>
(Members of <code>TLSVars</code> are embedded into this type.)
</p>
</td>
</tr>
</tbody>
</table>
<h3 id="apps.kubeblocks.io/v1alpha1.TLSVars">TLSVars
</h3>
<p>
(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.TLSVarSelector">TLSVarSelector</a>)
</p>
<div>
<p>TLSVars defines the vars that can be referenced from the TLS.</p>
</div>
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>enabled</code><br/>
<em>
<a href="#apps.kubeblocks.io/v1alpha1.VarOption">
VarOption
</a>
</em>
</td>
<td>
<em>(Optional)</em>
</td>
</tr>
</tbody>
</table>
<h3 id="apps.kubeblocks.io/v1alpha1.TargetInstance">TargetInstance
</h3>
<p>
Expand Down Expand Up @@ -22561,7 +22641,7 @@ string
<h3 id="apps.kubeblocks.io/v1alpha1.VarOption">VarOption
(<code>string</code> alias)</h3>
<p>
(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.ComponentVars">ComponentVars</a>, <a href="#apps.kubeblocks.io/v1alpha1.CredentialVars">CredentialVars</a>, <a href="#apps.kubeblocks.io/v1alpha1.NamedVar">NamedVar</a>, <a href="#apps.kubeblocks.io/v1alpha1.ServiceRefVars">ServiceRefVars</a>, <a href="#apps.kubeblocks.io/v1alpha1.ServiceVars">ServiceVars</a>)
(<em>Appears on:</em><a href="#apps.kubeblocks.io/v1alpha1.ComponentVars">ComponentVars</a>, <a href="#apps.kubeblocks.io/v1alpha1.CredentialVars">CredentialVars</a>, <a href="#apps.kubeblocks.io/v1alpha1.NamedVar">NamedVar</a>, <a href="#apps.kubeblocks.io/v1alpha1.ServiceRefVars">ServiceRefVars</a>, <a href="#apps.kubeblocks.io/v1alpha1.ServiceVars">ServiceVars</a>, <a href="#apps.kubeblocks.io/v1alpha1.TLSVars">TLSVars</a>)
</p>
<div>
<p>VarOption defines whether a variable is required or optional.</p>
Expand Down Expand Up @@ -22654,6 +22734,20 @@ CredentialVarSelector
</tr>
<tr>
<td>
<code>tlsVarRef</code><br/>
<em>
<a href="#apps.kubeblocks.io/v1alpha1.TLSVarSelector">
TLSVarSelector
</a>
</em>
</td>
<td>
<em>(Optional)</em>
<p>Selects a defined var of the TLS.</p>
</td>
</tr>
<tr>
<td>
<code>serviceRefVarRef</code><br/>
<em>
<a href="#apps.kubeblocks.io/v1alpha1.ServiceRefVarSelector">
Expand Down
Loading