Skip to content

Commit

Permalink
Merge pull request #384 from Xieql/914
Browse files Browse the repository at this point in the history
backup: update design of destination
  • Loading branch information
kurator-bot authored Sep 15, 2023
2 parents 1709fe3 + 8ce7eec commit 5734bb7
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 43 deletions.
11 changes: 4 additions & 7 deletions docs/content/en/references/backups_v1alpha1_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,8 @@ <h3 id="backup.kurator.dev/v1alpha1.Destination">Destination
</em>
</td>
<td>
<em>(Optional)</em>
<p>Fleet represents the name of a fleet which determines a set of clusters.
If Fleet is set, it will be used to determine the target clusters.
If users wish to specify clusters directly, they can use the Clusters field.</p>
<p>Fleet represents the name of a fleet which determines a set of target clusters within the namespace.
This field is required to identify the context for cluster selection.</p>
</td>
</tr>
<tr>
Expand All @@ -481,9 +479,8 @@ <h3 id="backup.kurator.dev/v1alpha1.Destination">Destination
</td>
<td>
<em>(Optional)</em>
<p>Clusters allows users to directly specify a set of destination clusters.
It should be used exclusively to select clusters described within the Fleet.
If Fleet is set, it takes precedence over the Clusters field.</p>
<p>Clusters allows users to specify a subset of clusters within the selected fleet for targeted operations.
If not set, it implies that the operation is targeted at all clusters within the specified fleet.</p>
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ spec:
be performed.
properties:
clusters:
description: Clusters allows users to directly specify a set of
destination clusters. It should be used exclusively to select
clusters described within the Fleet. If Fleet is set, it takes
precedence over the Clusters field.
description: Clusters allows users to specify a subset of clusters
within the selected fleet for targeted operations. If not set,
it implies that the operation is targeted at all clusters within
the specified fleet.
items:
description: "ObjectReference contains enough information to
let you inspect or modify the referred object. --- New uses
Expand Down Expand Up @@ -120,10 +120,11 @@ spec:
type: array
fleet:
description: Fleet represents the name of a fleet which determines
a set of clusters. If Fleet is set, it will be used to determine
the target clusters. If users wish to specify clusters directly,
they can use the Clusters field.
a set of target clusters within the namespace. This field is
required to identify the context for cluster selection.
type: string
required:
- fleet
type: object
policy:
description: Policy are the rules defining how backups should be performed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ spec:
to one or more TargetCluster.
properties:
clusters:
description: Clusters allows users to directly specify a set of
destination clusters. It should be used exclusively to select
clusters described within the Fleet. If Fleet is set, it takes
precedence over the Clusters field.
description: Clusters allows users to specify a subset of clusters
within the selected fleet for targeted operations. If not set,
it implies that the operation is targeted at all clusters within
the specified fleet.
items:
description: "ObjectReference contains enough information to
let you inspect or modify the referred object. --- New uses
Expand Down Expand Up @@ -383,19 +383,20 @@ spec:
type: array
fleet:
description: Fleet represents the name of a fleet which determines
a set of clusters. If Fleet is set, it will be used to determine
the target clusters. If users wish to specify clusters directly,
they can use the Clusters field.
a set of target clusters within the namespace. This field is
required to identify the context for cluster selection.
type: string
required:
- fleet
type: object
targetCluster:
description: TargetCluster represents the target clusters for migration.
properties:
clusters:
description: Clusters allows users to directly specify a set of
destination clusters. It should be used exclusively to select
clusters described within the Fleet. If Fleet is set, it takes
precedence over the Clusters field.
description: Clusters allows users to specify a subset of clusters
within the selected fleet for targeted operations. If not set,
it implies that the operation is targeted at all clusters within
the specified fleet.
items:
description: "ObjectReference contains enough information to
let you inspect or modify the referred object. --- New uses
Expand Down Expand Up @@ -461,10 +462,11 @@ spec:
type: array
fleet:
description: Fleet represents the name of a fleet which determines
a set of clusters. If Fleet is set, it will be used to determine
the target clusters. If users wish to specify clusters directly,
they can use the Clusters field.
a set of target clusters within the namespace. This field is
required to identify the context for cluster selection.
type: string
required:
- fleet
type: object
required:
- sourceCluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ spec:
will perform restore.
properties:
clusters:
description: Clusters allows users to directly specify a set of
destination clusters. It should be used exclusively to select
clusters described within the Fleet. If Fleet is set, it takes
precedence over the Clusters field.
description: Clusters allows users to specify a subset of clusters
within the selected fleet for targeted operations. If not set,
it implies that the operation is targeted at all clusters within
the specified fleet.
items:
description: "ObjectReference contains enough information to
let you inspect or modify the referred object. --- New uses
Expand Down Expand Up @@ -120,10 +120,11 @@ spec:
type: array
fleet:
description: Fleet represents the name of a fleet which determines
a set of clusters. If Fleet is set, it will be used to determine
the target clusters. If users wish to specify clusters directly,
they can use the Clusters field.
a set of target clusters within the namespace. This field is
required to identify the context for cluster selection.
type: string
required:
- fleet
type: object
policy:
description: Policy defines the customization rules for the restore.
Expand Down
14 changes: 6 additions & 8 deletions pkg/apis/backups/v1alpha1/common_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ import (

// Destination defines a target set of clusters, either through a fleet or by specifying them directly.
type Destination struct {
// Fleet represents the name of a fleet which determines a set of clusters.
// If Fleet is set, it will be used to determine the target clusters.
// If users wish to specify clusters directly, they can use the Clusters field.
// +optional
Fleet string `json:"fleet,omitempty"`
// Fleet represents the name of a fleet which determines a set of target clusters within the namespace.
// This field is required to identify the context for cluster selection.
// +required
Fleet string `json:"fleet"`

// Clusters allows users to directly specify a set of destination clusters.
// It should be used exclusively to select clusters described within the Fleet.
// If Fleet is set, it takes precedence over the Clusters field.
// Clusters allows users to specify a subset of clusters within the selected fleet for targeted operations.
// If not set, it implies that the operation is targeted at all clusters within the specified fleet.
// +optional
Clusters []*corev1.ObjectReference `json:"clusters,omitempty"`
}
Expand Down

0 comments on commit 5734bb7

Please sign in to comment.