Make scheduler emit events

This commit is contained in:
Daniel Smith
2014-10-14 15:38:31 -07:00
parent 95b855b8e6
commit 10214457b7
4 changed files with 39 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ limitations under the License.
package testapi
import (
"fmt"
"os"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
@@ -52,3 +53,13 @@ func ResourceVersioner() runtime.ResourceVersioner {
}
return interfaces.ResourceVersioner
}
// SelfLink returns a self link that will appear to be for the version Version().
// 'resource' should be the resource path, e.g. "pods" for the Pod type. 'name' should be
// empty for lists.
func SelfLink(resource, name string) string {
if name == "" {
return fmt.Sprintf("/api/%s/%s", Version(), resource)
}
return fmt.Sprintf("/api/%s/%s/%s", Version(), resource, name)
}