Skip to content

Commit 008e50d

Browse files
Merge pull request #19934 from liggitt/column-printers
Add server-side column printer support for openshift objects
2 parents 8331d7c + 1494da9 commit 008e50d

File tree

42 files changed

+274
-20
lines changed

Some content is hidden

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

42 files changed

+274
-20
lines changed

hack/import-restrictions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@
499499
"github.com/openshift/origin/pkg/oauth/urls",
500500
"github.com/openshift/origin/pkg/oauth/util",
501501
"github.com/openshift/origin/pkg/pod/envresolve",
502+
"github.com/openshift/origin/pkg/printers/internalversion",
502503
"github.com/openshift/origin/pkg/project/apis/project",
503504
"github.com/openshift/origin/pkg/project/apis/project/helpers",
504505
"github.com/openshift/origin/pkg/project/registry/projectrequest/delegated",

pkg/apps/registry/deployconfig/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ import (
1616
"k8s.io/kubernetes/pkg/apis/autoscaling"
1717
autoscalingvalidation "k8s.io/kubernetes/pkg/apis/autoscaling/validation"
1818
"k8s.io/kubernetes/pkg/apis/extensions"
19+
"k8s.io/kubernetes/pkg/printers"
20+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
1921
"k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/labels"
2022

2123
appsapiv1 "github.com/openshift/api/apps/v1"
2224
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
2325
"github.com/openshift/origin/pkg/apps/registry/deployconfig"
26+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
2427
"github.com/openshift/origin/pkg/util/restoptions"
2528
)
2629

