-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebe4b8f
commit bb708b9
Showing
8 changed files
with
201 additions
and
56 deletions.
There are no files selected for viewing
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
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
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,31 @@ | ||
package health | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/heptiolabs/healthcheck" | ||
"github.com/kubermatic/machine-controller/pkg/machines" | ||
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/client-go/kubernetes" | ||
) | ||
|
||
func ApiserverReachable(client kubernetes.Interface) healthcheck.Check { | ||
return func() error { | ||
_, err := client.CoreV1().Namespaces().List(metav1.ListOptions{}) | ||
return err | ||
} | ||
} | ||
|
||
func CustomResourceDefinitionsEstablished(clientset apiextensionsclient.Interface) healthcheck.Check { | ||
return func() error { | ||
exist, err := machines.AllCustomResourceDefinitionsExists(clientset) | ||
if err != nil { | ||
return err | ||
} | ||
if !exist { | ||
return errors.New("custom resource definitions do not exist / are established") | ||
} | ||
return nil | ||
} | ||
} |
Oops, something went wrong.