-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: config logic for plugin #12
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
==========================================
- Coverage 56.3% 53.88% -2.43%
==========================================
Files 8 7 -1
Lines 222 219 -3
==========================================
- Hits 125 118 -7
- Misses 97 101 +4
|
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 🐬
|
||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
// Config represents the plugin configuration for Kubernetes config information. | ||
var appFS = afero.NewOsFs() |
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.
just my opinion, but we could protect the initialization of this with sync.once
eg.
var (
appFS whateverthatis
setupOnce sync.Once
)
func InitAppFS() {
appFS = afero.NewOsFs()
}
func GetAppFS() *whateverthatis {
setupOnce.Do(InitAppFS)
return appFS
}
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
No description provided.