Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use client-go 5.x #233

Merged
merged 1 commit into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 12 additions & 6 deletions apis/monitoring/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +genclient=true
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ClusterAlert struct {
Expand All @@ -18,6 +18,8 @@ type ClusterAlert struct {
Spec ClusterAlertSpec `json:"spec,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterAlertList is a collection of ClusterAlert.
type ClusterAlertList struct {
metav1.TypeMeta `json:",inline"`
Expand Down Expand Up @@ -48,12 +50,12 @@ type ClusterAlertSpec struct {
Receivers []Receiver `json:"receivers,omitempty"`

// Vars contains Icinga Service variables to be used in CheckCommand
Vars map[string]interface{} `json:"vars,omitempty"`
Vars map[string]string `json:"vars,omitempty"`
}

type CheckCluster string

// +genclient=true
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type NodeAlert struct {
Expand All @@ -67,6 +69,8 @@ type NodeAlert struct {
Spec NodeAlertSpec `json:"spec,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// NodeAlertList is a collection of NodeAlert.
type NodeAlertList struct {
metav1.TypeMeta `json:",inline"`
Expand Down Expand Up @@ -101,12 +105,12 @@ type NodeAlertSpec struct {
Receivers []Receiver `json:"receivers,omitempty"`

// Vars contains Icinga Service variables to be used in CheckCommand
Vars map[string]interface{} `json:"vars,omitempty"`
Vars map[string]string `json:"vars,omitempty"`
}

type CheckNode string

// +genclient=true
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type PodAlert struct {
Expand All @@ -120,6 +124,8 @@ type PodAlert struct {
Spec PodAlertSpec `json:"spec,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PodAlertList is a collection of PodAlert.
type PodAlertList struct {
metav1.TypeMeta `json:",inline"`
Expand Down Expand Up @@ -154,7 +160,7 @@ type PodAlertSpec struct {
Receivers []Receiver `json:"receivers,omitempty"`

// Vars contains Icinga Service variables to be used in CheckCommand
Vars map[string]interface{} `json:"vars,omitempty"`
Vars map[string]string `json:"vars,omitempty"`
}

type CheckPod string
Expand Down
2 changes: 1 addition & 1 deletion apis/monitoring/v1alpha1/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v1alpha1
import (
"time"

apiv1 "k8s.io/client-go/pkg/api/v1"
apiv1 "k8s.io/api/core/v1"
)

type Alert interface {
Expand Down
2 changes: 1 addition & 1 deletion apis/monitoring/v1alpha1/cluster_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

apiv1 "k8s.io/client-go/pkg/api/v1"
apiv1 "k8s.io/api/core/v1"
)

const (
Expand Down
4 changes: 3 additions & 1 deletion apis/monitoring/v1alpha1/icinga.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ func (c CheckCluster) IsValid() bool {
func ParseCheckCluster(s string) (*CheckCluster, error) {
cmd := CheckCluster(s)
if _, ok := ClusterCommands[cmd]; !ok {
return nil, fmt.Errorf("Invalid cluster check command %s", s)
return nil, fmt.Errorf("invalid cluster check command %s", s)
}
return &cmd, nil
}

// +k8s:deepcopy-gen=false
// +k8s:gen-deepcopy=false
type IcingaCommand struct {
Name string
Vars map[string]data.CommandVar
Expand Down
2 changes: 1 addition & 1 deletion apis/monitoring/v1alpha1/node_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

apiv1 "k8s.io/client-go/pkg/api/v1"
apiv1 "k8s.io/api/core/v1"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion apis/monitoring/v1alpha1/pod_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

apiv1 "k8s.io/client-go/pkg/api/v1"
apiv1 "k8s.io/api/core/v1"
)

const (
Expand Down
Loading