Skip to content

Commit

Permalink
fix: source key used twice (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso authored Nov 15, 2023
1 parent c3cff6a commit f3206bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions controllers/componentsubscription_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
rreconcile "github.com/fluxcd/pkg/runtime/reconcile"
"github.com/open-component-model/ocm-controller/pkg/event"
"github.com/open-component-model/ocm-controller/pkg/status"
"github.com/open-component-model/replication-controller/api/v1alpha1"
"github.com/open-component-model/replication-controller/pkg/ocm"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/fields"
Expand All @@ -33,6 +31,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

"github.com/open-component-model/replication-controller/api/v1alpha1"
"github.com/open-component-model/replication-controller/pkg/ocm"
)

// ComponentSubscriptionReconciler reconciles a ComponentSubscription object
Expand Down Expand Up @@ -66,7 +67,7 @@ func (r *ComponentSubscriptionReconciler) SetupWithManager(mgr ctrl.Manager) err
return fmt.Errorf("failed setting index fields: %w", err)
}

if err := mgr.GetFieldIndexer().IndexField(context.TODO(), &v1alpha1.ComponentSubscription{}, sourceKey, func(rawObj client.Object) []string {
if err := mgr.GetFieldIndexer().IndexField(context.TODO(), &v1alpha1.ComponentSubscription{}, destinationKey, func(rawObj client.Object) []string {
obj, ok := rawObj.(*v1alpha1.ComponentSubscription)
if !ok {
return []string{}
Expand Down
3 changes: 3 additions & 0 deletions docs/release_notes/v0.9.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Release v0.9.1

- fix: source key used twice (#79)
2 changes: 1 addition & 1 deletion pkg/version/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package version

// ReleaseVersion is the version number in semver format "vX.Y.Z", prefixed with "v".
var ReleaseVersion = "v0.9.0"
var ReleaseVersion = "v0.9.1"

// ReleaseCandidate is the release candidate ID in format "rc.X", which will be appended to the release version.
var ReleaseCandidate = "rc.1"

0 comments on commit f3206bf

Please sign in to comment.