Skip to content

Commit ae911b5

Browse files
committed
WIP
1 parent 5ef0246 commit ae911b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+741
-719
lines changed

pkg/apps/metrics/prometheus/metrics_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
kcorelisters "k8s.io/client-go/listers/core/v1"
1515
"k8s.io/client-go/tools/cache"
1616

17-
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
17+
appsutil "github.com/openshift/origin/pkg/apps/util"
1818
)
1919

2020
var (
@@ -24,7 +24,7 @@ var (
2424

2525
func mockRC(name string, version int, annotations map[string]string, generation int64, creationTime metav1.Time) *kapiv1.ReplicationController {
2626
r := &kapiv1.ReplicationController{}
27-
annotations[appsapi.DeploymentConfigAnnotation] = name
27+
annotations[appsutil.DeploymentConfigAnnotation] = name
2828
r.SetName(name + fmt.Sprintf("-%d", version))
2929
r.SetNamespace("test")
3030
r.SetCreationTimestamp(creationTime)

pkg/build/controller/policy/serial_latest_only.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (s *SerialLatestOnlyPolicy) cancelPreviousBuilds(build *buildapi.Build) []e
6464
builds, err := buildutil.BuildConfigBuilds(s.BuildLister, build.Namespace, bcName, func(b *buildapi.Build) bool {
6565
// Do not cancel the complete builds, builds that were already cancelled, or
6666
// running builds.
67-
if buildutil.IsBuildComplete(b) || b.Status.Phase == buildapi.BuildPhaseRunning {
67+
if buildutil.IsBuildCompleteInternal(b) || b.Status.Phase == buildapi.BuildPhaseRunning {
6868
return false
6969
}
7070

pkg/oc/cli/admin/prune/imageprune/helper.go

+12-11
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@ import (
1010
"github.com/docker/distribution/registry/api/errcode"
1111
"github.com/golang/glog"
1212

13+
corev1 "k8s.io/api/core/v1"
1314
kmeta "k8s.io/apimachinery/pkg/api/meta"
1415
"k8s.io/apimachinery/pkg/runtime"
1516
kerrors "k8s.io/apimachinery/pkg/util/errors"
17+
ref "k8s.io/client-go/tools/reference"
1618
"k8s.io/kubernetes/pkg/api/legacyscheme"
17-
kapiref "k8s.io/kubernetes/pkg/api/ref"
18-
kapi "k8s.io/kubernetes/pkg/apis/core"
1919

20+
imagev1 "github.com/openshift/api/image/v1"
2021
imageapi "github.com/openshift/origin/pkg/image/apis/image"
2122
"github.com/openshift/origin/pkg/util/netutils"
2223
)
2324

2425
// order younger images before older
25-
type imgByAge []*imageapi.Image
26+
type imgByAge []*imagev1.Image
2627

2728
func (ba imgByAge) Len() int { return len(ba) }
2829
func (ba imgByAge) Swap(i, j int) { ba[i], ba[j] = ba[j], ba[i] }
@@ -31,7 +32,7 @@ func (ba imgByAge) Less(i, j int) bool {
3132
}
3233

3334
// order younger image stream before older
34-
type isByAge []imageapi.ImageStream
35+
type isByAge []imagev1.ImageStream
3536

3637
func (ba isByAge) Len() int { return len(ba) }
3738
func (ba isByAge) Swap(i, j int) { ba[i], ba[j] = ba[j], ba[i] }
@@ -41,9 +42,9 @@ func (ba isByAge) Less(i, j int) bool {
4142

4243
// DetermineRegistryHost returns registry host embedded in a pull-spec of the latest unmanaged image or the
4344
// latest imagestream from the provided lists. If no such pull-spec is found, error is returned.
44-
func DetermineRegistryHost(images *imageapi.ImageList, imageStreams *imageapi.ImageStreamList) (string, error) {
45+
func DetermineRegistryHost(images *imagev1.ImageList, imageStreams *imagev1.ImageStreamList) (string, error) {
4546
var pullSpec string
46-
var managedImages []*imageapi.Image
47+
var managedImages []*imagev1.Image
4748

4849
// 1st try to determine registry url from a pull spec of the youngest managed image
4950
for i := range images.Items {
@@ -223,7 +224,7 @@ type ErrBadReference struct {
223224
reason string
224225
}
225226

226-
func newErrBadReferenceToImage(reference string, obj *kapi.ObjectReference, reason string) error {
227+
func newErrBadReferenceToImage(reference string, obj *corev1.ObjectReference, reason string) error {
227228
kind := "<UnknownType>"
228229
namespace := ""
229230
name := "<unknown-name>"
@@ -242,7 +243,7 @@ func newErrBadReferenceToImage(reference string, obj *kapi.ObjectReference, reas
242243
}
243244
}
244245

245-
func newErrBadReferenceTo(targetKind, reference string, obj *kapi.ObjectReference, reason string) error {
246+
func newErrBadReferenceTo(targetKind, reference string, obj *corev1.ObjectReference, reason string) error {
246247
return &ErrBadReference{
247248
kind: obj.Kind,
248249
namespace: obj.Namespace,
@@ -282,7 +283,7 @@ func getName(obj runtime.Object) string {
282283
return fmt.Sprintf("%s/%s", ns, accessor.GetName())
283284
}
284285

285-
func getKindName(obj *kapi.ObjectReference) string {
286+
func getKindName(obj *corev1.ObjectReference) string {
286287
if obj == nil {
287288
return "unknown object"
288289
}
@@ -293,8 +294,8 @@ func getKindName(obj *kapi.ObjectReference) string {
293294
return fmt.Sprintf("%s[%s]", obj.Kind, name)
294295
}
295296

296-
func getRef(obj runtime.Object) *kapi.ObjectReference {
297-
ref, err := kapiref.GetReference(legacyscheme.Scheme, obj)
297+
func getRef(obj runtime.Object) *corev1.ObjectReference {
298+
ref, err := ref.GetReference(legacyscheme.Scheme, obj)
298299
if err != nil {
299300
glog.Errorf("failed to get reference to object %T: %v", obj, err)
300301
return nil

0 commit comments

Comments
 (0)