Skip to content

Commit

Permalink
fixup UPSTREAM: <carry>: SCC - generated client, fixup test
Browse files Browse the repository at this point in the history
  • Loading branch information
liggitt committed Mar 10, 2016
1 parent 05d78d5 commit d49dd0c
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 109 deletions.
2 changes: 2 additions & 0 deletions cmd/libs/go2idl/client-gen/generators/client_generator.go
Expand Up @@ -38,6 +38,8 @@ import (
func NameSystems() namer.NameSystems {
pluralExceptions := map[string]string{
"Endpoints": "Endpoints",

"SecurityContextConstraints": "SecurityContextConstraints",
}
return namer.NameSystems{
"public": namer.NewPublicNamer(0),
Expand Down
42 changes: 21 additions & 21 deletions pkg/api/deep_copy_generated.go
Expand Up @@ -72,18 +72,18 @@ func init() {
DeepCopy_api_ExecAction,
DeepCopy_api_ExportOptions,
DeepCopy_api_FCVolumeSource,
DeepCopy_api_FSGroupStrategyOptions,
DeepCopy_api_FlexVolumeSource,
DeepCopy_api_FlockerVolumeSource,
deepCopy_api_FSGroupStrategyOptions,
DeepCopy_api_GCEPersistentDiskVolumeSource,
DeepCopy_api_GitRepoVolumeSource,
DeepCopy_api_GlusterfsVolumeSource,
DeepCopy_api_HTTPGetAction,
DeepCopy_api_HTTPHeader,
DeepCopy_api_Handler,
DeepCopy_api_HostPathVolumeSource,
DeepCopy_api_IDRange,
DeepCopy_api_ISCSIVolumeSource,
deepCopy_api_IDRange,
DeepCopy_api_KeyToPath,
DeepCopy_api_Lifecycle,
DeepCopy_api_LimitRange,
Expand Down Expand Up @@ -154,16 +154,16 @@ func init() {
DeepCopy_api_ResourceQuotaSpec,
DeepCopy_api_ResourceQuotaStatus,
DeepCopy_api_ResourceRequirements,
deepCopy_api_RunAsUserStrategyOptions,
deepCopy_api_SELinuxContextStrategyOptions,
DeepCopy_api_RunAsUserStrategyOptions,
DeepCopy_api_SELinuxContextStrategyOptions,
DeepCopy_api_SELinuxOptions,
DeepCopy_api_Secret,
DeepCopy_api_SecretKeySelector,
DeepCopy_api_SecretList,
DeepCopy_api_SecretVolumeSource,
DeepCopy_api_SecurityContext,
deepCopy_api_SecurityContextConstraints,
deepCopy_api_SecurityContextConstraintsList,
DeepCopy_api_SecurityContextConstraints,
DeepCopy_api_SecurityContextConstraintsList,
DeepCopy_api_SerializedReference,
DeepCopy_api_Service,
DeepCopy_api_ServiceAccount,
Expand All @@ -173,7 +173,7 @@ func init() {
DeepCopy_api_ServiceProxyOptions,
DeepCopy_api_ServiceSpec,
DeepCopy_api_ServiceStatus,
deepCopy_api_SupplementalGroupsStrategyOptions,
DeepCopy_api_SupplementalGroupsStrategyOptions,
DeepCopy_api_TCPSocketAction,
DeepCopy_api_Volume,
DeepCopy_api_VolumeMount,
Expand Down Expand Up @@ -909,13 +909,13 @@ func DeepCopy_api_FCVolumeSource(in FCVolumeSource, out *FCVolumeSource, c *conv
return nil
}

func deepCopy_api_FSGroupStrategyOptions(in FSGroupStrategyOptions, out *FSGroupStrategyOptions, c *conversion.Cloner) error {
func DeepCopy_api_FSGroupStrategyOptions(in FSGroupStrategyOptions, out *FSGroupStrategyOptions, c *conversion.Cloner) error {
out.Type = in.Type
if in.Ranges != nil {
in, out := in.Ranges, &out.Ranges
*out = make([]IDRange, len(in))
for i := range in {
if err := deepCopy_api_IDRange(in[i], &(*out)[i], c); err != nil {
if err := DeepCopy_api_IDRange(in[i], &(*out)[i], c); err != nil {
return err
}
}
Expand Down Expand Up @@ -1040,7 +1040,7 @@ func DeepCopy_api_HostPathVolumeSource(in HostPathVolumeSource, out *HostPathVol
return nil
}

func deepCopy_api_IDRange(in IDRange, out *IDRange, c *conversion.Cloner) error {
func DeepCopy_api_IDRange(in IDRange, out *IDRange, c *conversion.Cloner) error {
out.Min = in.Min
out.Max = in.Max
return nil
Expand Down Expand Up @@ -2556,7 +2556,7 @@ func DeepCopy_api_ResourceRequirements(in ResourceRequirements, out *ResourceReq
return nil
}

func deepCopy_api_RunAsUserStrategyOptions(in RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, c *conversion.Cloner) error {
func DeepCopy_api_RunAsUserStrategyOptions(in RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, c *conversion.Cloner) error {
out.Type = in.Type
if in.UID != nil {
in, out := in.UID, &out.UID
Expand All @@ -2582,7 +2582,7 @@ func deepCopy_api_RunAsUserStrategyOptions(in RunAsUserStrategyOptions, out *Run
return nil
}

func deepCopy_api_SELinuxContextStrategyOptions(in SELinuxContextStrategyOptions, out *SELinuxContextStrategyOptions, c *conversion.Cloner) error {
func DeepCopy_api_SELinuxContextStrategyOptions(in SELinuxContextStrategyOptions, out *SELinuxContextStrategyOptions, c *conversion.Cloner) error {
out.Type = in.Type
if in.SELinuxOptions != nil {
in, out := in.SELinuxOptions, &out.SELinuxOptions
Expand Down Expand Up @@ -2712,7 +2712,7 @@ func DeepCopy_api_SecurityContext(in SecurityContext, out *SecurityContext, c *c
return nil
}

func deepCopy_api_SecurityContextConstraints(in SecurityContextConstraints, out *SecurityContextConstraints, c *conversion.Cloner) error {
func DeepCopy_api_SecurityContextConstraints(in SecurityContextConstraints, out *SecurityContextConstraints, c *conversion.Cloner) error {
if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
Expand Down Expand Up @@ -2759,16 +2759,16 @@ func deepCopy_api_SecurityContextConstraints(in SecurityContextConstraints, out
out.AllowHostPorts = in.AllowHostPorts
out.AllowHostPID = in.AllowHostPID
out.AllowHostIPC = in.AllowHostIPC
if err := deepCopy_api_SELinuxContextStrategyOptions(in.SELinuxContext, &out.SELinuxContext, c); err != nil {
if err := DeepCopy_api_SELinuxContextStrategyOptions(in.SELinuxContext, &out.SELinuxContext, c); err != nil {
return err
}
if err := deepCopy_api_RunAsUserStrategyOptions(in.RunAsUser, &out.RunAsUser, c); err != nil {
if err := DeepCopy_api_RunAsUserStrategyOptions(in.RunAsUser, &out.RunAsUser, c); err != nil {
return err
}
if err := deepCopy_api_SupplementalGroupsStrategyOptions(in.SupplementalGroups, &out.SupplementalGroups, c); err != nil {
if err := DeepCopy_api_SupplementalGroupsStrategyOptions(in.SupplementalGroups, &out.SupplementalGroups, c); err != nil {
return err
}
if err := deepCopy_api_FSGroupStrategyOptions(in.FSGroup, &out.FSGroup, c); err != nil {
if err := DeepCopy_api_FSGroupStrategyOptions(in.FSGroup, &out.FSGroup, c); err != nil {
return err
}
if in.Users != nil {
Expand All @@ -2788,7 +2788,7 @@ func deepCopy_api_SecurityContextConstraints(in SecurityContextConstraints, out
return nil
}

func deepCopy_api_SecurityContextConstraintsList(in SecurityContextConstraintsList, out *SecurityContextConstraintsList, c *conversion.Cloner) error {
func DeepCopy_api_SecurityContextConstraintsList(in SecurityContextConstraintsList, out *SecurityContextConstraintsList, c *conversion.Cloner) error {
if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
Expand All @@ -2799,7 +2799,7 @@ func deepCopy_api_SecurityContextConstraintsList(in SecurityContextConstraintsLi
in, out := in.Items, &out.Items
*out = make([]SecurityContextConstraints, len(in))
for i := range in {
if err := deepCopy_api_SecurityContextConstraints(in[i], &(*out)[i], c); err != nil {
if err := DeepCopy_api_SecurityContextConstraints(in[i], &(*out)[i], c); err != nil {
return err
}
}
Expand Down Expand Up @@ -2970,13 +2970,13 @@ func DeepCopy_api_ServiceStatus(in ServiceStatus, out *ServiceStatus, c *convers
return nil
}

func deepCopy_api_SupplementalGroupsStrategyOptions(in SupplementalGroupsStrategyOptions, out *SupplementalGroupsStrategyOptions, c *conversion.Cloner) error {
func DeepCopy_api_SupplementalGroupsStrategyOptions(in SupplementalGroupsStrategyOptions, out *SupplementalGroupsStrategyOptions, c *conversion.Cloner) error {
out.Type = in.Type
if in.Ranges != nil {
in, out := in.Ranges, &out.Ranges
*out = make([]IDRange, len(in))
for i := range in {
if err := deepCopy_api_IDRange(in[i], &(*out)[i], c); err != nil {
if err := DeepCopy_api_IDRange(in[i], &(*out)[i], c); err != nil {
return err
}
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/types.go
Expand Up @@ -2538,6 +2538,8 @@ const (
DefaultSchedulerName = "default-scheduler"
)

// +genclient=true,nonNamespaced=true

// SecurityContextConstraints governs the ability to make requests that affect the SecurityContext
// that will be applied to a container.
type SecurityContextConstraints struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/v1/types.go
Expand Up @@ -2959,6 +2959,8 @@ const (
DefaultSchedulerName = "default-scheduler"
)

// +genclient=true,nonNamespaced=true

// SecurityContextConstraints governs the ability to make requests that affect the SecurityContext
// that will be applied to a container.
type SecurityContextConstraints struct {
Expand Down
11 changes: 5 additions & 6 deletions pkg/client/typed/generated/core/unversioned/core_client.go
Expand Up @@ -37,10 +37,9 @@ type CoreInterface interface {
ReplicationControllersGetter
ResourceQuotasGetter
SecretsGetter
SecurityContextConstraintsGetter
ServicesGetter
ServiceAccountsGetter

SecurityContextConstraintsInterface
}

// CoreClient is used to interact with features provided by the Core group.
Expand Down Expand Up @@ -104,6 +103,10 @@ func (c *CoreClient) Secrets(namespace string) SecretInterface {
return newSecrets(c, namespace)
}

func (c *CoreClient) SecurityContextConstraints() SecurityContextConstraintsInterface {
return newSecurityContextConstraints(c)
}

func (c *CoreClient) Services(namespace string) ServiceInterface {
return newServices(c, namespace)
}
Expand Down Expand Up @@ -165,7 +168,3 @@ func setConfigDefaults(config *restclient.Config) error {
}
return nil
}

func (c *CoreClient) SecurityContextConstraints() SecurityContextConstraintInterface {
return newSecurityContextConstraints(c)
}
Expand Up @@ -81,14 +81,14 @@ func (c *FakeCore) Secrets(namespace string) unversioned.SecretInterface {
return &FakeSecrets{c, namespace}
}

func (c *FakeCore) SecurityContextConstraints() unversioned.SecurityContextConstraintsInterface {
return &FakeSecurityContextConstraints{c}
}

func (c *FakeCore) Services(namespace string) unversioned.ServiceInterface {
return &FakeServices{c, namespace}
}

func (c *FakeCore) ServiceAccounts(namespace string) unversioned.ServiceAccountInterface {
return &FakeServiceAccounts{c, namespace}
}

func (c *FakeCore) SecurityContextConstraints() unversioned.SecurityContextConstraintInterface {
return &FakeSecurityContextConstraints{Fake: c}
}
@@ -1,5 +1,5 @@
/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -17,44 +17,79 @@ limitations under the License.
package fake

import (
"k8s.io/kubernetes/pkg/api"
api "k8s.io/kubernetes/pkg/api"
core "k8s.io/kubernetes/pkg/client/testing/core"
"k8s.io/kubernetes/pkg/watch"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)

// FakeSecurityContextConstraints implements SecurityContextConstraintInterface. Meant to be
// embedded into a struct to get a default implementation. This makes faking out just
// the method you want to test easier.
// FakeSecurityContextConstraints implements SecurityContextConstraintsInterface
type FakeSecurityContextConstraints struct {
Fake *FakeCore
Namespace string
Fake *FakeCore
}

func (c *FakeSecurityContextConstraints) List(opts api.ListOptions) (*api.SecurityContextConstraintsList, error) {
obj, err := c.Fake.Invokes(core.NewRootListAction("securitycontextconstraints", opts), &api.SecurityContextConstraintsList{})
return obj.(*api.SecurityContextConstraintsList), err
func (c *FakeSecurityContextConstraints) Create(securityContextConstraints *api.SecurityContextConstraints) (result *api.SecurityContextConstraints, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction("securitycontextconstraints", securityContextConstraints), &api.SecurityContextConstraints{})
if obj == nil {
return nil, err
}
return obj.(*api.SecurityContextConstraints), err
}

func (c *FakeSecurityContextConstraints) Get(name string) (*api.SecurityContextConstraints, error) {
obj, err := c.Fake.Invokes(core.NewGetAction("securitycontextconstraints", c.Namespace, name), &api.SecurityContextConstraints{})
func (c *FakeSecurityContextConstraints) Update(securityContextConstraints *api.SecurityContextConstraints) (result *api.SecurityContextConstraints, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction("securitycontextconstraints", securityContextConstraints), &api.SecurityContextConstraints{})
if obj == nil {
return nil, err
}
return obj.(*api.SecurityContextConstraints), err
}

func (c *FakeSecurityContextConstraints) Create(scc *api.SecurityContextConstraints) (*api.SecurityContextConstraints, error) {
obj, err := c.Fake.Invokes(core.NewRootCreateAction("securitycontextconstraints", scc), &api.SecurityContextConstraints{})
return obj.(*api.SecurityContextConstraints), err
func (c *FakeSecurityContextConstraints) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction("securitycontextconstraints", name), &api.SecurityContextConstraints{})
return err
}

func (c *FakeSecurityContextConstraints) Update(scc *api.SecurityContextConstraints) (*api.SecurityContextConstraints, error) {
obj, err := c.Fake.Invokes(core.NewRootUpdateAction("securitycontextconstraints", scc), &api.SecurityContextConstraints{})
func (c *FakeSecurityContextConstraints) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewRootDeleteCollectionAction("securitycontextconstraints", listOptions)

_, err := c.Fake.Invokes(action, &api.SecurityContextConstraintsList{})
return err
}

func (c *FakeSecurityContextConstraints) Get(name string) (result *api.SecurityContextConstraints, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction("securitycontextconstraints", name), &api.SecurityContextConstraints{})
if obj == nil {
return nil, err
}
return obj.(*api.SecurityContextConstraints), err
}

func (c *FakeSecurityContextConstraints) Delete(name string) error {
_, err := c.Fake.Invokes(core.NewRootDeleteAction("securitycontextconstraints", name), &api.SecurityContextConstraints{})
return err
func (c *FakeSecurityContextConstraints) List(opts api.ListOptions) (result *api.SecurityContextConstraintsList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction("securitycontextconstraints", opts), &api.SecurityContextConstraintsList{})
if obj == nil {
return nil, err
}

label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.SecurityContextConstraintsList{}
for _, item := range obj.(*api.SecurityContextConstraintsList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}

// Watch returns a watch.Interface that watches the requested securityContextConstraints.
func (c *FakeSecurityContextConstraints) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.InvokesWatch(core.NewRootWatchAction("securitycontextconstraints", opts))
return c.Fake.
InvokesWatch(core.NewRootWatchAction("securitycontextconstraints", opts))
}
Expand Up @@ -36,6 +36,8 @@ type ResourceQuotaExpansion interface{}

type SecretExpansion interface{}

type SecurityContextConstraintsExpansion interface{}

type ServiceAccountExpansion interface{}

type ConfigMapExpansion interface{}

0 comments on commit d49dd0c

Please sign in to comment.