Skip to content

Commit

Permalink
Merge pull request #16207 from juanvallejo/jvallejo/make-bootstrap-te…
Browse files Browse the repository at this point in the history
…mplate-compatible-1.5-cluster

Automatic merge from submit-queue

make bootstrap template compatible with 1.5 clusters

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
  • Loading branch information
openshift-merge-robot authored Sep 11, 2017
2 parents 4aaca6a + 78c46a4 commit d427b61
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,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}, projectapiv1.LegacySchemeGroupVersion); err != nil {
panic(err)
}

serviceAccountRoleBindings := bootstrappolicy.GetBootstrapServiceAccountProjectRoleBindings(ns)
for i := range serviceAccountRoleBindings {
if err := templateapi.AddObjectsToTemplate(ret, []runtime.Object{&serviceAccountRoleBindings[i]}, authorizationapiv1.SchemeGroupVersion); err != nil {
if err := templateapi.AddObjectsToTemplate(ret, []runtime.Object{&serviceAccountRoleBindings[i]}, authorizationapiv1.LegacySchemeGroupVersion); err != nil {
panic(err)
}
}
Expand All @@ -56,7 +56,7 @@ func DefaultTemplate() *templateapi.Template {
binding.Namespace = ns
binding.Subjects = []kapi.ObjectReference{{Kind: authorizationapi.UserKind, Name: "${" + ProjectAdminUserParam + "}"}}
binding.RoleRef.Name = bootstrappolicy.AdminRoleName
if err := templateapi.AddObjectsToTemplate(ret, []runtime.Object{binding}, authorizationapiv1.SchemeGroupVersion); err != nil {
if err := templateapi.AddObjectsToTemplate(ret, []runtime.Object{binding}, authorizationapiv1.LegacySchemeGroupVersion); err != nil {
// this should never happen because we're tightly controlling what goes in.
panic(err)
}
Expand Down

0 comments on commit d427b61

Please sign in to comment.