-
Notifications
You must be signed in to change notification settings - Fork 237
Conversation
Signed-off-by: huanwei <huan@harmonycloud.cn>
Signed-off-by: huanwei <huan@harmonycloud.cn>
Signed-off-by: huanwei <huan@harmonycloud.cn>
@owainlewis |
@owainlewis FYI, @huanwei 's OCA has been reviewed and approved |
Signed-off-by: huanwei <huan@harmonycloud.cn>
@@ -28,7 +28,7 @@ import ( | |||
"k8s.io/client-go/kubernetes" | |||
"k8s.io/client-go/tools/clientcmd" | |||
|
|||
options "github.com/oracle/mysql-operator/cmd/mysql-operator/app/options" | |||
opratoropts "github.com/oracle/mysql-operator/pkg/options/operator" |
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.
Minor typo here (opratoropts => operatoropts)
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.
Thanks for the review.
@@ -45,15 +45,15 @@ const ( | |||
|
|||
// resyncPeriod computes the time interval a shared informer waits before | |||
// resyncing with the api server. | |||
func resyncPeriod(s *options.MySQLOperatorServer) func() time.Duration { | |||
func resyncPeriod(s *opratoropts.MySQLOperatorOpts) func() time.Duration { |
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.
Minor typo here (opratoropts => operatoropts)
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.
Thanks for the review.
return func() time.Duration { | ||
factor := rand.Float64() + 1 | ||
return time.Duration(float64(s.MinResyncPeriod.Nanoseconds()) * factor) | ||
} | ||
} | ||
|
||
// Run starts the mysql-operator controllers. This should never exit. | ||
func Run(s *options.MySQLOperatorServer) error { | ||
func Run(s *opratoropts.MySQLOperatorOpts) 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.
Minor typo here (opratoropts => operatoropts)
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.
Thanks for the review.
Thanks for this contribution @huanwei the changes seem reasonable to me in terms of code organisation. If you're happy to fix those typos then we'll get this merged. 👍 |
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.
Changes look good. Just a few minor typos and then we can merge.
Signed-off-by: huanwei <huan@harmonycloud.cn>
Use --decode for cross OS compatibility (oracle#187)
Signed-off-by: huanwei <huan@harmonycloud.cn>
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.
@owainlewis I have fixed the typos. Pls Kindly review. Thanks.
@@ -28,7 +28,7 @@ import ( | |||
"k8s.io/client-go/kubernetes" | |||
"k8s.io/client-go/tools/clientcmd" | |||
|
|||
options "github.com/oracle/mysql-operator/cmd/mysql-operator/app/options" | |||
opratoropts "github.com/oracle/mysql-operator/pkg/options/operator" |
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.
Thanks for the review.
return func() time.Duration { | ||
factor := rand.Float64() + 1 | ||
return time.Duration(float64(s.MinResyncPeriod.Nanoseconds()) * factor) | ||
} | ||
} | ||
|
||
// Run starts the mysql-operator controllers. This should never exit. | ||
func Run(s *options.MySQLOperatorServer) error { | ||
func Run(s *opratoropts.MySQLOperatorOpts) 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.
Thanks for the review.
@@ -45,15 +45,15 @@ const ( | |||
|
|||
// resyncPeriod computes the time interval a shared informer waits before | |||
// resyncing with the api server. | |||
func resyncPeriod(s *options.MySQLOperatorServer) func() time.Duration { | |||
func resyncPeriod(s *opratoropts.MySQLOperatorOpts) func() time.Duration { |
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.
Thanks for the review.
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.
@owainlewis I have fixed the typos. Pls review the changes. Thanks.
@@ -28,7 +28,7 @@ import ( | |||
"k8s.io/client-go/kubernetes" | |||
"k8s.io/client-go/tools/clientcmd" | |||
|
|||
options "github.com/oracle/mysql-operator/cmd/mysql-operator/app/options" | |||
operatoropts "github.com/oracle/mysql-operator/pkg/options/operator" |
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.
@owainlewis Pls review the change. Thanks.
@@ -45,15 +45,15 @@ const ( | |||
|
|||
// resyncPeriod computes the time interval a shared informer waits before | |||
// resyncing with the api server. | |||
func resyncPeriod(s *options.MySQLOperatorServer) func() time.Duration { | |||
func resyncPeriod(s *operatoropts.MySQLOperatorOpts) func() time.Duration { |
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.
@owainlewis Pls review the change. Thanks.
return func() time.Duration { | ||
factor := rand.Float64() + 1 | ||
return time.Duration(float64(s.MinResyncPeriod.Nanoseconds()) * factor) | ||
} | ||
} | ||
|
||
// Run starts the mysql-operator controllers. This should never exit. | ||
func Run(s *options.MySQLOperatorServer) error { | ||
func Run(s *operatoropts.MySQLOperatorOpts) 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.
@owainlewis Pls review the change. Thanks.
Code refactor on options (oracle#189)
1.Describe what this PR did
Refactor code structure on
options
.2.Does this pull request fix one issue?
During the debug and review of the program, I found the following codes in
mysql-operator/pkg
used/called the struct type of MySQLOperator Options defined inmysql-operator/cmd
, while the latter package should be recognized as the program’s entrypoint.It looked like the option packages in
mysql-operator/cmd/mysql-operator/app/options
andmysql-operator/cmd/mysql-agent/app/options
here were not in a good place, so I would like to to tiny refactor the code structure.3.Describe how you did it
I did the following changes:
4.Describe how to verify it
Compile the code, build the docker images, and verify the operator, agent and cluster on Kubernetes.