This repository was archived by the owner on May 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 237
Code refactor on options #189
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b076468
tiny refactor code structure
huanwei 80a01a9
tiny refactor code structure
huanwei 3324a89
tiny refactor code structure
huanwei c7e5e53
refactor on options
huanwei a5f06fd
fix typo operatoropts
huanwei 9e6a658
Merge pull request #4 from oracle/master
huanwei c0f6e82
fix conflicts
huanwei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
backupcontroller "github.com/oracle/mysql-operator/pkg/controllers/backup" | ||
backupschedule "github.com/oracle/mysql-operator/pkg/controllers/backup/schedule" | ||
cluster "github.com/oracle/mysql-operator/pkg/controllers/cluster" | ||
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. @owainlewis Pls review the change. Thanks. |
||
kubeconfig, err := clientcmd.BuildConfigFromFlags(s.Master, s.KubeConfig) | ||
if err != nil { | ||
return err | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.