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

Fix convert #13

Merged
merged 1 commit into from
Feb 10, 2017
Merged

Fix convert #13

merged 1 commit into from
Feb 10, 2017

Conversation

tnozicka
Copy link
Contributor

@tnozicka tnozicka commented Feb 9, 2017

This fixes object serialization and writing objects in convert. It was a FIXME and it didn't work until this PR.

This PR will help us move forward a lot because it allows us to actually output deployable objects.

For reviewers:

It took me several hours to find the 4 magic lines by digging in Kubernetes sources; definitely no docs :(

import (
    api_v1 "k8s.io/client-go/pkg/api/v1"
)

scheme := runtime.NewScheme()
api_v1.SchemeBuilder.AddToScheme(scheme)
versionedObject, err := scheme.ConvertToVersion(runtimeObject, api_v1.SchemeGroupVersion)

This can't really break anything as it didn't work before :D
But I have tested it manually and we should cover it once we have E2E tests.

@tnozicka tnozicka requested a review from kadel February 9, 2017 16:53
@kadel kadel merged commit c58a819 into redhat-developer:master Feb 10, 2017
@tnozicka tnozicka deleted the fix-convert branch February 10, 2017 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants