Commit Graph

73 Commits (712efb7aec31fc8a4cbfcf7f5ec4ee2911fc95ac)

Author SHA1 Message Date
Chao Xu ab71a6ec60 fix conversion-gen 2017-06-07 16:23:25 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Kubernetes Submit Queue 7a1687dc93 Merge pull request #43081 from sttts/sttts-conversion-gen-dup-func-error
Automatic merge from submit-queue

conversion-gen: make duplicate func error message readable

Before you only got two hex pointer values.
2017-04-12 05:01:45 -07:00
Sahdev P. Zala 4af92ce967 Fix goling failure in conversion public function doc
The exported or public functions without a comment results into golint failure
in various generated files. The changes in this patch takes care of about 36
related lint failures.
Given below is an example lint error,
zz_generated.conversion.go:91:1: exported function
Convert_v1alpha1_Binding_To_servicecatalog_Binding should have comment or be
unexported
2017-04-11 15:04:57 -04:00
Jordan Liggitt 0e2f1b535d
Ensure empty serialized slices are zero-length, not null 2017-03-20 23:56:39 -04:00
Dr. Stefan Schimanski 26662b39a7 conversion-gen: make duplicate func error message readable 2017-03-14 17:35:41 +01:00
Dr. Stefan Schimanski 5486c6a56a conversion-gen: add vendor package support 2017-02-02 06:58:28 +01:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Kubernetes Submit Queue 7e1cacaa91 Merge pull request #38440 from justinsb/conversion_gen_safe_at_some_speeds
Automatic merge from submit-queue

conversion-gen: add --skip-unsafe flag

We should expose the SkipUnsafe option, for legacy compatability, so
that conversion-go can be used in other projects, and for platforms
where unsafe is not available.

Make unsafe code generation the default though, and have the help text
hint that the resulting code is sub-optimal.
2016-12-18 09:16:16 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Justin Santa Barbara dd351db799 conversion-gen: add --skip-unsafe flag
We should expose the SkipUnsafe option, for legacy compatability, so
that conversion-go can be used in other projects, and for platforms
where unsafe is not available.

Make unsafe code generation the default though, and have the help text
hint that the resulting code is sub-optimal.
2016-12-09 02:33:22 -05:00
Clayton Coleman 138267c876
Switch generator logic to use pkg/apis/meta/v1 2016-12-03 18:57:30 -05:00
Clayton Coleman 96f8a14e35
Explore alternative unsafe copy 2016-10-31 10:59:01 -04:00
Clayton Coleman 168f5e0dca
Default to safe conversions 2016-10-26 12:21:27 -04:00
Clayton Coleman d089eda524
Generate unsafe conversions
This reverts commit 50bcdb9677.
2016-10-26 12:21:27 -04:00
Wojciech Tyczynski 50bcdb9677 Revert "Generate unsafe conversions"
This reverts commit 2b1790cc5f.
2016-10-26 10:21:45 +02:00
Clayton Coleman 2b1790cc5f
Generate unsafe conversions 2016-10-25 19:28:41 -04:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Clayton Coleman f294175d60
Make defaulting optional during conversion generation
Set the Kubernetes default to "no defaulting"
2016-10-18 21:07:34 -04:00
Tim Hockin 38d7c4b271 Conversion: log opted-out fields 2016-09-26 20:07:54 -07:00
Tim Hockin 7efb2d4738 Always emit autoConvert funcs, but call for help
Previously we refused to emit 'autoConvert_*' functions if any field was not
convertible.  The way around this was to write manual Conversion functions, but
to do so safely you must handle every fields.  Huge opportunity for errors.

This PR cleans up the filtering such that it only operates on types that should
be converted (remove a lot of code) and tracks when fields are skipped.  In
that case, it emits an 'autoConvert' function but not a public 'Convert'
function.  If there is no manual function, the compile will fail.

This also means that manual conversion functions can call autoConvert functions
and then "patch up" what they need.
2016-09-26 20:07:54 -07:00
Tim Hockin 3023decd00 Renames for readability in conversion-gen 2016-09-26 20:07:54 -07:00
Tim Hockin 210a634bcc Remove useless conversion-gen pre-filter 2016-09-26 20:07:54 -07:00
Tim Hockin 87abf78bb7 Minor cleanups in conversion gen 2016-09-26 20:07:54 -07:00
Tim Hockin 17b64fc3d6 Better warning string in failed conversion gen 2016-09-26 20:07:54 -07:00
Daniel Smith 23fb528e0d fixdef 2016-09-22 13:42:46 -07:00
Daniel Smith 2709f07c71 rewrite import paths 2016-09-22 13:42:46 -07:00
Clayton Coleman 51da6bbc05 Make it easier to debug conversion mismatches 2016-09-01 22:35:31 -04:00
Daniel Smith bd7d7cc02a changes to generators 2016-08-11 17:06:54 -07:00
Daniel Smith d7e4028437 modify generators 2016-08-10 16:55:05 -07:00
Tim St. Clair f4ce5583c2
Adjust verbosity levels of go2idl logging 2016-08-04 22:01:35 -07:00
Clayton Coleman f5975afc06
genconversion=false should skip fields during conversion generation
Currently it only skips if the fields don't match, but that leaves no
way for callers to say "no really, ignore this field".
2016-07-13 22:20:40 -04:00
Tim Hockin 355794c303 Log errors or fail if conversion fail to generate
This fixes PodSpec to generate cleanly.  No other types only half-generate (so
now we Fatalf), though several fail to generate at all (only Errorf for now).
2016-07-07 22:09:08 -07:00
Tim Hockin f63f168b51 Comment and simplify a bit of conversion
There are ample opportunities to optimize and streamline here.  For example,
there's no reason to have a function to convert IntStr to IntStr. Removing the
function does generate the right assignment, but it is unclear whether the
registered function is needed or not.  I opted to leave it alone for now.
Another example is Convert_Slice_byte_To_Slice_byte, which just seems silly.
2016-07-07 22:09:08 -07:00
Tim Hockin 291b51ec50 Use file tags to generate conversions
This drives conversion generation from file tags like:
  // +conversion-gen=k8s.io/my/internal/version
.. rather than hardcoded lists of packages.

The only net change in generated code can be explained as correct.  Previously
it didn't know that conversion was available.
2016-07-07 22:09:08 -07:00
Tim Hockin 7fa1e87d66 Simplify convertible check - same type is OK
This is to clarify the code.  No actual effect at the moment, but I manually
verified this in the case of identical types.
2016-07-07 22:09:08 -07:00
Tim Hockin ed59210f04 Renames for clarity in conversion-gen
This is to clarify the intent of the code for new readers (me).
2016-07-07 22:09:08 -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 b01ac4726f go2idl: Consistently handle comments as []string
This makes subsequent comment-tag PRs more consistent.
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
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
Piotr Szczesniak 22dc21d703 Removed metrics api group 2016-05-31 09:48:39 +02:00