Skip to content

Commit

Permalink
Merge pull request #1890 from devopsmindset/kinesis-fix-1751
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterMX authored Oct 10, 2023
2 parents fd9a103 + ab907bf commit 1abd520
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/controller/kinesis/stream/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func SetupStream(mgr ctrl.Manager, o controller.Options) error {

reconcilerOpts := []managed.ReconcilerOption{
managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}),
managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())),
managed.WithInitializers(
managed.NewDefaultProviderConfig(mgr.GetClient()),
managed.NewNameAsExternalName(mgr.GetClient())),
managed.WithPollInterval(o.PollInterval),
managed.WithLogger(o.Logger.WithValues("controller", name)),
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
Expand Down Expand Up @@ -123,7 +127,6 @@ func postCreate(_ context.Context, cr *svcapitypes.Stream, obj *svcsdk.CreateStr
if err != nil {
return managed.ExternalCreation{}, err
}
meta.SetExternalName(cr, cr.Name)
return managed.ExternalCreation{ExternalNameAssigned: true}, nil
}

Expand Down Expand Up @@ -188,7 +191,7 @@ func (u *updater) update(ctx context.Context, mg resource.Managed) (managed.Exte

// we need information from stream for decisions
obj, err := u.client.DescribeStreamWithContext(ctx, &svcsdk.DescribeStreamInput{
StreamName: &cr.Name,
StreamName: awsclients.String(meta.GetExternalName(cr)),
})
if err != nil {
return managed.ExternalUpdate{}, awsclients.Wrap(err, errCreate)
Expand Down Expand Up @@ -375,7 +378,7 @@ func (u *updater) ActiveShards(cr *svcapitypes.Stream) (int64, error) {
var count int64

shards, err := u.client.ListShards(&svcsdk.ListShardsInput{
StreamName: &cr.Name,
StreamName: awsclients.String(meta.GetExternalName(cr)),
})
if err != nil {
return count, err
Expand All @@ -394,7 +397,7 @@ func (u *updater) ActiveShards(cr *svcapitypes.Stream) (int64, error) {
func (u *updater) ListTags(cr *svcapitypes.Stream) (*svcsdk.ListTagsForStreamOutput, error) {

tags, err := u.client.ListTagsForStream(&svcsdk.ListTagsForStreamInput{
StreamName: &cr.Name,
StreamName: awsclients.String(meta.GetExternalName(cr)),
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 1abd520

Please sign in to comment.