Skip to content
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

Merged
merged 2 commits into from
Feb 12, 2020
Merged

refactor: config logic for plugin #12

merged 2 commits into from
Feb 12, 2020

Conversation

jbrockopp
Copy link
Contributor

No description provided.

@jbrockopp jbrockopp added the enhancement Indicates an improvement to a feature label Feb 12, 2020
@jbrockopp jbrockopp requested a review from a team as a code owner February 12, 2020 15:50
@jbrockopp jbrockopp self-assigned this Feb 12, 2020
@jbrockopp jbrockopp mentioned this pull request Feb 12, 2020
@codecov
Copy link

codecov bot commented Feb 12, 2020

Codecov Report

Merging #12 into master will decrease coverage by 2.42%.
The diff coverage is 43.93%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
cmd/vela-kubernetes/main.go 0% <0%> (ø) ⬆️
cmd/vela-kubernetes/config.go 100% <100%> (ø) ⬆️
cmd/vela-kubernetes/plugin.go 100% <100%> (ø) ⬆️
cmd/vela-kubernetes/patch.go 100% <100%> (ø) ⬆️

Copy link
Contributor

@kneal kneal left a 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()
Copy link
Contributor

@plyr4 plyr4 Feb 12, 2020

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
}

Copy link
Contributor

@plyr4 plyr4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@plyr4 plyr4 merged commit 230c4da into master Feb 12, 2020
@plyr4 plyr4 deleted the refactor/config branch February 12, 2020 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates an improvement to a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants