Skip to content

Commit

Permalink
Refactor resource (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
micnncim committed Sep 19, 2020
1 parent 413bc22 commit e981b98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 0 additions & 11 deletions pkg/resource/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ import (
"k8s.io/client-go/kubernetes"
)

const (
KindPod = "Pod"
KindConfigMap = "ConfigMap"
KindSecret = "Secret"
KindServiceAccount = "ServiceAccount"
KindPersistentVolume = "PersistentVolume"
KindPersistentVolumeClaim = "PersistentVolumeClaim"
KindPodDisruptionBudget = "PodDisruptionBudget"
KindHorizontalPodAutoscaler = "HorizontalPodAutoscaler"
)

type Client interface {
ListPods(ctx context.Context, namespace string) ([]*corev1.Pod, error)
ListServiceAccounts(ctx context.Context, namespace string) ([]*corev1.ServiceAccount, error)
Expand Down
11 changes: 11 additions & 0 deletions pkg/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)

const (
KindPod = "Pod"
KindConfigMap = "ConfigMap"
KindSecret = "Secret"
KindServiceAccount = "ServiceAccount"
KindPersistentVolume = "PersistentVolume"
KindPersistentVolumeClaim = "PersistentVolumeClaim"
KindPodDisruptionBudget = "PodDisruptionBudget"
KindHorizontalPodAutoscaler = "HorizontalPodAutoscaler"
)

var unstructuredConverter = runtime.DefaultUnstructuredConverter

func ObjectToPod(obj runtime.Object) (*corev1.Pod, error) {
Expand Down

0 comments on commit e981b98

Please sign in to comment.