Skip to content

Commit cfab885

Browse files
committed
Update READMEs
Top-level README spells out the need for low-deps and testing. Moved per-package details to per-package READMEs.
1 parent a9aa75a commit cfab885

File tree

7 files changed

+40
-36
lines changed

7 files changed

+40
-36
lines changed

README.md

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,37 @@
22

33
[![Build Status]](https://travis-ci.org/kubernetes/utils) [![GoDoc](https://godoc.org/k8s.io/utils?status.svg)](https://godoc.org/k8s.io/utils)
44

5-
A set of Go libraries that provide low-level,
6-
kubernetes-independent packages supplementing the [Go
7-
standard libs].
5+
A set of Go libraries that provide low-level, kubernetes-independent packages
6+
supplementing the [Go standard libs].
87

98
## Purpose
109

11-
As Kubernetes grows and spins functionality out of its
12-
[core] and into cooperating repositories like
13-
[apiserver], [kubectl], [kubeadm], etc., the need
14-
arises for leaf repositories to house shared code and
15-
avoid cycles in repository relationships.
16-
17-
This repository is intended to hold shared utilities
18-
with no Kubernetes dependence that may be of interest
19-
to any Go project. See these [instructions for moving]
20-
an existing package to this repository.
10+
As Kubernetes grows and spins functionality out of its [core] and into
11+
cooperating repositories like [apiserver], [kubectl], [kubeadm], etc., the need
12+
arises for leaf repositories to house shared code and avoid cycles in repository
13+
relationships.
2114

15+
This repository is intended to hold shared utilities with _no Kubernetes
16+
dependencies_ that may be of interest to any Go project. See these [instructions
17+
for moving] an existing package to this repository.
2218

2319
## Criteria for adding code here
2420

2521
- Used by multiple Kubernetes repositories.
2622

27-
- Full unit test coverage.
28-
29-
- Go tools compliant (`go get`, `go test`, etc.).
30-
31-
- Complex enough to be worth vendoring, rather than copying.
23+
- Complex enough to be worth vendoring, rather than copying (e.g. not 5 LOC).
3224

33-
- Stable, or backward compatible, API.
25+
- Can be fully exercised by unit tests (e.g. no dependencies on kernels).
3426

35-
- _No dependence on any Kubernetes repository_.
27+
- Has full unit test coverage.
3628

37-
## Libraries
29+
- Stable, or backward compatible, API, with complete godocs.
3830

39-
- [Exec](/exec) provides an interface for `os/exec`. It makes it easier
40-
to mock and replace in tests, especially with
41-
the [FakeExec](exec/testing/fake_exec.go) struct.
42-
43-
- [Temp](/temp) provides an interface to create temporary directories. It also
44-
provides a [FakeDir](temp/temptest) implementation to replace in tests.
45-
46-
- [Clock](/clock) provides an interface for time-based operations. It allows
47-
mocking time for testing.
48-
49-
- [Pointer](/pointer) provides some functions for pointer-based operations.
31+
- Go tools compliant (`go get`, `go test`, etc.).
5032

51-
- [Io](/io) provides interfaces for working with file IO. Currently it provides
52-
functionality for consistently reading a file.
33+
- Very few (ideally zero) external dependencies.
5334

54-
- [NSEnter](/nsenter) provides interfaces for executing and interacting with
55-
processes running within a namespace.
35+
- _No dependencies on any other Kubernetes repository_.
5636

5737
[Build Status]: https://travis-ci.org/kubernetes/utils.svg?branch=master
5838
[Go standard libs]: https://golang.org/pkg/#stdlib

clock/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Clock
2+
3+
This package provides an interface for time-based operations. It allows
4+
mocking time for testing.

exec/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Exec
2+
3+
This package provides an interface for `os/exec`. It makes it easier to mock
4+
and replace in tests, especially with the [FakeExec](testing/fake_exec.go)
5+
struct.

io/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# IO
2+
3+
This package provides interfaces for working with file IO. Currently it
4+
provides functionality for consistently reading a file.

nsenter/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# NSEnter
2+
3+
This package provides interfaces for executing and interacting with processes
4+
running within a namespace.

pointer/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Pointer
2+
3+
This package provides some functions for pointer-based operations.

temp/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Temp
2+
3+
This package provides an interface to create temporary directories. It also
4+
provides a [FakeDir](temp/temptest) implementation to replace in tests.

0 commit comments

Comments
 (0)