Skip to content

Commit a6d7948

Browse files
committed
Bucket: Add status.observedIgnore
Introduce status.observedIgnore in the Bucket API for consistency with other sources with ignore. Signed-off-by: Sunny <[email protected]>
1 parent e996848 commit a6d7948

File tree

6 files changed

+47
-0
lines changed

6 files changed

+47
-0
lines changed

api/v1beta2/bucket_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ type BucketStatus struct {
128128
// +optional
129129
Artifact *Artifact `json:"artifact,omitempty"`
130130

131+
// ObservedIgnore is the observed exclusion patterns used for constructing
132+
// the source artifact.
133+
// +optional
134+
ObservedIgnore *string `json:"observedIgnore,omitempty"`
135+
131136
meta.ReconcileRequestStatus `json:",inline"`
132137
}
133138

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,10 @@ spec:
492492
the Bucket object.
493493
format: int64
494494
type: integer
495+
observedIgnore:
496+
description: ObservedIgnore is the observed exclusion patterns used
497+
for constructing the source artifact.
498+
type: string
495499
url:
496500
description: URL is the dynamic fetch link for the latest Artifact.
497501
It is provided on a "best effort" basis, and using the precise BucketStatus.Artifact

controllers/bucket_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ func (r *BucketReconciler) reconcileArtifact(ctx context.Context, obj *sourcev1.
628628

629629
// Record it on the object
630630
obj.Status.Artifact = artifact.DeepCopy()
631+
obj.Status.ObservedIgnore = obj.Spec.Ignore
631632

632633
// Update symlink on a "best effort" basis
633634
url, err := r.Storage.Symlink(artifact, "latest.tar.gz")

docs/api/source.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,19 @@ Artifact
15181518
</tr>
15191519
<tr>
15201520
<td>
1521+
<code>observedIgnore</code><br>
1522+
<em>
1523+
string
1524+
</em>
1525+
</td>
1526+
<td>
1527+
<em>(Optional)</em>
1528+
<p>ObservedIgnore is the observed exclusion patterns used for constructing
1529+
the source artifact.</p>
1530+
</td>
1531+
</tr>
1532+
<tr>
1533+
<td>
15211534
<code>ReconcileRequestStatus</code><br>
15221535
<em>
15231536
<a href="https://godoc.org/github.com/fluxcd/pkg/apis/meta#ReconcileRequestStatus">

docs/spec/v1beta2/buckets.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,25 @@ Note that a Bucket can be [reconciling](#reconciling-bucket) while failing at
10641064
the same time, for example due to a newly introduced configuration issue in the
10651065
Bucket spec.
10661066

1067+
### Observed Ignore
1068+
1069+
The source-controller reports an observed ignore in the Bucket's
1070+
`.status.observedIgnore`. The observed ignore is the latest `.spec.ignore` value
1071+
which resulted in a [ready state](#ready-bucket), or stalled due to error
1072+
it can not recover from without human intervention. The value is the same as the
1073+
[ignore in spec](#ignore). It indicates the ignore rules used in building the
1074+
current artifact in storage.
1075+
1076+
Example:
1077+
```yaml
1078+
status:
1079+
...
1080+
observedIgnore: |
1081+
hpa.yaml
1082+
build
1083+
...
1084+
```
1085+
10671086
### Observed Generation
10681087

10691088
The source-controller reports an

0 commit comments

Comments
 (0)