Skip to content

Commit caf49d1

Browse files
yevgeny-shnaidmank8s-ci-robot
authored andcommitted
Fixing buildsignpodmanager Status constants
When defining constants for Status type, the type must also be defined, otherwise those value are of type string
1 parent 893ac6c commit caf49d1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: internal/pod/buildsignpodmanager.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ const (
1818
PodTypeBuild = "build"
1919
PodTypeSign = "sign"
2020

21-
StatusCompleted = "completed"
22-
StatusCreated = "created"
23-
StatusInProgress = "in progress"
24-
StatusFailed = "failed"
21+
StatusCompleted Status = "completed"
22+
StatusCreated Status = "created"
23+
StatusInProgress Status = "in progress"
24+
StatusFailed Status = "failed"
2525
)
2626

2727
var ErrNoMatchingPod = errors.New("no matching pod")

Diff for: internal/pod/buildsignpodmanager_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -420,21 +420,21 @@ var _ = Describe("PodStatus", func() {
420420
})
421421

422422
DescribeTable("should return the correct status depending on the pod status",
423-
func(s *v1.Pod, podStatus string, expectsErr bool) {
423+
func(s *v1.Pod, podStatus Status, expectsErr bool) {
424424

425425
res, err := bspm.GetPodStatus(s)
426426
if expectsErr {
427427
Expect(err).To(HaveOccurred())
428428
return
429429
}
430430

431-
Expect(string(res)).To(Equal(podStatus))
431+
Expect(res).To(Equal(podStatus))
432432
},
433433
Entry("succeeded", &v1.Pod{Status: v1.PodStatus{Phase: v1.PodSucceeded}}, StatusCompleted, false),
434434
Entry("in progress", &v1.Pod{Status: v1.PodStatus{Phase: v1.PodRunning}}, StatusInProgress, false),
435435
Entry("pending", &v1.Pod{Status: v1.PodStatus{Phase: v1.PodPending}}, StatusInProgress, false),
436436
Entry("Failed", &v1.Pod{Status: v1.PodStatus{Phase: v1.PodFailed}}, StatusFailed, false),
437-
Entry("Unknown", &v1.Pod{Status: v1.PodStatus{Phase: v1.PodUnknown}}, "", true),
437+
Entry("Unknown", &v1.Pod{Status: v1.PodStatus{Phase: v1.PodUnknown}}, Status(""), true),
438438
)
439439
})
440440

0 commit comments

Comments
 (0)