@@ -52,6 +55,8 @@ func NewREST(optsGetter restoptions.Getter) (*REST, *StatusREST, *ScaleREST, err
5255
NewListFunc: func() runtime.Object { return &appsapi.DeploymentConfigList{} },
5356
DefaultQualifiedResource: appsapi.Resource("deploymentconfigs"),
5457

58+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
59+
5560
CreateStrategy: deployconfig.GroupStrategy,
5661
UpdateStrategy: deployconfig.GroupStrategy,
5762
DeleteStrategy: deployconfig.GroupStrategy,

pkg/authorization/registry/clusterrole/proxy.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ import (
88
"k8s.io/apiserver/pkg/registry/rest"
99
restclient "k8s.io/client-go/rest"
1010
rbacinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion"
11+
"k8s.io/kubernetes/pkg/printers"
12+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
1113

1214
authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
1315
"github.com/openshift/origin/pkg/authorization/registry/util"
1416
authclient "github.com/openshift/origin/pkg/client/impersonatingclient"
17+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1518
utilregistry "github.com/openshift/origin/pkg/util/registry"
1619
)
1720

1821
type REST struct {
1922
privilegedClient restclient.Interface
23+
rest.TableConvertor
2024
}
2125

2226
var _ rest.Lister = &REST{}
@@ -25,7 +29,10 @@ var _ rest.CreaterUpdater = &REST{}
2529
var _ rest.GracefulDeleter = &REST{}
2630

2731
func NewREST(client restclient.Interface) utilregistry.NoWatchStorage {
28-
return utilregistry.WrapNoWatchStorageError(&REST{privilegedClient: client})
32+
return utilregistry.WrapNoWatchStorageError(&REST{
33+
privilegedClient: client,
34+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
35+
})
2936
}
3037

3138
func (s *REST) New() runtime.Object {

pkg/authorization/registry/clusterrolebinding/proxy.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ import (
88
"k8s.io/apiserver/pkg/registry/rest"
99
restclient "k8s.io/client-go/rest"
1010
rbacinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion"
11+
"k8s.io/kubernetes/pkg/printers"
12+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
1113

1214
authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
1315
"github.com/openshift/origin/pkg/authorization/registry/util"
1416
authclient "github.com/openshift/origin/pkg/client/impersonatingclient"
17+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1518
utilregistry "github.com/openshift/origin/pkg/util/registry"
1619
)
1720

1821
type REST struct {
1922
privilegedClient restclient.Interface
23+
rest.TableConvertor
2024
}
2125

2226
var _ rest.Lister = &REST{}
@@ -25,7 +29,10 @@ var _ rest.CreaterUpdater = &REST{}
2529
var _ rest.GracefulDeleter = &REST{}
2630

2731
func NewREST(client restclient.Interface) utilregistry.NoWatchStorage {
28-
return utilregistry.WrapNoWatchStorageError(&REST{privilegedClient: client})
32+
return utilregistry.WrapNoWatchStorageError(&REST{
33+
privilegedClient: client,
34+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
35+
})
2936
}
3037

3138
func (s *REST) New() runtime.Object {

pkg/authorization/registry/role/proxy.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ import (
99
"k8s.io/apiserver/pkg/registry/rest"
1010
restclient "k8s.io/client-go/rest"
1111
rbacinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion"
12+
"k8s.io/kubernetes/pkg/printers"
13+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
1214

1315
authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
1416
"github.com/openshift/origin/pkg/authorization/registry/util"
1517
authclient "github.com/openshift/origin/pkg/client/impersonatingclient"
18+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1619
utilregistry "github.com/openshift/origin/pkg/util/registry"
1720
)
1821

1922
type REST struct {
2023
privilegedClient restclient.Interface
24+
rest.TableConvertor
2125
}
2226

2327
var _ rest.Lister = &REST{}
@@ -26,7 +30,10 @@ var _ rest.CreaterUpdater = &REST{}
2630
var _ rest.GracefulDeleter = &REST{}
2731

2832
func NewREST(client restclient.Interface) utilregistry.NoWatchStorage {
29-
return utilregistry.WrapNoWatchStorageError(&REST{privilegedClient: client})
33+
return utilregistry.WrapNoWatchStorageError(&REST{
34+
privilegedClient: client,
35+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
36+
})
3037
}
3138

3239
func (s *REST) New() runtime.Object {

pkg/authorization/registry/rolebinding/proxy.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ import (
99
"k8s.io/apiserver/pkg/registry/rest"
1010
restclient "k8s.io/client-go/rest"
1111
rbacinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion"
12+
"k8s.io/kubernetes/pkg/printers"
13+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
1214

1315
authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
1416
"github.com/openshift/origin/pkg/authorization/registry/util"
1517
authclient "github.com/openshift/origin/pkg/client/impersonatingclient"
18+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1619
utilregistry "github.com/openshift/origin/pkg/util/registry"
1720
)
1821

1922
type REST struct {
2023
privilegedClient restclient.Interface
24+
rest.TableConvertor
2125
}
2226

2327
var _ rest.Lister = &REST{}
@@ -26,7 +30,10 @@ var _ rest.CreaterUpdater = &REST{}
2630
var _ rest.GracefulDeleter = &REST{}
2731

2832
func NewREST(client restclient.Interface) utilregistry.NoWatchStorage {
29-
return utilregistry.WrapNoWatchStorageError(&REST{privilegedClient: client})
33+
return utilregistry.WrapNoWatchStorageError(&REST{
34+
privilegedClient: client,
35+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
36+
})
3037
}
3138

3239
func (s *REST) New() runtime.Object {

pkg/authorization/registry/rolebindingrestriction/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import (
55
"k8s.io/apiserver/pkg/registry/generic"
66
"k8s.io/apiserver/pkg/registry/generic/registry"
77
"k8s.io/apiserver/pkg/registry/rest"
8+
"k8s.io/kubernetes/pkg/printers"
9+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
810

911
authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
1012
"github.com/openshift/origin/pkg/authorization/registry/rolebindingrestriction"
13+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1114
"github.com/openshift/origin/pkg/util/restoptions"
1215
)
1316

@@ -24,6 +27,8 @@ func NewREST(optsGetter restoptions.Getter) (*REST, error) {
2427
NewListFunc: func() runtime.Object { return &authorizationapi.RoleBindingRestrictionList{} },
2528
DefaultQualifiedResource: authorizationapi.Resource("rolebindingrestrictions"),
2629

30+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
31+
2732
CreateStrategy: rolebindingrestriction.Strategy,
2833
UpdateStrategy: rolebindingrestriction.Strategy,
2934
DeleteStrategy: rolebindingrestriction.Strategy,

pkg/build/registry/build/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ import (
77
"k8s.io/apiserver/pkg/registry/generic/registry"
88
"k8s.io/apiserver/pkg/registry/rest"
99
"k8s.io/apiserver/pkg/storage"
10+
"k8s.io/kubernetes/pkg/printers"
11+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
1012

1113
buildapi "github.com/openshift/origin/pkg/build/apis/build"
1214
"github.com/openshift/origin/pkg/build/registry/build"
15+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1316
"github.com/openshift/origin/pkg/util/restoptions"
1417
)
1518

@@ -32,6 +35,8 @@ func NewREST(optsGetter restoptions.Getter) (*REST, *DetailsREST, error) {
3235
NewListFunc: func() runtime.Object { return &buildapi.BuildList{} },
3336
DefaultQualifiedResource: buildapi.Resource("builds"),
3437

38+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
39+
3540
CreateStrategy: build.Strategy,
3641
UpdateStrategy: build.Strategy,
3742
DeleteStrategy: build.Strategy,

pkg/build/registry/buildconfig/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import (
55
"k8s.io/apiserver/pkg/registry/generic"
66
"k8s.io/apiserver/pkg/registry/generic/registry"
77
"k8s.io/apiserver/pkg/registry/rest"
8+
"k8s.io/kubernetes/pkg/printers"
9+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
810

911
buildapi "github.com/openshift/origin/pkg/build/apis/build"
1012
"github.com/openshift/origin/pkg/build/registry/buildconfig"
13+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1114
"github.com/openshift/origin/pkg/util/restoptions"
1215
)
1316

@@ -36,6 +39,8 @@ func NewREST(optsGetter restoptions.Getter) (*REST, error) {
3639
NewListFunc: func() runtime.Object { return &buildapi.BuildConfigList{} },
3740
DefaultQualifiedResource: buildapi.Resource("buildconfigs"),
3841

42+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
43+
3944
CreateStrategy: buildconfig.GroupStrategy,
4045
UpdateStrategy: buildconfig.GroupStrategy,
4146
DeleteStrategy: buildconfig.GroupStrategy,

pkg/cmd/server/origin/master_config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import (
4141
imageinformer "github.com/openshift/origin/pkg/image/generated/informers/internalversion"
4242
networkinformer "github.com/openshift/origin/pkg/network/generated/informers/internalversion"
4343
oauthinformer "github.com/openshift/origin/pkg/oauth/generated/informers/internalversion"
44+
_ "github.com/openshift/origin/pkg/printers/internalversion"
4445
projectauth "github.com/openshift/origin/pkg/project/auth"
4546
projectcache "github.com/openshift/origin/pkg/project/cache"
4647
"github.com/openshift/origin/pkg/quota/controller/clusterquotamapping"

pkg/image/registry/image/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import (
55
"k8s.io/apiserver/pkg/registry/generic"
66
"k8s.io/apiserver/pkg/registry/generic/registry"
77
"k8s.io/apiserver/pkg/registry/rest"
8+
"k8s.io/kubernetes/pkg/printers"
9+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
810

911
imageapi "github.com/openshift/origin/pkg/image/apis/image"
1012
"github.com/openshift/origin/pkg/image/registry/image"
13+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1114
"github.com/openshift/origin/pkg/util/restoptions"
1215
)
1316

@@ -25,6 +28,8 @@ func NewREST(optsGetter restoptions.Getter) (*REST, error) {
2528
NewListFunc: func() runtime.Object { return &imageapi.ImageList{} },
2629
DefaultQualifiedResource: imageapi.Resource("images"),
2730

31+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
32+
2833
CreateStrategy: image.Strategy,
2934
UpdateStrategy: image.Strategy,
3035
DeleteStrategy: image.Strategy,

pkg/image/registry/imagestream/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ import (
99
"k8s.io/apiserver/pkg/registry/rest"
1010
"k8s.io/apiserver/pkg/storage"
1111
authorizationclient "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authorization/internalversion"
12+
"k8s.io/kubernetes/pkg/printers"
13+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
1214

1315
imageadmission "github.com/openshift/origin/pkg/image/admission"
1416
imageapi "github.com/openshift/origin/pkg/image/apis/image"
1517
"github.com/openshift/origin/pkg/image/apis/image/validation/whitelist"
1618
"github.com/openshift/origin/pkg/image/registry/imagestream"
19+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1720
"github.com/openshift/origin/pkg/util/restoptions"
1821
)
1922

@@ -48,6 +51,8 @@ func NewREST(
4851
NewFunc: func() runtime.Object { return &imageapi.ImageStream{} },
4952
NewListFunc: func() runtime.Object { return &imageapi.ImageStreamList{} },
5053
DefaultQualifiedResource: imageapi.Resource("imagestreams"),
54+
55+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
5156
}
5257

5358
rest := &REST{

pkg/image/registry/imagestreamimage/rest.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ import (
66
"k8s.io/apimachinery/pkg/runtime"
77
apirequest "k8s.io/apiserver/pkg/endpoints/request"
88
"k8s.io/apiserver/pkg/registry/rest"
9+
"k8s.io/kubernetes/pkg/printers"
10+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
911

1012
imageapi "github.com/openshift/origin/pkg/image/apis/image"
1113
"github.com/openshift/origin/pkg/image/registry/image"
1214
"github.com/openshift/origin/pkg/image/registry/imagestream"
1315
"github.com/openshift/origin/pkg/image/util"
16+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1417
)
1518

1619
// REST implements the RESTStorage interface in terms of an image registry and
@@ -20,6 +23,7 @@ import (
2023
type REST struct {
2124
imageRegistry image.Registry
2225
imageStreamRegistry imagestream.Registry
26+
rest.TableConvertor
2327
}
2428

2529
var _ rest.Getter = &REST{}
@@ -32,7 +36,11 @@ func (r *REST) ShortNames() []string {
3236

3337
// NewREST returns a new REST.
3438
func NewREST(imageRegistry image.Registry, imageStreamRegistry imagestream.Registry) *REST {
35-
return &REST{imageRegistry, imageStreamRegistry}
39+
return &REST{
40+
imageRegistry,
41+
imageStreamRegistry,
42+
printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
43+
}
3644
}
3745

3846
// New is only implemented to make REST implement RESTStorage

pkg/image/registry/imagestreamtag/rest.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ import (
99
"k8s.io/apimachinery/pkg/runtime"
1010
apirequest "k8s.io/apiserver/pkg/endpoints/request"
1111
"k8s.io/apiserver/pkg/registry/rest"
12+
"k8s.io/kubernetes/pkg/printers"
13+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
1214

1315
oapi "github.com/openshift/origin/pkg/api"
1416
imageapi "github.com/openshift/origin/pkg/image/apis/image"
1517
"github.com/openshift/origin/pkg/image/apis/image/validation/whitelist"
1618
"github.com/openshift/origin/pkg/image/registry/image"
1719
"github.com/openshift/origin/pkg/image/registry/imagestream"
1820
"github.com/openshift/origin/pkg/image/util"
21+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1922
)
2023

2124
// REST implements the RESTStorage interface for ImageStreamTag
@@ -24,6 +27,7 @@ type REST struct {
2427
imageRegistry image.Registry
2528
imageStreamRegistry imagestream.Registry
2629
strategy Strategy
30+
rest.TableConvertor
2731
}
2832

2933
// NewREST returns a new REST.
@@ -32,6 +36,7 @@ func NewREST(imageRegistry image.Registry, imageStreamRegistry imagestream.Regis
3236
imageRegistry: imageRegistry,
3337
imageStreamRegistry: imageStreamRegistry,
3438
strategy: NewStrategy(registryWhitelister),
39+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
3540
}
3641
}
3742

pkg/network/registry/clusternetwork/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import (
55
"k8s.io/apiserver/pkg/registry/generic"
66
"k8s.io/apiserver/pkg/registry/generic/registry"
77
"k8s.io/apiserver/pkg/registry/rest"
8+
"k8s.io/kubernetes/pkg/printers"
9+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
810

911
networkapi "github.com/openshift/origin/pkg/network/apis/network"
1012
"github.com/openshift/origin/pkg/network/registry/clusternetwork"
13+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1114
"github.com/openshift/origin/pkg/util/restoptions"
1215
)
1316

@@ -25,6 +28,8 @@ func NewREST(optsGetter restoptions.Getter) (*REST, error) {
2528
NewListFunc: func() runtime.Object { return &networkapi.ClusterNetworkList{} },
2629
DefaultQualifiedResource: networkapi.Resource("clusternetworks"),
2730

31+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
32+
2833
CreateStrategy: clusternetwork.Strategy,
2934
UpdateStrategy: clusternetwork.Strategy,
3035
DeleteStrategy: clusternetwork.Strategy,

pkg/network/registry/egressnetworkpolicy/etcd/etcd.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import (
55
"k8s.io/apiserver/pkg/registry/generic"
66
"k8s.io/apiserver/pkg/registry/generic/registry"
77
"k8s.io/apiserver/pkg/registry/rest"
8+
"k8s.io/kubernetes/pkg/printers"
9+
printerstorage "k8s.io/kubernetes/pkg/printers/storage"
810

911
networkapi "github.com/openshift/origin/pkg/network/apis/network"
1012
"github.com/openshift/origin/pkg/network/registry/egressnetworkpolicy"
13+
printersinternal "github.com/openshift/origin/pkg/printers/internalversion"
1114
"github.com/openshift/origin/pkg/util/restoptions"
1215
)
1316

@@ -25,6 +28,8 @@ func NewREST(optsGetter restoptions.Getter) (*REST, error) {
2528
NewListFunc: func() runtime.Object { return &networkapi.EgressNetworkPolicyList{} },
2629
DefaultQualifiedResource: networkapi.Resource("egressnetworkpolicies"),
2730

31+
TableConvertor: printerstorage.TableConvertor{TablePrinter: printers.NewTablePrinter().With(printersinternal.AddHandlers)},
32+
2833
CreateStrategy: egressnetworkpolicy.Strategy,
2934
UpdateStrategy: egressnetworkpolicy.Strategy,
3035
DeleteStrategy: egressnetworkpolicy.Strategy,

0 commit comments

Comments
 (0)