@@ -77,7 +77,7 @@ func NewKubeClient(config genericclioptions.RESTClientGetter) (*KubeClient, erro
77
77
// GetPod retrieves a service pod
78
78
func (kc KubeClient ) GetPod (ctx context.Context , projectName , serviceName string ) (* corev1.Pod , error ) {
79
79
pods , err := kc .client .CoreV1 ().Pods (kc .namespace ).List (ctx , metav1.ListOptions {
80
- LabelSelector : fmt .Sprintf ("%s=%s" , compose .ProjectTag , projectName ),
80
+ LabelSelector : fmt .Sprintf ("%s=%s" , compose .ProjectLabel , projectName ),
81
81
})
82
82
if err != nil {
83
83
return nil , err
@@ -87,7 +87,7 @@ func (kc KubeClient) GetPod(ctx context.Context, projectName, serviceName string
87
87
}
88
88
var pod corev1.Pod
89
89
for _ , p := range pods .Items {
90
- service := p .Labels [compose .ServiceTag ]
90
+ service := p .Labels [compose .ServiceLabel ]
91
91
if service == serviceName {
92
92
pod = p
93
93
break
@@ -155,7 +155,7 @@ func (kc KubeClient) GetContainers(ctx context.Context, projectName string, all
155
155
}
156
156
157
157
pods , err := kc .client .CoreV1 ().Pods (kc .namespace ).List (ctx , metav1.ListOptions {
158
- LabelSelector : fmt .Sprintf ("%s=%s" , compose .ProjectTag , projectName ),
158
+ LabelSelector : fmt .Sprintf ("%s=%s" , compose .ProjectLabel , projectName ),
159
159
FieldSelector : fieldSelector ,
160
160
})
161
161
if err != nil {
@@ -165,7 +165,7 @@ func (kc KubeClient) GetContainers(ctx context.Context, projectName string, all
165
165
result := []compose.ContainerSummary {}
166
166
for _ , pod := range pods .Items {
167
167
summary := podToContainerSummary (pod )
168
- serviceName := pod .GetObjectMeta ().GetLabels ()[compose .ServiceTag ]
168
+ serviceName := pod .GetObjectMeta ().GetLabels ()[compose .ServiceLabel ]
169
169
ports , ok := services [serviceName ]
170
170
if ! ok {
171
171
s , err := kc .client .CoreV1 ().Services (kc .namespace ).Get (ctx , serviceName , metav1.GetOptions {})
@@ -202,15 +202,15 @@ func (kc KubeClient) GetContainers(ctx context.Context, projectName string, all
202
202
// GetLogs retrieves pod logs
203
203
func (kc * KubeClient ) GetLogs (ctx context.Context , projectName string , consumer compose.LogConsumer , follow bool ) error {
204
204
pods , err := kc .client .CoreV1 ().Pods (kc .namespace ).List (ctx , metav1.ListOptions {
205
- LabelSelector : fmt .Sprintf ("%s=%s" , compose .ProjectTag , projectName ),
205
+ LabelSelector : fmt .Sprintf ("%s=%s" , compose .ProjectLabel , projectName ),
206
206
})
207
207
if err != nil {
208
208
return err
209
209
}
210
210
eg , ctx := errgroup .WithContext (ctx )
211
211
for _ , pod := range pods .Items {
212
212
request := kc .client .CoreV1 ().Pods (kc .namespace ).GetLogs (pod .Name , & corev1.PodLogOptions {Follow : follow })
213
- service := pod .Labels [compose .ServiceTag ]
213
+ service := pod .Labels [compose .ServiceLabel ]
214
214
w := utils .GetWriter (func (line string ) {
215
215
consumer .Log (pod .Name , service , line )
216
216
})
@@ -243,7 +243,7 @@ func (kc KubeClient) WaitForPodState(ctx context.Context, opts WaitForStatusOpti
243
243
time .Sleep (500 * time .Millisecond )
244
244
245
245
pods , err := kc .client .CoreV1 ().Pods (kc .namespace ).List (ctx , metav1.ListOptions {
246
- LabelSelector : fmt .Sprintf ("%s=%s" , compose .ProjectTag , opts .ProjectName ),
246
+ LabelSelector : fmt .Sprintf ("%s=%s" , compose .ProjectLabel , opts .ProjectName ),
247
247
})
248
248
if err != nil {
249
249
errch <- err
0 commit comments