# Utils

[![Build Status](https://travis-ci.org/kubernetes/utils.svg?branch=master)](https://travis-ci.org/kubernetes/utils)

Utils is a set of golang libraries that are not specific to
Kubernetes. They should be available and useful to any other Go project
out there.

## Purpose

The Kubernetes project uses a lot of Golang patterns that are re-used in many
difference places, and as the project is further split into different
repositories, this repository is the perfect place to hold this common code.

## Goals

Go libraries in this repository must be:

- Generic enough that they are useful for external/non-kubernetes
  projects,
- Well factored, well tested and reliable,
- Be completely go compliant (go get/build/test/etc)
- Have enough complexity to be shared,
- Have stable APIs, or backward compatible.

The goal is to keep libraries organized in logical entities.

## Libraries

- [Exec](/exec) provides an interface for `os/exec`. It makes it easier
  to mock and replace in tests, especially with
  the [FakeExec](exec/testing/fake_exec.go) struct.

## How to move a pkg from other repo

Please look at [HOWTOMOVE.md](./HOWTOMOVE.md).

# Utils

[![Build Status]](https://travis-ci.org/kubernetes/utils)

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

## Purpose

As Kubernetes grows and spins functionality out of its
[core] and into cooperating repositories like
[apiserver], [kubectl], [kubeadm], etc., the need
arises for leaf repositories to house shared code and
avoid cycles in repository relationships.

This repository is intended to hold shared utilities
with no Kubernetes dependence that may be of interest
to any Go project.  See these [instructions for moving]
an existing package to this repository.


## Criteria for adding code here

- Used by multiple Kubernetes repositories.

- Full unit test coverage.

- Go tools compliant (`go get`, `go test`, etc.).

- Complex enough to be worth vendoring, rather than copying.

- Stable, or backward compatible, API.

- _No dependence on any Kubernetes repository_.

## Libraries

- [Exec](/exec) provides an interface for `os/exec`. It makes it easier
  to mock and replace in tests, especially with
  the [FakeExec](exec/testing/fake_exec.go) struct.

[Build Status]: https://travis-ci.org/kubernetes/utils.svg?branch=master
[Go standard libs]: https://golang.org/pkg/#stdlib
[api]: https://github.com/kubernetes/api
[apiserver]: https://github.com/kubernetes/apiserver
[core]: https://github.com/kubernetes/kubernetes
[ingress]: https://github.com/kubernetes/ingress
[kubeadm]: https://github.com/kubernetes/kubeadm
[kubectl]: https://github.com/kubernetes/kubectl
[instructions for moving]: ./HOWTOMOVE.md

Clarify criteria for adding code.
Clarify criteria for adding code.

Wanted to have clearer criteria for adding code, stopping well short
of all the policy in the core repo.

Provide more history about why this repo exists and how it fits with the rest.

Underscore that this repo must not depend on other k8s repos.
