Releases: ericchiang/k8s
v1.2.0
v1.1.0
v1.0.0
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:
- Kubernetes 1.9 support (#73) @ericchiang
- CRD support (#73) @ericchiang
- Removed generated client per-API group, base client can handle all resources (#73) @ericchiang
- QueryParam option for setting arbitrary query parameters (#43) @exekias
- Int32 convince function for constructing *int32 values (#57) @sidmutha
- Unrecognized error responses from the API server now include status code (#58) @chesleybrown
- Config now includes YAML struct tags (#64) @jhaynie
Bug fixes:
v0.4.0
v0.3.0
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
Updates:
- Fixes endpoint operations (#28)
- Generated code now passes gofmt (#33)
- List and watch support for all namespaces (#32)
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
Initial release