Commit Graph

46 Commits (4db004972ad943b7f2db36e6039a3166b5e925df)

Author SHA1 Message Date
Tim St. Clair f4ce5583c2
Adjust verbosity levels of go2idl logging 2016-08-04 22:01:35 -07:00
Tim Hockin 9dd337d119 s/deep_copy/deepcopy/
Just a naming nit that was too hard to fixup-and-rebase.
2016-07-12 21:52:54 -07:00
Tim Hockin 58441e8775 Don't check in generated deep-copy code
This mostly takes the previously checked in files and removes them, and moves
the generation to be on-demand instead of manual.  Manually verified no change
in generated output.
2016-07-12 21:52:54 -07:00
Dr. Stefan Schimanski 61cde63622 Switch to typeless generated deepcopy functions for less reflection 2016-07-12 18:05:43 +02:00
Dr. Stefan Schimanski 6049623a13 Turn first deepcopy parameter into a pointer 2016-07-12 18:05:43 +02:00
Tim Hockin 82b2d2c87b Clarify copyable vs in-bounds
This make it clearer where "is copyable" is needed and where "is in bounds" is
needed.  No effect on generated code.
2016-07-07 16:49:46 -07:00
Tim Hockin 1ba6f5df9e go2idl: Allow ... pkg specs
This is closer to standard Go semantics and obsoletes our custom --recursive
flag.
2016-07-07 16:49:46 -07:00
Tim Hockin dc10f10e48 Recreate the opt-in/opt-out logic for deepcopy
This is the last piece of Clayton's #26179 to be implemented with file tags.
All diffs are accounted for.  Followup will use this to streamline some
packages.

Also add some V(5) debugging - it was helpful in diagnosing various issues, it
may be helpful again.
2016-07-07 16:49:46 -07:00
Tim Hockin 28af54138d Use file tags to generate deep-copies
This drives most of the logic of deep-copy generation from tags like:
  // +deepcopy-gen=package
..rather than hardcoded lists of packages.  This will make it possible to
subsequently generate code ONLY for packages that need it *right now*, rather
than all of them always.

Also remove pkgs that really do not need deep-copies (no symbols used
anywhere).
2016-07-07 16:49:46 -07:00
Tim Hockin 4a00a0fd6d go2idl: Allow multiple values for a comment-tag
This means that tags like:
  // +foo=bar
  // +foo=bat
..will produce []string{"bar", "bat"}.  This is needed for later commits which
will want to use this to make code generation more self contained.
2016-07-07 16:49:46 -07:00
Tim Hockin 57c3196914 Add support for manually defined DeepCopy methods
In bringing back Clayton's PR piece-by-piece this was almost as easy to
implement as his version, and is much more like what I think we should be
doing.

Specifically, any time which defines a .DeepCopy() method will have that method
called preferentially.  Otherwise we generate our own functions for
deep-copying.  This affected exactly one type - resource.Quantity.  In applying
this heuristic, several places in the generated code were simplified.

To achieve this I had to convert types.Type.Methods from a slice to a map,
which seems correct anyway (to do by-name lookups).
2016-07-07 16:49:46 -07:00
Tim Hockin be481060ea Re-add constraints to deep-copy
This re-institutes some of the rolled-back logic from previous commits. It
bounds the scope of what the deepcopy generator is willing to do with regards
to generating and calling generated functions.
2016-07-07 16:49:46 -07:00
Tim Hockin e18b2f3a2e Revert Clayton's #26179 so I can recreate it
His PR cam during the middle of this development cycle, and it was easier to
burn it down and recreate it than try to patch it into an existing series and
re-test every assumption.  This behavior will be re-introduced in subsequent
commits.
2016-07-07 16:49:46 -07:00
k8s-merge-robot de0e6de82b Merge pull request #28430 from smarterclayton/fix_empty_deep_copy
Automatic merge from submit-queue

WIP - Handle map[]struct{} in DeepCopy

Deep copy was not properly handling the empty struct case we use for Sets.

@lavalamp I need your expertise when you have some time - the go2idl parser is turning sets.String into the following tree:

    type:         sets.String           kind: Alias
      underlying: map[string]sets.Empty kind: Map
        key:      string                kind: Builtin
        elem:     set.Empty             kind: Struct
                                              ^
                                              should be Alias

Looking at tc.Named, I'm not sure what the expected outcome would be and why you flatten there.
2016-07-04 04:34:54 -07:00
Clayton Coleman 6eb04ae592 Handle map[]struct{} special 2016-07-03 00:44:25 -04:00
Clayton Coleman 534075f828
Deep copy should always use existing functions that are not ignored
While testing this fix in OpenShift it was discovered that the
PackageConstraint was overly aggressive - types that declare a public
copy function should always return true.  PackageConstraint is intended
to limit packages where we might generate deep copy function, rather
than to prevent external packages from being consumed.
2016-07-03 00:12:13 -04:00
Clayton Coleman 903a2db90a
Make generated build tag parameterizable for go2idl
Downstream generators that want to reuse the upstream generated types
need to be able to define a different ignore tag (so that they can see
the already generated types).
2016-07-03 00:12:10 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
nikhiljindal 7fcf8daf6b Moving federation/v1alpha1 to federation/v1beta1 2016-06-28 17:12:58 -07:00
k8s-merge-robot 32eccd413f Merge pull request #25562 from gtank/certificates-api-v9
Automatic merge from submit-queue

TLS bootstrap API group (alpha)

