Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Burn YAML with fire (kind of) #5533

Merged
merged 4 commits into from
Mar 23, 2015

Conversation

smarterclayton
Copy link
Contributor

Remove automatic decoding of YAML via core Codec and replace with opt-in decoding.

Partially addresses #1004

Needs an e2e run in case there's a missed spot.

@googlebot
Copy link

Thanks for your pull request.

It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/.

If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits.

Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name.

@j3ffml j3ffml self-assigned this Mar 17, 2015
}

// yamlCodec implements Codec
var _ Codec = yamlCodec{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prove that yamlCodec implements Codec. We started doing that in other places where there's a type that should implement a named interface.

----- Original Message -----

// CodecFor returns a Codec that invokes Encode with the provided version.
func CodecFor(scheme *Scheme, version string) Codec {
return &codecWrapper{scheme, version}
}

+// yamlCodec converts YAML passed to the Decoder methods to JSON.
+type yamlCodec struct {

  • // a Codec for JSON
  • Codec
    +}

+// yamlCodec implements Codec
+var _ Codec = yamlCodec{}

What's the point of this line?


Reply to this email directly or view it on GitHub:
https://github.com/GoogleCloudPlatform/kubernetes/pull/5533/files#r26594752

@j3ffml
Copy link
Contributor

j3ffml commented Mar 17, 2015

lgtm, pending e2e run (in progress).

@bgrant0607
Copy link
Member

Great, thanks.

FYI/FWIW, Kubelet already explicitly calls yaml.Unmarshal:
https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/kubelet/config/file.go#L161

@bgrant0607
Copy link
Member

AFAICT, we're still not setting Content-Type in the client, and we're not documenting the accepted Content-Type in apiserver:
https://github.com/GoogleCloudPlatform/kubernetes/blob/32694a770ceb43786ab0a5284ad366643381c2af/pkg/apiserver/api_installer.go#L81

@nikhiljindal

Remove last usage of ResourceFromFile
Enables clients to optionally handle YAML
Base codecs no longer automically handle YAML.  Instead, clients
must convert to JSON first via yaml.ToJSON and runtime.YAMLDecoder.
@smarterclayton
Copy link
Contributor Author

rebased

@bgrant0607
Copy link
Member

Did we get results of the e2e run?

@smarterclayton smarterclayton added area/apiserver area/kubectl kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Mar 23, 2015
@smarterclayton
Copy link
Contributor Author

Doing an e2e run now

@j3ffml
Copy link
Contributor

j3ffml commented Mar 23, 2015

e2e passing this morning (locally). This lgtm to merge.

@j3ffml j3ffml added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 23, 2015
@smarterclayton
Copy link
Contributor Author

Merge away - don't wait for my tests (saves me a few hours)

smarterclayton added a commit that referenced this pull request Mar 23, 2015
@smarterclayton smarterclayton merged commit d19aac8 into kubernetes:master Mar 23, 2015
@thockin
Copy link
Member

thockin commented Mar 23, 2015

This seems to have broken tests for pkg/kubelet/config

@smarterclayton
Copy link
Contributor Author

Fixing that

@smarterclayton
Copy link
Contributor Author

Crossed merges

@thockin
Copy link
Member

thockin commented Mar 23, 2015

Also seems to have broken integration

On Mon, Mar 23, 2015 at 11:40 AM, Clayton Coleman notifications@github.com
wrote:

Crossed merges


Reply to this email directly or view it on GitHub
#5533 (comment)
.

@smarterclayton
Copy link
Contributor Author

Integration is fixed in #5775

----- Original Message -----

Also seems to have broken integration

On Mon, Mar 23, 2015 at 11:40 AM, Clayton Coleman notifications@github.com
wrote:

Crossed merges


Reply to this email directly or view it on GitHub
#5533 (comment)
.


Reply to this email directly or view it on GitHub:
#5533 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver area/kubectl kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants