-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
UPSTREAM: 53464: use unstructured builder - oc export #16665
UPSTREAM: 53464: use unstructured builder - oc export #16665
Conversation
/retest |
1 similar comment
/retest |
0cc4eba
to
b276e58
Compare
@@ -392,6 +392,10 @@ func (u *Unstructured) GetCreationTimestamp() metav1.Time { | |||
|
|||
func (u *Unstructured) SetCreationTimestamp(timestamp metav1.Time) { | |||
ts, _ := timestamp.MarshalQueryParameter() | |||
if len(ts) == 0 { | |||
u.setNestedField(nil, "metadata", "creationTimestamp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liggitt this fixes the issue I had mentioned in our conversation earlier.
Exporting unstructured objects with an empty string as the value of their
creationTimestamp
field was causing an error [1] when trying to re-create
those objects with oc create
.
$ oc export bc/foo > foo.yaml
...
$ oc create -f foo.yaml
Error from server (BadRequest): BuildConfig in version "v1" cannot be handled as a BuildConfig: parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006"
Will open upstream PR if this looks okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ironcladlou you spent a lot of time in here. This look good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assigning a nil key to the internal map seems to be a perpetuation of the problem outlined in kubernetes/kubernetes#48211 (related to several bugs).
Potentially diverging from upstream by carrying a patch for this particular change seems riskier than usual given the history of nuanced serialization problems in this type. My suggestion would be to make an upstream commit a prerequisite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assigning a nil key to the internal map seems to be a perpetuation of the problem outlined in kubernetes/kubernetes#48211 (related to several bugs).
Potentially diverging from upstream by carrying a patch for this particular change seems riskier than usual given the history of nuanced serialization problems in this type. My suggestion would be to make an upstream commit a prerequisite.
@ironcladlou you'll be the likely reviewer upstream. Will it merge upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juanvallejo, can you extract this patch into an upstream PR and include a unit test demonstrating that it fixes a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ironcladlou
Upstream PR opened here: kubernetes/kubernetes#53464
693f481
to
47a724c
Compare
47a724c
to
e158a97
Compare
/retest |
2f24c0a
to
11d6a4c
Compare
/retest |
92ae9ea
to
26d5087
Compare
@@ -133,12 +142,44 @@ func RunExport(f *clientcmd.Factory, exporter Exporter, in io.Reader, out io.Wri | |||
newInfos := []*resource.Info{} | |||
errs := []error{} | |||
for _, info := range infos { | |||
converted := false | |||
|
|||
// convert unstructured object to runtime.Object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with the approach, but only if we deprecate oc export
and stop adding any new features to it.
@fabianofranz it's a pretty ugly hammer, but it behaves slightly better on unknown types.
/retest |
1 similar comment
/retest |
/retest |
26d5087
to
dd1c7af
Compare
/retest |
/test extended_conformance_gce |
@deads2k @fabianofranz friendly ping |
@juanvallejo you got a release note ready? /approve |
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, fabianofranz, juanvallejo The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@fabianofranz this solves a cli blocker, wondering if we can add the "kind bug" label here as well? |
/kind bug |
/test extended_conformance_install_update |
/test extended_conformance_gce |
@juanvallejo: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
Automatic merge from submit-queue. |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1496755
Use unstructured builder to obtain resources before exporting.
This allows us to support service-catalog resources.
Before
After
cc @openshift/cli-review