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

make bootstrap template compatible with 1.5 clusters #16207

Conversation

juanvallejo
Copy link
Contributor

Related BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1486775

$ oc adm create-bootstrap-project-template generates a template with group versioned resources that are incompatible when used against a 1.5 / 3.5 cluster.

cc @openshift/cli-review @mfojtik @enj

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 7, 2017
@@ -40,13 +39,13 @@ func DefaultTemplate() *templateapi.Template {
oapi.OpenShiftDisplayName: "${" + ProjectDisplayNameParam + "}",
projectapi.ProjectRequester: "${" + ProjectRequesterParam + "}",
}
if err := templateapi.AddObjectsToTemplate(ret, []runtime.Object{project}, projectapiv1.SchemeGroupVersion); err != nil {
if err := templateapi.AddObjectsToTemplate(ret, []runtime.Object{project}, latest.Version); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is used for a server to loopback to itself. I don't think I care about making compatible two releases back.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, this is against 3.6.

Can you do this in the CLI hook instead of here?

Copy link
Contributor

Choose a reason for hiding this comment

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

This should just be projectapiv1.LegacySchemeGroupVersion for 3.6 and earlier. I have no idea what you mean by CLI hook.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should just be projectapiv1.LegacySchemeGroupVersion for 3.6 and earlier. I have no idea what you mean by CLI hook.

The CLI has a command dumping this where they want to serialize to old objects. Where this is used by the apiserver, we don't care.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k I am attempting to convert template objects after making a call to delegated.DefaultTemplate() here, however I am unable to use kapi.Scheme.ConvertToVersion as it requires pointers as input. Template objects are originally pointers, but are then wrapped in a runtime.encodable when they are added to a template.

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k I am attempting to convert template objects after making a call to delegated.DefaultTemplate() here, however I am unable to use kapi.Scheme.ConvertToVersion as it requires pointers as input. Template objects are originally pointers, but are then wrapped in a runtime.encodable when they are added to a template.

Ok. As long as it stays in 3.6 and doesn't move to 3.7, this is ok. In 3.7 we're using RBAC resources

@juanvallejo juanvallejo force-pushed the jvallejo/make-bootstrap-template-compatible-1.5-cluster branch from 3195bc7 to 78c46a4 Compare September 8, 2017 20:13
@juanvallejo
Copy link
Contributor Author

@deads2k

Ok. As long as it stays in 3.6 and doesn't move to 3.7, this is ok. In 3.7 we're using RBAC resources

Thanks, updated the default template to use LegacySchemeGroupVersions

@enj
Copy link
Contributor

enj commented Sep 8, 2017

/lgtm

@juanvallejo you need to backport this to OSE.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 8, 2017
@juanvallejo
Copy link
Contributor Author

@enj

You need to backport this to OSE.

Thanks, will do

@deads2k
Copy link
Contributor

deads2k commented Sep 11, 2017

/approve

but only in previous releases.

@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, enj, 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 /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 11, 2017
@juanvallejo
Copy link
Contributor Author

/test unit

@juanvallejo
Copy link
Contributor Author

/test extended_conformance_install_update

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue

@openshift-merge-robot openshift-merge-robot merged commit d427b61 into openshift:release-3.6 Sep 11, 2017
@juanvallejo juanvallejo deleted the jvallejo/make-bootstrap-template-compatible-1.5-cluster branch September 12, 2017 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants