-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from enxebre/healthchecking
Healthchecking
- Loading branch information
Showing
1,926 changed files
with
71,807 additions
and
357,847 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"runtime" | ||
|
||
"github.com/golang/glog" | ||
"github.com/openshift/machine-api-operator/pkg/apis" | ||
"github.com/openshift/machine-api-operator/pkg/controller" | ||
sdkVersion "github.com/operator-framework/operator-sdk/version" | ||
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp" | ||
"sigs.k8s.io/controller-runtime/pkg/client/config" | ||
"sigs.k8s.io/controller-runtime/pkg/manager" | ||
"sigs.k8s.io/controller-runtime/pkg/runtime/signals" | ||
) | ||
|
||
func printVersion() { | ||
glog.Infof("Go Version: %s", runtime.Version()) | ||
glog.Infof("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH) | ||
glog.Infof("operator-sdk Version: %v", sdkVersion.Version) | ||
} | ||
|
||
func main() { | ||
flag.Parse() | ||
printVersion() | ||
|
||
// Get a config to talk to the apiserver | ||
cfg, err := config.GetConfig() | ||
if err != nil { | ||
glog.Fatal(err) | ||
} | ||
|
||
// Create a new Cmd to provide shared dependencies and start components | ||
mgr, err := manager.New(cfg, manager.Options{}) | ||
if err != nil { | ||
glog.Fatal(err) | ||
} | ||
|
||
glog.Infof("Registering Components.") | ||
|
||
// Setup Scheme for all resources | ||
if err := apis.AddToScheme(mgr.GetScheme()); err != nil { | ||
glog.Fatal(err) | ||
} | ||
|
||
// Setup all Controllers | ||
if err := controller.AddToManager(mgr); err != nil { | ||
glog.Fatal(err) | ||
} | ||
|
||
glog.Info("Starting the Cmd.") | ||
|
||
// Start the Cmd | ||
if err := mgr.Start(signals.SetupSignalHandler()); err != nil { | ||
glog.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package apis | ||
|
||
import ( | ||
"github.com/openshift/machine-api-operator/pkg/apis/healthchecking/v1alpha1" | ||
) | ||
|
||
func init() { | ||
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back | ||
AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package apis | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime" | ||
) | ||
|
||
// AddToSchemes may be used to add all resources defined in the project to a Scheme | ||
var AddToSchemes runtime.SchemeBuilder | ||
|
||
// AddToScheme adds all Resources to the Scheme | ||
func AddToScheme(s *runtime.Scheme) error { | ||
return AddToSchemes.AddToScheme(s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Package v1alpha1 contains API Schema definitions for the healthchecking v1alpha1 API group | ||
// +k8s:deepcopy-gen=package,register | ||
// +groupName=healthchecking.openshift.io | ||
package v1alpha1 |
40 changes: 40 additions & 0 deletions
40
pkg/apis/healthchecking/v1alpha1/machinehealthcheck_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// MachineHealthCheckSpec defines the desired state of MachineHealthCheck | ||
type MachineHealthCheckSpec struct { | ||
Selector metav1.LabelSelector `json:"selector"` | ||
} | ||
|
||
// MachineHealthCheckStatus defines the observed state of MachineHealthCheck | ||
type MachineHealthCheckStatus struct { | ||
// TODO(alberto) | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// MachineHealthCheck is the Schema for the machinehealthchecks API | ||
// +k8s:openapi-gen=true | ||
type MachineHealthCheck struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec MachineHealthCheckSpec `json:"spec,omitempty"` | ||
Status MachineHealthCheckStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// MachineHealthCheckList contains a list of MachineHealthCheck | ||
type MachineHealthCheckList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []MachineHealthCheck `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&MachineHealthCheck{}, &MachineHealthCheckList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// NOTE: Boilerplate only. Ignore this file. | ||
|
||
// Package v1alpha1 contains API Schema definitions for the healthchecking v1alpha1 API group | ||
// +k8s:deepcopy-gen=package,register | ||
// +groupName=healthchecking.openshift.io | ||
package v1alpha1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/runtime/scheme" | ||
) | ||
|
||
var ( | ||
// SchemeGroupVersion is group version used to register these objects | ||
SchemeGroupVersion = schema.GroupVersion{Group: "healthchecking.openshift.io", Version: "v1alpha1"} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} | ||
) |
119 changes: 119 additions & 0 deletions
119
pkg/apis/healthchecking/v1alpha1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package controller | ||
|
||
import ( | ||
"github.com/openshift/machine-api-operator/pkg/controller/machinehealthcheck" | ||
) | ||
|
||
func init() { | ||
// AddToManagerFuncs is a list of functions to create controllers and add them to a manager. | ||
AddToManagerFuncs = append(AddToManagerFuncs, machinehealthcheck.Add) | ||
} |
Oops, something went wrong.