Skip to content

Commit ea111a0

Browse files
committed
pkg: Replace kepval/** imports with legacy packages
Signed-off-by: Stephen Augustus <[email protected]>
1 parent eb2dba9 commit ea111a0

File tree

9 files changed

+24
-23
lines changed

9 files changed

+24
-23
lines changed

api/approval.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ type PRRApproval struct {
3131
Error error `json:"-" yaml:"-"`
3232
}
3333

34+
func (p *PRRApproval) ApproverForStage(stage string) string {
35+
switch stage {
36+
case "alpha":
37+
return p.Alpha.Approver
38+
case "beta":
39+
return p.Beta.Approver
40+
case "stable":
41+
return p.Stable.Approver
42+
}
43+
44+
return ""
45+
}
46+
3447
// TODO(api): Can we refactor the proposal `Milestone` to retrieve this?
3548
type PRRMilestone struct {
3649
Approver string `json:"approver" yaml:"approver"`

cmd/kepify/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"strings"
2727

2828
"k8s.io/enhancements/api"
29-
"k8s.io/enhancements/pkg/kepval/keps"
29+
"k8s.io/enhancements/pkg/legacy/keps"
3030
)
3131

3232
func Usage() {

pkg/kepctl/kepctl.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import (
3737
"gopkg.in/yaml.v3"
3838

3939
"k8s.io/enhancements/api"
40-
"k8s.io/enhancements/pkg/kepval/keps"
41-
"k8s.io/enhancements/pkg/kepval/prrs"
40+
"k8s.io/enhancements/pkg/legacy/keps"
41+
"k8s.io/enhancements/pkg/legacy/prrs"
4242
"k8s.io/test-infra/prow/git"
4343
)
4444

@@ -182,7 +182,7 @@ func findLocalKEPMeta(repoPath, sig string) ([]string, error) {
182182
"keps",
183183
sig)
184184

185-
// TODO(lint): importShadow: shadow of imported from 'k8s.io/enhancements/pkg/kepval/keps' package 'keps' (gocritic)
185+
// TODO(lint): importShadow: shadow of imported from 'k8s.io/enhancements/pkg/legacy/keps' package 'keps' (gocritic)
186186
//nolint:gocritic
187187
keps := []string{}
188188

pkg/kepctl/query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/pkg/errors"
2424

2525
"k8s.io/enhancements/api"
26-
"k8s.io/enhancements/pkg/kepval/util"
26+
"k8s.io/enhancements/pkg/legacy/util"
2727
)
2828

2929
var (

pkg/legacy/keps/proposals_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"strings"
2121
"testing"
2222

23-
"k8s.io/enhancements/pkg/kepval/keps"
23+
"k8s.io/enhancements/pkg/legacy/keps"
2424
)
2525

2626
func TestValidParsing(t *testing.T) {

pkg/legacy/keps/validations/yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"sort"
2222
"strings"
2323

24-
"k8s.io/enhancements/pkg/kepval/util"
24+
"k8s.io/enhancements/pkg/legacy/util"
2525
)
2626

2727
var (

pkg/legacy/prrs/approvals.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"gopkg.in/yaml.v3"
2626

2727
"k8s.io/enhancements/api"
28-
"k8s.io/enhancements/pkg/kepval/prrs/validations"
28+
"k8s.io/enhancements/pkg/legacy/prrs/validations"
2929
)
3030

3131
type Parser struct{}
@@ -59,15 +59,3 @@ func (p *Parser) Parse(in io.Reader) *api.PRRApproval {
5959

6060
return approval
6161
}
62-
63-
func (a *Approval) ApproverForStage(stage string) string {
64-
switch stage {
65-
case "alpha":
66-
return a.Alpha.Approver
67-
case "beta":
68-
return a.Beta.Approver
69-
case "stable":
70-
return a.Stable.Approver
71-
}
72-
return ""
73-
}

pkg/legacy/prrs/validations/yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"sort"
2222
"strings"
2323

24-
"k8s.io/enhancements/pkg/kepval/util"
24+
"k8s.io/enhancements/pkg/legacy/util"
2525
)
2626

2727
var mandatoryKeys = []string{"kep-number"}

test/metadata_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222
"strings"
2323
"testing"
2424

25-
"k8s.io/enhancements/pkg/kepval/keps"
26-
"k8s.io/enhancements/pkg/kepval/prrs"
25+
"k8s.io/enhancements/pkg/legacy/keps"
26+
"k8s.io/enhancements/pkg/legacy/prrs"
2727
)
2828

2929
const (

0 commit comments

Comments
 (0)