Skip to content
Closed
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
33 changes: 32 additions & 1 deletion api/v1alpha1/pluginpreset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
type PluginPresetSpec struct {

// PluginSpec is the spec of the plugin to be deployed by the PluginPreset.
Plugin PluginSpec `json:"plugin"`
Plugin PluginPresetPluginSpec `json:"plugin"`

// ClusterSelector is a label selector to select the clusters the plugin bundle should be deployed to.
ClusterSelector metav1.LabelSelector `json:"clusterSelector"`
Expand All @@ -52,6 +52,37 @@ type ClusterOptionOverride struct {
Overrides []PluginOptionValue `json:"overrides"`
}

// PluginPresetPluginSpec defines the desired state of PluginPreset's PluginSpec
type PluginPresetPluginSpec struct {
// PluginDefinition is the name of the PluginDefinition this instance is for.
//
// Deprecated: Use PluginDefinitionRef instead. Future releases of greenhouse will remove this field.
PluginDefinition string `json:"pluginDefinition"`

// PluginDefinitionRef is the reference to the (Cluster-)PluginDefinition.
PluginDefinitionRef PluginDefinitionReference `json:"pluginDefinitionRef"`

// DisplayName is an optional name for the Plugin to be displayed in the Greenhouse UI.
// This is especially helpful to distinguish multiple instances of a PluginDefinition in the same context.
// Defaults to a normalized version of metadata.name.
DisplayName string `json:"displayName,omitempty"`

// Values are the values for a PluginDefinition instance.
OptionValues []PluginOptionValue `json:"optionValues,omitempty"`

// ReleaseNamespace is the namespace in the remote cluster to which the backend is deployed.
// Defaults to the Greenhouse managed namespace if not set.
ReleaseNamespace string `json:"releaseNamespace,omitempty"`

// ReleaseName is the name of the helm release in the remote cluster to which the backend is deployed.
// If the Plugin was already deployed, the Plugin's name is used as the release name.
// If this Plugin is newly created, the releaseName is defaulted to the PluginDefinitions HelmChart name.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ReleaseName is immutable"
// +kubebuilder:validation:MaxLength=53
ReleaseName string `json:"releaseName,omitempty"`
}

const (
// PluginSkippedCondition is set when the pluginPreset encounters a non-managed plugin.
PluginSkippedCondition greenhousemetav1alpha1.ConditionType = "PluginSkipped"
Expand Down
23 changes: 23 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

27 changes: 0 additions & 27 deletions charts/manager/crds/greenhouse.sap_pluginpresets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ spec:
description: PluginSpec is the spec of the plugin to be deployed by
the PluginPreset.
properties:
clusterName:
description: ClusterName is the name of the cluster the plugin
is deployed to. If not set, the plugin is deployed to the greenhouse
cluster.
type: string
displayName:
description: |-
DisplayName is an optional name for the Plugin to be displayed in the Greenhouse UI.
Expand Down Expand Up @@ -254,28 +249,6 @@ spec:
ReleaseNamespace is the namespace in the remote cluster to which the backend is deployed.
Defaults to the Greenhouse managed namespace if not set.
type: string
waitFor:
description: WaitFor defines other Plugins to wait for before
installing this Plugin.
items:
description: WaitForItem is a wrapper around PluginRef to add
context for every WaitFor list item.
properties:
pluginRef:
description: PluginRef defines a reference to the Plugin.
properties:
name:
description: Name of the Plugin.
type: string
pluginPreset:
description: PluginPreset is the name of the PluginPreset
which creates the Plugin.
type: string
type: object
required:
- pluginRef
type: object
type: array
required:
- pluginDefinition
- pluginDefinitionRef
Expand Down
110 changes: 104 additions & 6 deletions docs/reference/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,7 @@ <h3 id="greenhouse.sap/v1alpha1.PluginDefinitionReference">PluginDefinitionRefer
</h3>
<p>
(<em>Appears on:</em>
<a href="#greenhouse.sap/v1alpha1.PluginPresetPluginSpec">PluginPresetPluginSpec</a>,
<a href="#greenhouse.sap/v1alpha1.PluginSpec">PluginSpec</a>)
</p>
<p>PluginDefinitionReference defines the reference to the PluginDefinition or ClusterPluginDefinition.</p>
Expand Down Expand Up @@ -2691,6 +2692,7 @@ <h3 id="greenhouse.sap/v1alpha1.PluginOptionValue">PluginOptionValue
<p>
(<em>Appears on:</em>
<a href="#greenhouse.sap/v1alpha1.ClusterOptionOverride">ClusterOptionOverride</a>,
<a href="#greenhouse.sap/v1alpha1.PluginPresetPluginSpec">PluginPresetPluginSpec</a>,
<a href="#greenhouse.sap/v1alpha1.PluginSpec">PluginSpec</a>)
</p>
<p>PluginOptionValue is the value for a PluginOption.</p>
Expand Down Expand Up @@ -2801,8 +2803,8 @@ <h3 id="greenhouse.sap/v1alpha1.PluginPreset">PluginPreset
<td>
<code>plugin</code><br>
<em>
<a href="#greenhouse.sap/v1alpha1.PluginSpec">
PluginSpec
<a href="#greenhouse.sap/v1alpha1.PluginPresetPluginSpec">
PluginPresetPluginSpec
</a>
</em>
</td>
Expand Down Expand Up @@ -2880,6 +2882,103 @@ <h3 id="greenhouse.sap/v1alpha1.PluginPreset">PluginPreset
</table>
</div>
</div>
<h3 id="greenhouse.sap/v1alpha1.PluginPresetPluginSpec">PluginPresetPluginSpec
</h3>
<p>
(<em>Appears on:</em>
<a href="#greenhouse.sap/v1alpha1.PluginPresetSpec">PluginPresetSpec</a>)
</p>
<p>PluginPresetPluginSpec defines the desired state of PluginPreset&rsquo;s PluginSpec</p>
<div class="md-typeset__scrollwrap">
<div class="md-typeset__table">
<table>
<thead>
<tr>
<th>Field</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>pluginDefinition</code><br>
<em>
string
</em>
</td>
<td>
<p>PluginDefinition is the name of the PluginDefinition this instance is for.</p>
<p>Deprecated: Use PluginDefinitionRef instead. Future releases of greenhouse will remove this field.</p>
</td>
</tr>
<tr>
<td>
<code>pluginDefinitionRef</code><br>
<em>
<a href="#greenhouse.sap/v1alpha1.PluginDefinitionReference">
PluginDefinitionReference
</a>
</em>
</td>
<td>
<p>PluginDefinitionRef is the reference to the (Cluster-)PluginDefinition.</p>
</td>
</tr>
<tr>
<td>
<code>displayName</code><br>
<em>
string
</em>
</td>
<td>
<p>DisplayName is an optional name for the Plugin to be displayed in the Greenhouse UI.
This is especially helpful to distinguish multiple instances of a PluginDefinition in the same context.
Defaults to a normalized version of metadata.name.</p>
</td>
</tr>
<tr>
<td>
<code>optionValues</code><br>
<em>
<a href="#greenhouse.sap/v1alpha1.PluginOptionValue">
[]PluginOptionValue
</a>
</em>
</td>
<td>
<p>Values are the values for a PluginDefinition instance.</p>
</td>
</tr>
<tr>
<td>
<code>releaseNamespace</code><br>
<em>
string
</em>
</td>
<td>
<p>ReleaseNamespace is the namespace in the remote cluster to which the backend is deployed.
Defaults to the Greenhouse managed namespace if not set.</p>
</td>
</tr>
<tr>
<td>
<code>releaseName</code><br>
<em>
string
</em>
</td>
<td>
<p>ReleaseName is the name of the helm release in the remote cluster to which the backend is deployed.
If the Plugin was already deployed, the Plugin&rsquo;s name is used as the release name.
If this Plugin is newly created, the releaseName is defaulted to the PluginDefinitions HelmChart name.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<h3 id="greenhouse.sap/v1alpha1.PluginPresetSpec">PluginPresetSpec
</h3>
<p>
Expand All @@ -2901,8 +3000,8 @@ <h3 id="greenhouse.sap/v1alpha1.PluginPresetSpec">PluginPresetSpec
<td>
<code>plugin</code><br>
<em>
<a href="#greenhouse.sap/v1alpha1.PluginSpec">
PluginSpec
<a href="#greenhouse.sap/v1alpha1.PluginPresetPluginSpec">
PluginPresetPluginSpec
</a>
</em>
</td>
Expand Down Expand Up @@ -3092,8 +3191,7 @@ <h3 id="greenhouse.sap/v1alpha1.PluginSpec">PluginSpec
</h3>
<p>
(<em>Appears on:</em>
<a href="#greenhouse.sap/v1alpha1.Plugin">Plugin</a>,
<a href="#greenhouse.sap/v1alpha1.PluginPresetSpec">PluginPresetSpec</a>)
<a href="#greenhouse.sap/v1alpha1.Plugin">Plugin</a>)
</p>
<p>PluginSpec defines the desired state of Plugin</p>
<div class="md-typeset__scrollwrap">
Expand Down
22 changes: 0 additions & 22 deletions docs/reference/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,6 @@ components:
plugin:
description: PluginSpec is the spec of the plugin to be deployed by the PluginPreset.
properties:
clusterName:
description: ClusterName is the name of the cluster the plugin is deployed to. If not set, the plugin is deployed to the greenhouse cluster.
type: string
displayName:
description: |-
DisplayName is an optional name for the Plugin to be displayed in the Greenhouse UI.
Expand Down Expand Up @@ -1191,25 +1188,6 @@ components:
ReleaseNamespace is the namespace in the remote cluster to which the backend is deployed.
Defaults to the Greenhouse managed namespace if not set.
type: string
waitFor:
description: WaitFor defines other Plugins to wait for before installing this Plugin.
items:
description: WaitForItem is a wrapper around PluginRef to add context for every WaitFor list item.
properties:
pluginRef:
description: PluginRef defines a reference to the Plugin.
properties:
name:
description: Name of the Plugin.
type: string
pluginPreset:
description: PluginPreset is the name of the PluginPreset which creates the Plugin.
type: string
type: object
required:
- pluginRef
type: object
type: array
required:
- pluginDefinition
- pluginDefinitionRef
Expand Down
Loading
Loading