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

feat(alm,install): adding in owner reference to deployment #84

Merged
merged 1 commit into from Oct 10, 2017

Conversation

charltonaustin
Copy link
Contributor

Description of Changes

Reviewer Checklist

  • It works!
  • Comments provide sufficient explanations for the next contributor
  • Tests cover changes and corner cases
  • Follows Quay syntax patterns and format

ecordell
ecordell previously approved these changes Oct 5, 2017
Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

LGTM after manual testing on CD

@ecordell
Copy link
Member

@charltonaustin it looks like the tests are having the same issue as the container

Kind: ownerType.Kind,
Name: owner.GetName(),
UID: types.UID(uuid.NewUUID()),
Controller: &NewFalse,
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One thing about that for tests is then the object names don't match up, but I think I can rewrite the matcher to fix that.

BlockOwnerDeletion: &NewTrue,
},
}
objectMeta := metav1.ObjectMeta{OwnerReferences: ownerReferences}
Copy link
Member

Choose a reason for hiding this comment

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

There's a SetOwnerReferences method on ObjectMeta

},
}
objectMeta := metav1.ObjectMeta{OwnerReferences: ownerReferences}
dep := v1beta1.Deployment{Spec: spec, ObjectMeta: objectMeta}
dep.Namespace = owner.Namespace
Copy link
Member

Choose a reason for hiding this comment

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

(there's also a SetNamespace and SetGenerateName and SetLabels if you don't mind changing those while you're here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't mind at all.

if !reflect.DeepEqual(actual.Labels, expected.Labels) {
return false
}
if len(actual.OwnerReferences) != 1 {
Copy link
Member

Choose a reason for hiding this comment

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

Any reason not to reflect.DeepEqual ownerreferences?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes because the UUID wasn't working, but if we are just using the parent obj uuid this problem goes away.

APIVersion: ownerType.APIVersion,
Kind: ownerType.Kind,
Name: owner.GetName(),
UID: types.UID(uuid.NewUUID()),
Copy link
Member

Choose a reason for hiding this comment

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

This id should be the uuid of the owning object, not a random one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright!

const InstallStrategyNameDeployment = "deployment"
const (
InstallStrategyNameDeployment = "deployment"

Copy link
Member

Choose a reason for hiding this comment

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

Extra line here

@charltonaustin charltonaustin force-pushed the ALM-142-add-owner-ref branch 3 times, most recently from 62d6f27 to 994aead Compare October 10, 2017 18:33
ecordell
ecordell previously approved these changes Oct 10, 2017
Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

LGTM

- [ ] It works!
- [ ] Comments provide sufficient explanations for the next contributor
- [ ] Tests cover changes and corner cases
- [ ] Follows Quay syntax patterns and format
Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

LGTM

@charltonaustin charltonaustin merged commit f464d67 into master Oct 10, 2017
@jzelinskie jzelinskie deleted the ALM-142-add-owner-ref branch October 10, 2017 20:17
njhale pushed a commit to njhale/operator-lifecycle-manager that referenced this pull request Sep 10, 2018
…owner-ref

feat(alm,install): adding in owner reference to deployment
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.

None yet

2 participants