Skip to content

Commit

Permalink
add cluster controller (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lion-Wei authored and k8s-ci-robot committed Oct 16, 2018
1 parent 2072533 commit a5e89cf
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pkg/cloud/openstack/clusteractuator.go
@@ -0,0 +1,22 @@
package openstack

import (
"github.com/golang/glog"
clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1"
)

type OpenstackClusterClient struct{}

func NewClusterActuator() (*OpenstackClusterClient, error) {
return &OpenstackClusterClient{}, nil
}

func (occ *OpenstackClusterClient) Reconcile(cluster *clusterv1.Cluster) error {
glog.Errorf("Not implemented yet")
return nil
}

func (occ *OpenstackClusterClient) Delete(cluster *clusterv1.Cluster) error {
glog.Errorf("Not implemented yet")
return nil
}
34 changes: 34 additions & 0 deletions pkg/controller/add_cluster.go
@@ -0,0 +1,34 @@
/*
Copyright 2018 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package controller

import (
"sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/openstack"
"sigs.k8s.io/cluster-api/pkg/controller/cluster"
"sigs.k8s.io/controller-runtime/pkg/manager"
)

func init() {
// AddToManagerFuncs is a list of functions to create controllers and add them to a manager.
AddToManagerFuncs = append(AddToManagerFuncs, func(m manager.Manager) error {
clusterActuator, err := openstack.NewClusterActuator()
if err != nil {
return err
}
return cluster.AddWithActuator(m, clusterActuator)
})
}

0 comments on commit a5e89cf

Please sign in to comment.