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

new-app: appropriately warn/error on circular builds #12104

Merged
merged 1 commit into from
Dec 4, 2016

Conversation

gabemontero
Copy link
Contributor

Bug 1393549
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1393549
Detailed explanation
Citing of cirular builds were performed for new-build but not new-app;
With new-app, if template, simply warn, if not template fail command

@csrwng PTAL

@@ -0,0 +1,21 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer YAML

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I've heard that. Seemed to me that as long as json is supported, we should have a mixture in our various tests (so I intentionally included a bit of both in this change).

How strong is the preference?

Copy link
Contributor

Choose a reason for hiding this comment

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

The word I've heard from on high is to just use YAML everywhere. If we want examples of JSON, we can have them in actual examples (under examples/...) but for stuff devs are working with the decision was YAML.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok i'll convert

if len(c.To) == 0 {
// Output reference was generated, return error.
return nil, fmt.Errorf("%v, set a different tag with --to", err)
}
// Output reference was explicitly provided, print warning.
fmt.Fprintf(c.ErrOut, "--> WARNING: %v\n", err)
} else {
return nil, err
// circular reference handling for `oc new-app`
if len(templateObjects) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

@gabemontero it is possible for us to be generating new objects as well as processing template objects. We should check for circular references on the 2 sets of objects separately if we want different behaviors for each.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting ... so only allow the circular refs if they were induced by the template objects specifically. OK, I'll work on a refactor.

@gabemontero
Copy link
Contributor Author

updates pushed ... ptal

Copy link
Contributor

@csrwng csrwng left a comment

Choose a reason for hiding this comment

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

Just some minor tweaks to the test files, otherwise, looks good.

- apiVersion: v1
kind: ImageStream
metadata:
creationTimestamp: 2016-12-02T18:55:30Z
Copy link
Contributor

Choose a reason for hiding this comment

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

you should likely get rid of these fields (creationTimestamp, generation, resourceVersion, selfLink, uid)

selfLink: /oapi/v1/namespaces/myproject/imagestreams/newapp-circular-template
uid: e5ad1d91-b8c0-11e6-9803-68f7287398a7
spec: {}
status:
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the status part

apiVersion: v1
kind: Template
metadata:
creationTimestamp: null
Copy link
Contributor

Choose a reason for hiding this comment

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

get rid of creationTimestamp in this file

Bug 1393549
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1393549
Detailed explanation
Citing of cirular builds were performed for new-build but not new-app;
With new-app, if template, simply warn, if not template fail command
@gabemontero
Copy link
Contributor Author

yaml trimmed

@csrwng
Copy link
Contributor

csrwng commented Dec 2, 2016

LGTM [merge]

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 4c93305

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11957/) (Base Commit: ec171a1)

@gabemontero
Copy link
Contributor Author

flake #12112

@csrwng please repost the merge comment at your convenience, and we'll try again

@csrwng
Copy link
Contributor

csrwng commented Dec 4, 2016

#12112
[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 4c93305

@openshift-bot
Copy link
Contributor

openshift-bot commented Dec 4, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11988/) (Base Commit: 38e6fba) (Image: devenv-rhel7_5482)

@openshift-bot openshift-bot merged commit 0158f35 into openshift:master Dec 4, 2016
@gabemontero gabemontero deleted the newappCircle branch December 5, 2016 01:03
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.

4 participants