mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
Make scheduler emit events
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user