K8s Versions Save

A simple Kubernetes Go client

v1.2.0

5 years ago

Action required:

Features:

Bug fixes:

v1.1.0

6 years ago

Features:

Bug fixes:

v1.0.0

6 years ago

v1.0.0 introduces breaking changes from the previous release. Most noticeably, v1 removes generated clients per-API group. The base client handles any resource:

cm := &v1.ConfigMap{
    Metadata: &metav1.ObjectMeta{
        Name:      &name,
        Namespace: &client.Namespace,
    },
    Data: values,
}
err := client.Create(ctx, cm) // Just Create, no typed clients

Instead of:

_, err := client.CoreV1().CreateConfigMap(ctx, cm) // No longer works

Features:

Bug fixes:

v0.4.0

7 years ago

Bug fixes:

  • Correctly associate context with HTTP request (#49) @pingles
  • Fix allowed characters in label selector fields (#45) @tombooth

v0.3.0

7 years ago

Updates

API group changes

  • Authentication graduated from "v1beta1" to "v1"
  • Authorization graduated from "v1beta1" to "v1"
  • Autoscaling "v2alpha1" was introduced.
  • Certificates graduated from "v1alpha1" to "v1beta1"
  • RBAC graduated from "v1alpha1" to "v1beta1"
  • Settings "v1alpha1" was introduced.
  • Storage graduated from "v1beta1" to "v1"

This client continues to generate bindings for alpha API groups, so if you're using a group that graduated, alpha bindings are still present in this version.

Breaking changes

Over the 1.6 release cycle Kubernetes switched the ever present v1.ObjectMeta to its own API group. A non-breaking change to adopt this would require rewrites of all 1.6 proto files, so this client will do the same breaking change as the official client and switch the import path. Users should update code to refer to the new package.

As an example, the README snippet changed from:

import (
    "context"

    "github.com/ericchiang/k8s"
    "github.com/ericchiang/k8s/api/v1"
)

func createConfigMap(client *k8s.Client, name string, values map[string]string) error {
    cm := &v1.ConfigMap{
        Metadata: &v1.ObjectMeta{Name: &name, Namespace: &client.Namespace},
        Data:     values,
    }
    _, err := client.CoreV1().CreateConfigMap(context.TODO(), cm)
    return err
}

to:

import (
    "context"

    "github.com/ericchiang/k8s"
    "github.com/ericchiang/k8s/api/v1"
    metav1 "github.com/ericchiang/k8s/apis/meta/v1"
)

func createConfigMap(client *k8s.Client, name string, values map[string]string) error {
    cm := &v1.ConfigMap{
        Metadata: &metav1.ObjectMeta{Name: &name, Namespace: &client.Namespace},
        Data:     values,
    }
    _, err := client.CoreV1().CreateConfigMap(context.TODO(), cm)
    return err
}

v0.2.0

7 years ago

Updates:

Breaking changes:

List and watch operations now no longer default to the client's namespace. For example, the following invocation:

c, err := k8s.NewInClusterClient()
if err != nil {
    // handle error
}
c.CoreV1().ListPods(ctx, "") // Now invalid.

must be modified to:

c, err := k8s.NewInClusterClient()
if err != nil {
    // handle error
}
c.CoreV1().ListPods(ctx, c.Namespace)

A special value k8s.AllNamespaces has been added to signify listing or watching resources in all namespaces:

c, err := k8s.NewInClusterClient()
if err != nil {
    // handle error
}
c.CoreV1().ListPods(ctx, k8s.AllNamespaces) // List pods in all namespaces.

v0.1.0

7 years ago

Initial release