Skip to content

Commit 7fa750f

Browse files
committed
Lint
1 parent 2ff668b commit 7fa750f

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

pkg/leaderelection/doc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ limitations under the License.
1717
/*
1818
Package leaderelection contains a constructors for a leader election resource lock
1919
*/
20-
2120
package leaderelection

pkg/leaderelection/fake/doc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ limitations under the License.
1818
Package fake mocks a resource lock for testing purposes.
1919
Always returns leadership.
2020
*/
21-
2221
package fake

pkg/leaderelection/fake/leader_election.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ import (
2828
"sigs.k8s.io/controller-runtime/pkg/recorder"
2929
)
3030

31-
// NewFakeResourceLock creates a new FakeResourceLock for use in testing
31+
// NewResourceLock creates a new ResourceLock for use in testing
3232
// leader election.
33-
func NewFakeResourceLock(config *rest.Config, recorderProvider recorder.Provider, options leaderelection.Options) (resourcelock.Interface, error) {
33+
func NewResourceLock(config *rest.Config, recorderProvider recorder.Provider, options leaderelection.Options) (resourcelock.Interface, error) {
3434
// Leader id, needs to be unique
3535
id, err := os.Hostname()
3636
if err != nil {
3737
return nil, err
3838
}
3939
id = id + "_" + string(uuid.NewUUID())
4040

41-
return &FakeResourceLock{
41+
return &ResourceLock{
4242
id: id,
4343
record: resourcelock.LeaderElectionRecord{
4444
HolderIdentity: id,
@@ -50,41 +50,41 @@ func NewFakeResourceLock(config *rest.Config, recorderProvider recorder.Provider
5050
}, nil
5151
}
5252

53-
// FakeResourceLock implements the ResourceLockInterface.
53+
// ResourceLock implements the ResourceLockInterface.
5454
// By default returns that the current identity holds the lock.
55-
type FakeResourceLock struct {
55+
type ResourceLock struct {
5656
id string
5757
record resourcelock.LeaderElectionRecord
5858
}
5959

6060
// Get implements the ResourceLockInterface.
61-
func (f *FakeResourceLock) Get() (*resourcelock.LeaderElectionRecord, error) {
61+
func (f *ResourceLock) Get() (*resourcelock.LeaderElectionRecord, error) {
6262
return &f.record, nil
6363
}
6464

6565
// Create implements the ResourceLockInterface.
66-
func (f *FakeResourceLock) Create(ler resourcelock.LeaderElectionRecord) error {
66+
func (f *ResourceLock) Create(ler resourcelock.LeaderElectionRecord) error {
6767
f.record = ler
6868
return nil
6969
}
7070

7171
// Update implements the ResourceLockInterface.
72-
func (f *FakeResourceLock) Update(ler resourcelock.LeaderElectionRecord) error {
72+
func (f *ResourceLock) Update(ler resourcelock.LeaderElectionRecord) error {
7373
f.record = ler
7474
return nil
7575
}
7676

7777
// RecordEvent implements the ResourceLockInterface.
78-
func (f *FakeResourceLock) RecordEvent(s string) {
78+
func (f *ResourceLock) RecordEvent(s string) {
7979
return
8080
}
8181

82-
// Idenity implements the ResourceLockInterface.
83-
func (f *FakeResourceLock) Identity() string {
82+
// Identity implements the ResourceLockInterface.
83+
func (f *ResourceLock) Identity() string {
8484
return f.id
8585
}
8686

8787
// Describe implements the ResourceLockInterface.
88-
func (f *FakeResourceLock) Describe() string {
88+
func (f *ResourceLock) Describe() string {
8989
return f.id
9090
}

pkg/manager/manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ var _ = Describe("manger.Manager", func() {
221221
LeaderElection: true,
222222
LeaderElectionID: "controller-runtime",
223223
LeaderElectionNamespace: "default",
224-
newResourceLock: fakeleaderelection.NewFakeResourceLock,
224+
newResourceLock: fakeleaderelection.NewResourceLock,
225225
})
226226
})
227227
})

0 commit comments

Comments
 (0)