yangwwei commented on a change in pull request #203:
URL: 
https://github.com/apache/incubator-yunikorn-k8shim/pull/203#discussion_r514615124



##########
File path: pkg/cache/placeholder.go
##########
@@ -0,0 +1,85 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package cache
+
+import (
+       "fmt"
+
+       v1 "k8s.io/api/core/v1"
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+       
"github.com/apache/incubator-yunikorn-k8shim/pkg/apis/yunikorn.apache.org/v1alpha1"
+       "github.com/apache/incubator-yunikorn-k8shim/pkg/common/constants"
+       "github.com/apache/incubator-yunikorn-k8shim/pkg/common/utils"
+)
+
+type Placeholder struct {
+       appID         string
+       taskGroupName string
+       pod           *v1.Pod
+       stage         PlaceholderState
+}
+
+type PlaceholderState string
+
+const (
+       Acquiring PlaceholderState = "Acquiring"
+       Acquired  PlaceholderState = "Acquired"
+)
+
+func newPlaceholder(placeholderName string, app *Application, taskGroup 
*v1alpha1.TaskGroup) *Placeholder {
+       placeholderPod := &v1.Pod{

Review comment:
       Yes, the idea is to have an **annotation** field in the placeholder pod 
to differentiate from the normal ones. The annotation is 
"yunikorn.apache.org/task-group-name". We use this to check if a pod is a 
placeholder, and which task group it belongs to.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to