Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ProviderConfig version to v1beta1 #95

Merged
merged 2 commits into from
Aug 30, 2021

Conversation

zzxwill
Copy link
Collaborator

@zzxwill zzxwill commented Jul 22, 2021

By upgrading the version of ProviderConfig to v1beta1 can fix the
build issue and simplify the process of managed resource connection.

Fixed the issue mentioned in #64 (comment)

Description of your changes

Fixes #

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

By upgrading the version of ProviderConfig to v1beta1 can fix the
build issue and simplify the process of managed resource connection.

Fixed the issue mentioned in crossplane-contrib#64 (comment)

Signed-off-by: zzxwill <[email protected]>
@@ -73,44 +71,16 @@ type machineGroupBindingConnector struct {
func (c *machineGroupBindingConnector) Connect(ctx context.Context, mg resource.Managed) (managed.ExternalClient, error) {
cr, ok := mg.(*aliv1alpha1.MachineGroupBinding)
if !ok {
return nil, errors.New(errNotMachineGroupBinding)
return nil, errors.New(errNotLogtail)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? This appears to be the ExternalConnector for the machine group binding type.

nn := types.NamespacedName{Namespace: sel.Namespace, Name: sel.Name}
if err := c.client.Get(ctx, nn, s); err != nil {
return nil, errors.Wrap(err, errGetConnectionSecret)
info, err := util.PrepareClient(ctx, mg, cr, c.client, c.usage, cr.Spec.ProviderConfigReference.Name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not introduced in this PR, but FWIW packages named util are considered an anti-pattern. See "bad package names" at https://blog.golang.org/package-names.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Fixing this bad package in #96.

@@ -72,44 +70,16 @@ type machineGroupConnector struct {
func (c *machineGroupConnector) Connect(ctx context.Context, mg resource.Managed) (managed.ExternalClient, error) {
cr, ok := mg.(*aliv1alpha1.MachineGroup)
if !ok {
return nil, errors.New(errNotMachineGroup)
return nil, errors.New(errNotLogtail)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like errNotMachineGroup was correct.

Signed-off-by: zzxwill <[email protected]>
@zzxwill zzxwill mentioned this pull request Jul 26, 2021
2 tasks
@zzxwill
Copy link
Collaborator Author

zzxwill commented Jul 26, 2021

@negz Addressed those two comments. I have also checked all the similar locations for all managed resources and they are correct. Thanks for pointing it out.

@zzxwill
Copy link
Collaborator Author

zzxwill commented Aug 19, 2021

@negz @hasheddan This PR is targeted to fix the corruption issue for the master branch. And the other two PRs are depended on this one. Thanks.

Copy link
Member

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zzxwill zzxwill merged commit 6a555ef into crossplane-contrib:master Aug 30, 2021
@zzxwill zzxwill deleted the fix-test branch August 30, 2021 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants