-
Notifications
You must be signed in to change notification settings - Fork 288
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
Separate kubeconfig operations from cluster manager #7267
Conversation
Skipping CI for Draft Pull Request. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7267 +/- ##
==========================================
+ Coverage 71.64% 71.71% +0.07%
==========================================
Files 556 559 +3
Lines 43190 43368 +178
==========================================
+ Hits 30943 31101 +158
- Misses 10537 10551 +14
- Partials 1710 1716 +6 ☔ View full report in Codecov by Sentry. |
cct.writer.EXPECT().Create(gomock.Any(), gomock.Any(), gomock.Any()).Return(os.NewFile(uintptr(*pointer.Uint(1)), "test"), "", nil) | ||
} | ||
|
||
func (cct *clusterCreatorTest) expectWriteKubeconfig() { | ||
cct.kubeconfigWriter.EXPECT().WriteKubeconfig(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil) | ||
} | ||
|
||
func (cct *clusterCreatorTest) expectApplierRun() { | ||
cct.applier.EXPECT().Run(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil) |
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.
is there a way we can expect a bit more than any?
there is a bit more logic in this code than just calling those methods
The methods need to be called with the right arguments
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.
I'm not sure how to expect something specific for second and third arguments for filewriter's Create method, but I changed everything else.
/retest |
64ffbf6
to
5bcfe86
Compare
Can we update the description and squash the commits? |
5bcfe86
to
7016b3b
Compare
03bbf25
to
9209b52
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tatlat 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 |
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.
/lgtm
Issue #, if available:
#7110 (comment)
Description of changes:
These changes separate some functionality from ClusterManager into a new component which is solely responsible for writing the kubeconfig file. Unlike ClusterManager which used clusterctl to get the kubeconfig, the new component gets the kubeconfig content from the cluster's kubeconfig secret. Another higher level abstraction called ClusterCreator was also added which groups the Applier with the kubeconfig writer.
Testing (if applicable):
Manual testing with docker and cloudstack.
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.