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
Bug 1961317: Adding static assets to related objects #175
Bug 1961317: Adding static assets to related objects #175
Conversation
@Elbehery: This pull request references Bugzilla bug 1961317, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Bugzilla (wduan@redhat.com), skipping review request. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
642d904
to
20cb777
Compare
running bool | ||
mgr manager.ControllerManager | ||
running bool | ||
ctrlRelatedObjects func() []configv1.ObjectReference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add error
return to the function
objs, err := src.RelatedObjects() | ||
if err != nil { | ||
// TODO : error msg or aggregate error | ||
klog.Errorf("Can not find RelatedObjects, got %v", err) | ||
} else { | ||
ctrlRelatedObjects = func() []configv1.ObjectReference { | ||
return objs | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move src.RelatedObjects
call to returned func() ([]configv1.ObjectReference, error)
and call it during sync() - it can have proper error handling there and automatic retry on random API server error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RelatedObject( ) can be only called from StaticResourceController .. Since we use type ControllerManager within csiDriverControllerManager , its not possible to call it within Sync()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually thats why we added the funktor, so it has the related objects within the scope of Sync()
and then we get the data from it, afterwards the funktor it self is garbage
collected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctrlRelatedObjects = func() ([]configv1.ObjectReference, error) {
return src.RelatedObjects()
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I c, I thought u want everything in Sync .. ok On it 👍🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsafrane Done 👍🏽
20cb777
to
2e96b3d
Compare
running bool | ||
mgr manager.ControllerManager | ||
running bool | ||
ctrlRelatedObjects func() ([]configv1.ObjectReference, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks worthy of an interface to me. I won't stick on the first one I see, but I'm likely to stick on it when we grow another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 👍🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make an interface for this, the rest is lgtm
2e96b3d
to
0c32190
Compare
/retest |
1 similar comment
/retest |
/bugzilla refresh The main branch will open for development of next OCP version. Recalculating validity of PRs linked to this PR. |
@openshift-bot: This pull request references Bugzilla bug 1961317, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh The main branch will open for development of next OCP version. Recalculating validity of PRs linked to this PR. |
@openshift-bot: This pull request references Bugzilla bug 1961317, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh |
@Elbehery: This pull request references Bugzilla bug 1961317, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -152,7 +160,7 @@ func (c *CSIDriverStarterController) sync(ctx context.Context, syncCtx factory.S | |||
Name: ctrl.operatorConfig.CSIDriverName, | |||
}) | |||
// add static assets | |||
objs, err := ctrl.ctrlRelatedObjects() | |||
objs, err := ctrl.getRelatedObjects() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's worth having separate getRelatedObjects
function, you can call ctrl.ctrlRelatedObjects,RelatedObjects()
directly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽
c60a431
to
464599c
Compare
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Elbehery, jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1961317, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/bugzilla refresh |
@Elbehery: This pull request references Bugzilla bug 1961317, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Bugzilla (wduan@redhat.com), skipping review request. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@Elbehery: All pull requests linked via external trackers have merged: Bugzilla bug 1961317 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This PR parses operator static assets, into operator related objects.
This PR depends on openshift/library-go#1099