fix Makefile + clean format

mine
derailed 2019-02-19 18:50:56 -07:00
parent 33f1cab316
commit 9253a37654
2 changed files with 31 additions and 29 deletions

View File

@ -1,6 +1,8 @@
NAME := k9s NAME := k9s
PACKAGE := github.com/k8sland/$(NAME) PACKAGE := github.com/derailed/$(NAME)/internal
VERSION := $(shell git rev-parse --short HEAD) VERSION := dev
GIT := $(shell git rev-parse --short HEAD)
DATE := $(shell date +%FT%T%Z)
default: help default: help
@ -8,11 +10,11 @@ cover: ## Run test coverage suite
@go test ./... --coverprofile=cov.out @go test ./... --coverprofile=cov.out
@go tool cover --html=cov.out @go tool cover --html=cov.out
build: ## Builds the CLI build: ## Builds the CLI
@go build \ @go build \
-ldflags "-w -X ${PACKAGE}/cmd.Version=${VERSION}" \ -ldflags "-w -X ${PACKAGE}/cmd.version=${VERSION} -X ${PACKAGE}/cmd.commit=${GIT} -X ${PACKAGE}/cmd.date=${DATE}" \
-a -tags netgo -o execs/${NAME} *.go -a -tags netgo -o execs/${NAME} *.go
help: help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[38;5;69m%-30s\033[38;5;0m %s\n", $$1, $$2}' @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[38;5;69m%-30s\033[38;5;38m %s\n", $$1, $$2}'

View File

@ -28,128 +28,128 @@ func (*RestMapper) Name() meta.RESTScopeName {
} }
var resMap = map[string]*meta.RESTMapping{ var resMap = map[string]*meta.RESTMapping{
"ConfigMaps": &meta.RESTMapping{ "ConfigMaps": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configmap"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configmap"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ConfigMap"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ConfigMap"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Pods": &meta.RESTMapping{ "Pods": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pod"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pod"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Services": &meta.RESTMapping{ "Services": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "service"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "service"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Service"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Service"},
Scope: RestMapping, Scope: RestMapping,
}, },
"EndPoints": &meta.RESTMapping{ "EndPoints": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "endpoints"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "endpoints"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Endpoints"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Endpoints"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Namespaces": &meta.RESTMapping{ "Namespaces": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "namespace"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "namespace"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Namespace"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Namespace"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Nodes": &meta.RESTMapping{ "Nodes": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "node"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "node"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Node"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Node"},
Scope: RestMapping, Scope: RestMapping,
}, },
"PersistentVolumes": &meta.RESTMapping{ "PersistentVolumes": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolume"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolume"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolume"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolume"},
Scope: RestMapping, Scope: RestMapping,
}, },
"PersistentVolumeClaims": &meta.RESTMapping{ "PersistentVolumeClaims": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolumeclaim"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolumeclaim"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolumeClaim"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "PersistentVolumeClaim"},
Scope: RestMapping, Scope: RestMapping,
}, },
"ReplicationControllers": &meta.RESTMapping{ "ReplicationControllers": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "replicationcontroller"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "replicationcontroller"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ReplicationController"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ReplicationController"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Secrets": &meta.RESTMapping{ "Secrets": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "secret"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "secret"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Secret"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Secret"},
Scope: RestMapping, Scope: RestMapping,
}, },
"ServiceAccounts": &meta.RESTMapping{ "ServiceAccounts": {
Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "serviceaccount"}, Resource: schema.GroupVersionResource{Group: "", Version: "v1", Resource: "serviceaccount"},
GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ServiceAccount"}, GroupVersionKind: schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ServiceAccount"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Deployments": &meta.RESTMapping{ "Deployments": {
Resource: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployment"}, Resource: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployment"},
GroupVersionKind: schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "Deployment"}, GroupVersionKind: schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "Deployment"},
Scope: RestMapping, Scope: RestMapping,
}, },
"ReplicaSets": &meta.RESTMapping{ "ReplicaSets": {
Resource: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "replicaset"}, Resource: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "replicaset"},
GroupVersionKind: schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "ReplicaSet"}, GroupVersionKind: schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "ReplicaSet"},
Scope: RestMapping, Scope: RestMapping,
}, },
"StatefulSets": &meta.RESTMapping{ "StatefulSets": {
Resource: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "statefulsets"}, Resource: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "statefulsets"},
GroupVersionKind: schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "StatefulSet"}, GroupVersionKind: schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: "StatefulSet"},
Scope: RestMapping, Scope: RestMapping,
}, },
"HorizontalPodAutoscalers": &meta.RESTMapping{ "HorizontalPodAutoscalers": {
Resource: schema.GroupVersionResource{Group: "autoscaling", Version: "v1", Resource: "horizontalpodautoscaler"}, Resource: schema.GroupVersionResource{Group: "autoscaling", Version: "v1", Resource: "horizontalpodautoscaler"},
GroupVersionKind: schema.GroupVersionKind{Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscaler"}, GroupVersionKind: schema.GroupVersionKind{Group: "autoscaling", Version: "v1", Kind: "HorizontalPodAutoscaler"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Jobs": &meta.RESTMapping{ "Jobs": {
Resource: schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "job"}, Resource: schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "job"},
GroupVersionKind: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"}, GroupVersionKind: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"},
Scope: RestMapping, Scope: RestMapping,
}, },
"CronJobs": &meta.RESTMapping{ "CronJobs": {
Resource: schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "cronjob"}, Resource: schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "cronjob"},
GroupVersionKind: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "CronJob"}, GroupVersionKind: schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "CronJob"},
Scope: RestMapping, Scope: RestMapping,
}, },
"DaemonSets": &meta.RESTMapping{ "DaemonSets": {
Resource: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "daemonset"}, Resource: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "daemonset"},
GroupVersionKind: schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "DaemonSet"}, GroupVersionKind: schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "DaemonSet"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Ingress": &meta.RESTMapping{ "Ingress": {
Resource: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "ingress"}, Resource: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "ingress"},
GroupVersionKind: schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "Ingress"}, GroupVersionKind: schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "Ingress"},
Scope: RestMapping, Scope: RestMapping,
}, },
"ClusterRoles": &meta.RESTMapping{ "ClusterRoles": {
Resource: schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterrole"}, Resource: schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterrole"},
GroupVersionKind: schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRole"}, GroupVersionKind: schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRole"},
Scope: RestMapping, Scope: RestMapping,
}, },
"ClusterRoleBindings": &meta.RESTMapping{ "ClusterRoleBindings": {
Resource: schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterrolebinding"}, Resource: schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterrolebinding"},
GroupVersionKind: schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRoleBinding"}, GroupVersionKind: schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "ClusterRoleBinding"},
Scope: RestMapping, Scope: RestMapping,
}, },
"Roles": &meta.RESTMapping{ "Roles": {
Resource: schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "role"}, Resource: schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "role"},
GroupVersionKind: schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "Role"}, GroupVersionKind: schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "Role"},
Scope: RestMapping, Scope: RestMapping,
}, },
"RoleBindings": &meta.RESTMapping{ "RoleBindings": {
Resource: schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "rolebinding"}, Resource: schema.GroupVersionResource{Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "rolebinding"},
GroupVersionKind: schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "RoleBinding"}, GroupVersionKind: schema.GroupVersionKind{Group: "rbac.authorization.k8s.io", Version: "v1", Kind: "RoleBinding"},
Scope: RestMapping, Scope: RestMapping,
}, },
"CustomResourceDefinitions": &meta.RESTMapping{ "CustomResourceDefinitions": {
Resource: schema.GroupVersionResource{Group: "apiextensions.k8s.io", Version: "v1beta1", Resource: "customresourcedefinitions"}, Resource: schema.GroupVersionResource{Group: "apiextensions.k8s.io", Version: "v1beta1", Resource: "customresourcedefinitions"},
GroupVersionKind: schema.GroupVersionKind{Group: "apiextensions.k8s.io", Version: "v1beta1", Kind: "CustomResourceDefinition"}, GroupVersionKind: schema.GroupVersionKind{Group: "apiextensions.k8s.io", Version: "v1beta1", Kind: "CustomResourceDefinition"},
Scope: RestMapping, Scope: RestMapping,