@@ -62,6 +62,7 @@ func NewCmdSchedule() *cobra.Command {
62
62
case "Deployments" , "Deployment" , "deployments" , "deployment" :
63
63
opt .AppKind = "Deployment"
64
64
opt .SmartPrefix = ""
65
+ opt .SnapshotHostname = opt .AppName
65
66
_ , err := kubeClient .AppsV1beta1 ().Deployments (opt .Namespace ).Get (opt .AppName , metav1.GetOptions {})
66
67
if err != nil {
67
68
_ , err := kubeClient .ExtensionsV1beta1 ().Deployments (opt .Namespace ).Get (opt .AppName , metav1.GetOptions {})
@@ -72,27 +73,31 @@ func NewCmdSchedule() *cobra.Command {
72
73
case "ReplicaSets" , "ReplicaSet" , "replicasets" , "replicaset" , "rs" :
73
74
opt .AppKind = "ReplicaSet"
74
75
opt .SmartPrefix = ""
76
+ opt .SnapshotHostname = opt .AppName
75
77
_ , err := kubeClient .ExtensionsV1beta1 ().ReplicaSets (opt .Namespace ).Get (opt .AppName , metav1.GetOptions {})
76
78
if err != nil {
77
79
log .Fatalf (`Unknown ReplicaSet %s/%s` , opt .Namespace , opt .AppName )
78
80
}
79
81
case "ReplicationControllers" , "ReplicationController" , "replicationcontrollers" , "replicationcontroller" , "rc" :
80
82
opt .AppKind = "ReplicationController"
81
83
opt .SmartPrefix = ""
84
+ opt .SnapshotHostname = opt .AppName
82
85
_ , err := kubeClient .CoreV1 ().ReplicationControllers (opt .Namespace ).Get (opt .AppName , metav1.GetOptions {})
83
86
if err != nil {
84
87
log .Fatalf (`Unknown ReplicationController %s/%s` , opt .Namespace , opt .AppName )
85
88
}
86
89
case "StatefulSets" , "StatefulSet" :
87
90
opt .AppKind = "StatefulSet"
88
91
opt .SmartPrefix = opt .PodName
92
+ opt .SnapshotHostname = opt .PodName
89
93
_ , err := kubeClient .AppsV1beta1 ().StatefulSets (opt .Namespace ).Get (opt .AppName , metav1.GetOptions {})
90
94
if err != nil {
91
95
log .Fatalf (`Unknown StatefulSet %s/%s` , opt .Namespace , opt .AppName )
92
96
}
93
97
case "DaemonSets" , "DaemonSet" , "daemonsets" , "daemonset" :
94
98
opt .AppKind = "DaemonSet"
95
99
opt .SmartPrefix = opt .NodeName
100
+ opt .SnapshotHostname = opt .NodeName
96
101
_ , err := kubeClient .ExtensionsV1beta1 ().DaemonSets (opt .Namespace ).Get (opt .AppName , metav1.GetOptions {})
97
102
if err != nil {
98
103
log .Fatalf (`Unknown DaemonSet %s/%s` , opt .Namespace , opt .AppName )
0 commit comments