This PR only covers the new types and related client/storage code- the vast majority of the line count is codegen. The implementation differs slightly from the current proposal document based on discussions in design thread (#20439). The controller logic and kubelet support mentioned in the proposal are forthcoming in separate requests.

I submit that #18762 ("Creating a new API group is really hard") is, if anything, understating it. I've tried to structure the commits to illustrate the process.

@mikedanese @erictune @smarterclayton @deads2k

```release-note-experimental
An alpha implementation of the the TLS bootstrap API described in docs/proposals/kubelet-tls-bootstrap.md.
```

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-28 13:25:22 -07:00
George Tankersley f8f7e7e3c7 codegen: add certificates group to generators 2016-06-28 12:05:41 -07:00
Clayton Coleman 1c8b928908
Handle aliases correctly in deepcopy/conversion 2016-06-27 21:42:02 -07:00
Clayton Coleman 460726c67d
Use inline assignment on string alias deep copies 2016-06-06 17:18:22 -04:00
Clayton Coleman 0181ac61da
DeepCopy should only generate types in k8s.io/kubernetes
Also make generation more selective (require opt in) to prevent lots of
unnecessary generated deep copies.
2016-06-06 17:18:22 -04:00
Piotr Szczesniak 22dc21d703 Removed metrics api group 2016-05-31 09:48:39 +02:00
k8s-merge-robot e10625cdcc Merge pull request #25033 from smarterclayton/use_upstream_conversion
Automatic merge from submit-queue

Conversions have kube-isms and are not portable for downstream

Some minor fixes to enable generators for OpenShift and others who need
to generate conversions on Kube API groups outside the core.

@deads2k
2016-05-15 04:54:54 -07:00
k8s-merge-robot f45bcc5ffb Merge pull request #24900 from ericchiang/rbac_types
Automatic merge from submit-queue

pkg/apis/rbac: Add Openshift authorization API types

This PR updates #23396 by adding the Openshift RBAC types to a new API group.

Changes from Openshift:

* Omission of [ResourceGroups](4589987883/pkg/authorization/api/types.go (L32-L104)) as most of these were Openshift specific. Would like to add the concept back in for a later release of the API.
* Omission of IsPersonalSubjectAccessReview as its implementation relied on Openshift capability.
* Omission of SubjectAccessReview and ResourceAccessReview types. These are defined in `authorization.k8s.io`

~~API group is named `rbac.authorization.openshift.com` as we omitted the AccessReview stuff and that seemed to be the lest controversial based on conversations in #23396. Would be happy to change it if there's a dislike for the name.~~ Edit: API groups is named `rbac`, sorry misread the original thread.

As discussed in #18762, creating a new API group is kind difficult right now and the documentation is very out of date. Got a little help from @soltysh but I'm sure I'm missing some things. Also still need to add validation and a RESTStorage registry interface. Hence "WIP".

Any initial comments welcome.

cc @erictune @deads2k @sym3tri @philips
2016-05-12 13:03:50 -07:00
k8s-merge-robot 0ef4c6407b Merge pull request #24902 from cjcullen/webhookAuthn
Automatic merge from submit-queue

Webhook Token Authenticator

Add a webhook token authenticator plugin to allow a remote service to make authentication decisions.
2016-05-11 22:08:58 -07:00
Clayton Coleman 4554889ae9
Conversions have kube-isms and are not portable for downstream
Some minor fixes to enable generators for OpenShift and others who need
to generate conversions on Kube API groups outside the core.
2016-05-11 14:04:03 -04:00
Eric Chiang 6a1f46895e pkg/apis: rbac types added 2016-05-11 12:01:06 +02:00
CJ Cullen eb3b0e78b4 Add a webhook token authenticator plugin. 2016-05-10 14:54:35 -07:00
Maciej Szulik 5ef870d4c7 Added JobTemplate, a preliminary step for ScheduledJob and Workflow 2016-05-10 21:48:39 +02:00
Matt Liggett c00fa39eee Define PodDisruption API types. 2016-05-06 17:24:53 -07:00
jianhuiz fcb241d05c add api group 'federation' and 'cluster' object 2016-04-26 02:05:51 -07:00
Prashanth Balasubramanian 0ac10c6cc2 PetSet type, apps apigroup 2016-04-20 18:49:31 -07:00
Chao Xu 2b0c849e83 remove dot in deepcopy package name 2016-04-19 14:01:41 -07:00
goltermann a3104ba96c Final vet fixes; enabling vet checks in verify scripts. 2016-04-13 13:51:51 -07:00
Wojciech Tyczynski f1248b9c82 Migrate to new conversion generator 2016-03-22 08:43:02 +01:00
Wojciech Tyczynski 04eb0d40bb Migrate everything to new deep-copy generator. 2016-03-17 15:22:18 +01:00
Wojciech Tyczynski 74d005f1cf Generate DeepCopies per directory. 2016-03-17 09:28:11 +01:00
Wojciech Tyczynski 919afadbe7 Refactor import tracker 2016-03-15 16:02:18 +01:00
Wojciech Tyczynski 0db2012039 Refactor assmebling proto files to avoid code duplication 2016-03-11 15:54:10 +01:00
Wojciech Tyczynski 205e6899be Generate public deep-copy functions 2016-02-03 13:33:24 +01:00
Wojciech Tyczynski f9f840a1c6 Remove debug log 2015-12-30 14:42:02 +01:00
Wojciech Tyczynski baf97c9c5e First use of new deep-copy generator. 2015-12-29 18:06:09 +01:00
Wojciech Tyczynski 68d2824a45 Generate deep copies with framework. 2015-11-12 10:38:25 +01:00