openshift / openshift/origin

Discovery info for processedtemplates & templates both have kind: Template

Open
#21,668 13 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lifecycle/frozen
Dominant language
Go
Stars
8.7k
Forks
4.8k
Avg merge
4d 10h
Merged PRs (30d)
53

Description

This might not be a bug, but creates complications for dynamic clients parsing discovery info:

Both oapi/v1 and apis/template.openshift.io/v1 have 2 different paths with same kind:

      "name": "templates",
      "namespaced": true,
      "kind": "Template",
      "verbs": ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"],
...
      "name": "processedtemplates",
      "namespaced": true,
      "kind": "Template",
      "verbs": ["create"],
  1. Given kind: Template input, how does oc know which of the endpoints to hit?

  2. Could anything be added to discovery to make this unambiguous?

  3. What is the difference between /templates and /processedtemplates anyway?
    Do clients need both or can I just hardcode preference to /templates?

  4. The docs are non-helpful — don't explain the difference — and weird:

    The docs are organized by kind, could it be they're buggy as result of this collision?

Version
oc v3.11.0+8de5c34
kubernetes v1.10.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://192.168.99.103:8443
kubernetes v1.11.0+d4cacc0
Steps To Reproduce
  1. curl $API/apis/template.openshift.io/v1/
  2. curl $API/oapi/v1/
Current Result

Duplicate entries with different name but same kind.

Expected Result

Ideally, exactly one name per kind (ignoring subresources like routes/status).
If kind ProcessedTemplate really exists, can that be reported for "name": "processedtemplates"?
If impossible, some hint in discovery info helping decide between the two?

Additional Information

FWIW, there was a similar collision up to openshift 3.6 between DeploymentConfig /generatedeploymentconfigs and DeploymentConfig /deploymentconfigs. generatedeploymentconfigs is gone in 3.7+ discovery info.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the two curl requests in the reproduction steps and compare the templates and processedtemplates entries in both discovery responses. Read the linked kubeclient discussion and the referenced OpenShift REST API documentation to establish the intended distinction. Done means the collision and ProcessedTemplate naming are resolved or clearly documented, with discovery and docs made consistent.

Written by the indexing model from the issue text.

Assessment

Domain
api, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.