Skip to content

Commit

Permalink
Update Bucket API to v1
Browse files Browse the repository at this point in the history
Signed-off-by: Sunny <[email protected]>
  • Loading branch information
darkowlzz committed Sep 27, 2024
1 parent 1d1a06b commit 3d87349
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/spec/v1/kustomizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Artifact containing the YAML manifests. It has two required fields:
- `kind`: The Kind of the referred Source object. Supported Source types:
+ [GitRepository](https://github.com/fluxcd/source-controller/blob/main/docs/spec/v1/gitrepositories.md)
+ [OCIRepository](https://github.com/fluxcd/source-controller/blob/main/docs/spec/v1beta2/ocirepositories.md)
+ [Bucket](https://github.com/fluxcd/source-controller/blob/main/docs/spec/v1beta2/buckets.md)
+ [Bucket](https://github.com/fluxcd/source-controller/blob/main/docs/spec/v1/buckets.md)
- `name`: The Name of the referred Source object.

#### Cross-namespace references
Expand Down
8 changes: 4 additions & 4 deletions internal/controller/kustomization_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (r *KustomizationReconciler) SetupWithManager(ctx context.Context, mgr ctrl

// Index the Kustomizations by the Bucket references they (may) point at.
if err := mgr.GetCache().IndexField(ctx, &kustomizev1.Kustomization{}, bucketIndexKey,
r.indexBy(sourcev1b2.BucketKind)); err != nil {
r.indexBy(sourcev1.BucketKind)); err != nil {
return fmt.Errorf("failed setting index fields: %w", err)
}

Expand All @@ -155,7 +155,7 @@ func (r *KustomizationReconciler) SetupWithManager(ctx context.Context, mgr ctrl
builder.WithPredicates(SourceRevisionChangePredicate{}),
).
Watches(
&sourcev1b2.Bucket{},
&sourcev1.Bucket{},
handler.EnqueueRequestsFromMapFunc(r.requestsForRevisionChangeOf(bucketIndexKey)),
builder.WithPredicates(SourceRevisionChangePredicate{}),
).
Expand Down Expand Up @@ -561,8 +561,8 @@ func (r *KustomizationReconciler) getSource(ctx context.Context,
return src, fmt.Errorf("unable to get source '%s': %w", namespacedName, err)
}
src = &repository
case sourcev1b2.BucketKind:
var bucket sourcev1b2.Bucket
case sourcev1.BucketKind:
var bucket sourcev1.Bucket
err := r.Client.Get(ctx, namespacedName, &bucket)
if err != nil {
if apierrors.IsNotFound(err) {
Expand Down

0 comments on commit 3d87349

Please sign in to comment.