@@ -14,27 +14,27 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
- package operator
17
+ package application
18
18
19
19
import (
20
20
"fmt"
21
21
"strings"
22
22
23
- "github.com/kubernetes-sigs/controller-runtime/pkg/client"
24
- "github.com/kubernetes-sigs/controller-runtime/pkg/client/apiutil"
25
- "github.com/kubernetes-sigs/controller-runtime/pkg/client/config"
26
- "github.com/kubernetes-sigs/controller-runtime/pkg/controller"
27
- "github.com/kubernetes-sigs/controller-runtime/pkg/handler"
28
- internalcontroller "github.com/kubernetes-sigs/controller-runtime/pkg/internal/controller"
29
- "github.com/kubernetes-sigs/controller-runtime/pkg/manager"
30
- "github.com/kubernetes-sigs/controller-runtime/pkg/reconcile"
31
- "github.com/kubernetes-sigs/controller-runtime/pkg/runtime/signals"
32
- "github.com/kubernetes-sigs/controller-runtime/pkg/source"
33
23
"k8s.io/apimachinery/pkg/runtime"
24
+ "sigs.k8s.io/controller-runtime/pkg/client"
25
+ "sigs.k8s.io/controller-runtime/pkg/client/apiutil"
26
+ "sigs.k8s.io/controller-runtime/pkg/client/config"
27
+ "sigs.k8s.io/controller-runtime/pkg/controller"
28
+ "sigs.k8s.io/controller-runtime/pkg/handler"
29
+ internalcontroller "sigs.k8s.io/controller-runtime/pkg/internal/controller"
30
+ "sigs.k8s.io/controller-runtime/pkg/manager"
31
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
32
+ "sigs.k8s.io/controller-runtime/pkg/runtime/signals"
33
+ "sigs.k8s.io/controller-runtime/pkg/source"
34
34
)
35
35
36
- // Operator is a very simple Controller that embeds a Manager.
37
- type Operator struct {
36
+ // Application is a very simple Controller that embeds a Manager.
37
+ type Application struct {
38
38
mrg manager.Manager
39
39
stopFn func () <- chan struct {}
40
40
ctrl * internalcontroller.Controller
@@ -49,7 +49,7 @@ var newController = controller.New
49
49
var newManager = manager .New
50
50
var getGvk = apiutil .GVKForObject
51
51
52
- // New returns a new Operator for a Kubernetes Resource type.
52
+ // New returns a new Application for a Kubernetes Resource type.
53
53
//
54
54
// * Watch for changes (e.g. create,update,delete operations) to objects of the Resource type
55
55
//
@@ -61,7 +61,7 @@ var getGvk = apiutil.GVKForObject
61
61
//
62
62
// ownedTypes: list of types of objects that may be created or managed by the reconcileObject. These
63
63
// objects must have the OwnersReference set to the owning object in the ObjectMeta - e.g. &v1.Pod{}
64
- func New (reconcileObject runtime.Object , ownedTypes ... runtime.Object ) (* Operator , error ) {
64
+ func New (reconcileObject runtime.Object , ownedTypes ... runtime.Object ) (* Application , error ) {
65
65
c , err := getConfig ()
66
66
if err != nil {
67
67
return nil , err
@@ -71,7 +71,7 @@ func New(reconcileObject runtime.Object, ownedTypes ...runtime.Object) (*Operato
71
71
return nil , err
72
72
}
73
73
74
- o := & Operator {
74
+ o := & Application {
75
75
mrg : mrg ,
76
76
stopFn : signals .SetupSignalHandler ,
77
77
}
@@ -82,7 +82,7 @@ func New(reconcileObject runtime.Object, ownedTypes ...runtime.Object) (*Operato
82
82
}
83
83
84
84
// Create the controller
85
- name := fmt .Sprintf ("%s-operator " , strings .ToLower (gvk .Kind ))
85
+ name := fmt .Sprintf ("%s-application " , strings .ToLower (gvk .Kind ))
86
86
ctrl , err := newController (name , mrg , controller.Options {Reconcile : noop })
87
87
if err != nil {
88
88
return nil , err
@@ -106,17 +106,17 @@ func New(reconcileObject runtime.Object, ownedTypes ...runtime.Object) (*Operato
106
106
return o , nil
107
107
}
108
108
109
- // Start starts the Operator and blocks until the program is shutdown.
109
+ // Start starts the Application and blocks until the program is shutdown.
110
110
//
111
111
// call: the Reconcile implementation. reconcile.Reconcile is a function that may be called at anytime with the
112
112
// name / Namespace of an object. When called, it will ensure that the state of the system matches what is
113
113
// specified in the object at the time reconcile is called.
114
- func (o * Operator ) Start (call reconcile.Reconcile ) error {
114
+ func (o * Application ) Start (call reconcile.Reconcile ) error {
115
115
o .ctrl .Do = call
116
116
return o .mrg .Start (o .stopFn ())
117
117
}
118
118
119
119
// GetClient returns a client configured with the Config
120
- func (o * Operator ) GetClient () client.Client {
120
+ func (o * Application ) GetClient () client.Client {
121
121
return o .mrg .GetClient ()
122
122
}
0 commit comments