Skip to content

Commit 99f1558

Browse files
authored
Merge pull request kubernetes#2528 from justaugustus/cleanup
Repo package cleanups/refactors (part two)
2 parents 2cabc09 + b8bdaf9 commit 99f1558

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1992
-1518
lines changed

.githooks/pre-commit

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# !/usr/bin/env bash
1+
#!/usr/bin/env bash
22

33
# Copyright 2020 The Kubernetes Authors.
44
#
@@ -20,4 +20,6 @@ set -o pipefail
2020

2121
REPO_ROOT="$(git rev-parse --show-toplevel)"
2222

23-
exec "${REPO_ROOT}/hack/verify.sh"
23+
exec "${REPO_ROOT}/hack/verify-kep-metadata.sh"
24+
exec "${REPO_ROOT}/hack/verify-toc.sh"
25+
exec "${REPO_ROOT}/hack/verify-spelling.sh"

api/proposal.go

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,35 @@ func (p *Proposal) Validate() error {
8686
}
8787

8888
func (p *Proposal) IsMissingMilestone() bool {
89-
if p.LatestMilestone == "" {
90-
return true
91-
}
92-
93-
return false
89+
return p.LatestMilestone == ""
9490
}
9591

9692
func (p *Proposal) IsMissingStage() bool {
97-
if p.Stage == "" {
98-
return true
99-
}
100-
101-
return false
93+
return p.Stage == ""
10294
}
10395

10496
type KEPHandler Parser
10597

98+
func NewKEPHandler() (*KEPHandler, error) {
99+
handler := &KEPHandler{}
100+
101+
groups, err := FetchGroups()
102+
if err != nil {
103+
return nil, errors.Wrap(err, "fetching groups")
104+
}
105+
106+
handler.Groups = groups
107+
108+
approvers, err := FetchPRRApprovers()
109+
if err != nil {
110+
return nil, errors.Wrap(err, "fetching PRR approvers")
111+
}
112+
113+
handler.PRRApprovers = approvers
114+
115+
return handler, nil
116+
}
117+
106118
// TODO(api): Make this a generic parser for all `Document` types
107119
func (k *KEPHandler) Parse(in io.Reader) (*Proposal, error) {
108120
scanner := bufio.NewScanner(in)

cmd/kepctl/cmd/create.go

Lines changed: 0 additions & 106 deletions
This file was deleted.

cmd/kepctl/cmd/promote.go

Lines changed: 0 additions & 72 deletions
This file was deleted.

cmd/kepctl/cmd/query.go

Lines changed: 0 additions & 116 deletions
This file was deleted.

cmd/kepctl/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ limitations under the License.
1616

1717
package main
1818

19-
import "k8s.io/enhancements/cmd/kepctl/cmd"
19+
import (
20+
"github.com/sirupsen/logrus"
21+
22+
"k8s.io/enhancements/pkg/kepctl/commands"
23+
)
2024

2125
func main() {
22-
cmd.Execute()
26+
if err := commands.New().Execute(); err != nil {
27+
logrus.Fatalf("error during command execution: %v", err)
28+
}
2329
}

0 commit comments

Comments
 (0)