tektoncd/experimental

Requesting update of python SDK

Closed this issue · 6 comments

The python SDK seems outdated.
I performed the following steps:

  1. Installed tekton pipeline through pip (EDIT: I installed it through pipenv, which used pip)
  2. Checked cat $HOME/.local/share/virtualenvs/tekton-N7PaS6py/lib/python3.8/site-packages/tekton_pipeline/api/tekton_client.py

The get code:

 def get(self, name, plural, namespace=None):
        """
        Get the Tekton objects
        :param name: existing Tekton objects
        :param plural: the custom object's plural name.
        :param namespace: defaults to current or default namespace
        :return: Tekton objects
        """
        if namespace is None:
            namespace = utils.get_default_target_namespace()
        try:
            outputs = self.api_instance.create_namespaced_custom_object(
                constants.TEKTON_GROUP,
                constants.TEKTON_VERSION,
                namespace,
                plural,
                tekton)
        except client.rest.ApiException as e:
            raise RuntimeError(
                "Exception when calling CustomObjectsApi->create_namespaced_custom_object:\
                 %s\n" % e)

        return outputs

However, the current version in master has the following code for the same function:

def get(self, entity, name, namespace=None, watch=False, timeout_seconds=600):
        """
        Get the Tekton objects
        :param entity: the tekton entity, currently supported values: ['task', 'taskrun', 'pipeline', 'pipelinerun'].
        :param name: existing Tekton objects
        :param namespace: defaults to current or default namespace
        :return: Tekton objects
        """

        utils.check_entity(entity)

        if namespace is None:
            namespace = utils.get_default_target_namespace()

        plural = str(entity).lower() + "s"

        if watch:
            tekton_watch(
                name=name,
                plural=plural,
                namespace=namespace,
                timeout_seconds=timeout_seconds)
        else:
            try:
                return self.api_instance.get_namespaced_custom_object(
                    constants.TEKTON_GROUP,
                    constants.TEKTON_VERSION,
                    namespace,
                    plural,
                    name)
            except client.rest.ApiException as e:
                raise RuntimeError(
                    "Exception when calling CustomObjectsApi->get_namespaced_custom_object:\
                    %s\n" % e)

In my use case, I was unable to get or create a task using tekton_pipeline installed through pip. I believe this is the problem.

I was able to CRUD objects when I built the library from source.

Any help would be appreciated. Thank you.

Same problem when installing from pip.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

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.

Can we re-open this issue? It's really hard to use this when the documentation and the code don't match up. (pip has 0.2.0 and is significantly different from master (or 0.7.0) )