Skip to content

Commit 12d9858

Browse files
authored
Merge pull request #307 from droot/release/v0.1.10
🏃 this release v0.1.10
2 parents f6f0bc9 + 09998a3 commit 12d9858

File tree

373 files changed

+21377
-9188
lines changed

Some content is hidden

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

373 files changed

+21377
-9188
lines changed

Gopkg.lock

Lines changed: 52 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ required = ["sigs.k8s.io/testing_frameworks/integration",
3030

3131
[[constraint]]
3232
name = "k8s.io/api"
33-
version = "kubernetes-1.12.3"
33+
version = "kubernetes-1.13.1"
3434

3535
[[constraint]]
3636
name = "k8s.io/apiextensions-apiserver"
37-
version = "kubernetes-1.12.3"
37+
version = "kubernetes-1.13.1"
3838

3939
[[constraint]]
4040
name = "k8s.io/apimachinery"
41-
version = "kubernetes-1.12.3"
41+
version = "kubernetes-1.13.1"
4242

4343
[[constraint]]
4444
name = "k8s.io/client-go"
45-
version = "kubernetes-1.12.3"
45+
version = "kubernetes-1.13.1"
4646

4747
[[constraint]]
4848
name = "sigs.k8s.io/testing_frameworks"

alias.go

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/*
2+
Copyright 2018 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package controllerruntime alias' common functions and types to improve discoverability and reduce
18+
// the number of imports for simple Controllers.
19+
package controllerruntime
20+
21+
import (
22+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23+
"k8s.io/apimachinery/pkg/runtime/schema"
24+
"sigs.k8s.io/controller-runtime/pkg/builder"
25+
"sigs.k8s.io/controller-runtime/pkg/client/config"
26+
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
27+
"sigs.k8s.io/controller-runtime/pkg/manager"
28+
"sigs.k8s.io/controller-runtime/pkg/reconcile"
29+
"sigs.k8s.io/controller-runtime/pkg/runtime/log"
30+
"sigs.k8s.io/controller-runtime/pkg/runtime/scheme"
31+
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
32+
)
33+
34+
// Builder builds an Application ControllerManagedBy (e.g. Operator) and returns a manager.Manager to start it.
35+
type Builder = builder.Builder
36+
37+
// Request contains the information necessary to reconcile a Kubernetes object. This includes the
38+
// information to uniquely identify the object - its Name and Namespace. It does NOT contain information about
39+
// any specific Event or the object contents itself.
40+
type Request = reconcile.Request
41+
42+
// Result contains the result of a Reconciler invocation.
43+
type Result = reconcile.Result
44+
45+
// Manager initializes shared dependencies such as Caches and Clients, and provides them to Runnables.
46+
// A Manager is required to create Controllers.
47+
type Manager = manager.Manager
48+
49+
// Options are the arguments for creating a new Manager
50+
type Options = manager.Options
51+
52+
// Builder builds a new Scheme for mapping go types to Kubernetes GroupVersionKinds.
53+
type SchemeBuilder = scheme.Builder
54+
55+
// GroupVersion contains the "group" and the "version", which uniquely identifies the API.
56+
type GroupVersion = schema.GroupVersion
57+
58+
// GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying
59+
// concepts during lookup stages without having partially valid types
60+
type GroupResource = schema.GroupResource
61+
62+
// TypeMeta describes an individual object in an API response or request
63+
// with strings representing the type of the object and its API schema version.
64+
// Structures that are versioned or persisted should inline TypeMeta.
65+
//
66+
// +k8s:deepcopy-gen=false
67+
type TypeMeta = metav1.TypeMeta
68+
69+
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
70+
// users must create.
71+
type ObjectMeta = metav1.ObjectMeta
72+
73+
var (
74+
// GetConfigOrDie creates a *rest.Config for talking to a Kubernetes apiserver.
75+
// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
76+
// in cluster and use the cluster provided kubeconfig.
77+
//
78+
// Will log an error and exit if there is an error creating the rest.Config.
79+
GetConfigOrDie = config.GetConfigOrDie
80+
81+
// GetConfig creates a *rest.Config for talking to a Kubernetes apiserver.
82+
// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
83+
// in cluster and use the cluster provided kubeconfig.
84+
//
85+
// Config precedence
86+
//
87+
// * --kubeconfig flag pointing at a file
88+
//
89+
// * KUBECONFIG environment variable pointing at a file
90+
//
91+
// * In-cluster config if running in cluster
92+
//
93+
// * $HOME/.kube/config if exists
94+
GetConfig = config.GetConfig
95+
96+
// NewControllerManagedBy returns a new controller builder that will be started by the provided Manager
97+
NewControllerManagedBy = builder.ControllerManagedBy
98+
99+
// NewManager returns a new Manager for creating Controllers.
100+
NewManager = manager.New
101+
102+
// CreateOrUpdate creates or updates the given object obj in the Kubernetes
103+
// cluster. The object's desired state should be reconciled with the existing
104+
// state using the passed in ReconcileFn. obj must be a struct pointer so that
105+
// obj can be updated with the content returned by the Server.
106+
//
107+
// It returns the executed operation and an error.
108+
CreateOrUpdate = controllerutil.CreateOrUpdate
109+
110+
// SetControllerReference sets owner as a Controller OwnerReference on owned.
111+
// This is used for garbage collection of the owned object and for
112+
// reconciling the owner object on changes to owned (with a Watch + EnqueueRequestForOwner).
113+
// Since only one OwnerReference can be a controller, it returns an error if
114+
// there is another OwnerReference with Controller flag set.
115+
SetControllerReference = controllerutil.SetControllerReference
116+
117+
// SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned
118+
// which is closed on one of these signals. If a second signal is caught, the program
119+
// is terminated with exit code 1.
120+
SetupSignalHandler = signals.SetupSignalHandler
121+
122+
// Log is the base logger used by controller-runtime. It delegates
123+
// to another logr.Logger. You *must* call SetLogger to
124+
// get any actual logging.
125+
Log = log.Log
126+
127+
// SetLogger sets a concrete logging implementation for all deferred Loggers.
128+
SetLogger = log.SetLogger
129+
130+
// ZapLogger is a Logger implementation.
131+
// If development is true, a Zap development config will be used
132+
// (stacktraces on warnings, no sampling), otherwise a Zap production
133+
// config will be used (stacktraces on errors, sampling).
134+
ZapLogger = log.ZapLogger
135+
)

example/mutatingwebhook.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ func (a *podAnnotator) mutatePodsFn(ctx context.Context, pod *corev1.Pod) error
6262
return nil
6363
}
6464

65-
// podValidator implements inject.Client.
65+
// podAnnotator implements inject.Client.
6666
// A client will be automatically injected.
67-
var _ inject.Client = &podValidator{}
67+
var _ inject.Client = &podAnnotator{}
6868

6969
// InjectClient injects the client.
7070
func (v *podAnnotator) InjectClient(c client.Client) error {
7171
v.client = c
7272
return nil
7373
}
7474

75-
// podValidator implements inject.Decoder.
75+
// podAnnotator implements inject.Decoder.
7676
// A decoder will be automatically injected.
77-
var _ inject.Decoder = &podValidator{}
77+
var _ inject.Decoder = &podAnnotator{}
7878

7979
// InjectDecoder injects the decoder.
8080
func (v *podAnnotator) InjectDecoder(d types.Decoder) error {

0 commit comments

Comments
 (0)