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

Pipeline v1beta1 transformed to v1 #6674

Closed
rh-hemartin opened this issue May 17, 2023 · 5 comments
Closed

Pipeline v1beta1 transformed to v1 #6674

rh-hemartin opened this issue May 17, 2023 · 5 comments
Labels
kind/question Issues or PRs that are questions around the project or a particular feature

Comments

@rh-hemartin
Copy link
Contributor

rh-hemartin commented May 17, 2023

Expected Behavior

A Pipeline in tekton.dev/v1beta1 version is created.

Actual Behavior

A Pipeline in tekton.dev/v1 version is created instead.

Steps to Reproduce the Problem

  1. minikube start --driver=kvm2 --cpus=4 --memory=6g --disk-size=30GB --kubernetes-version=1.26.1 --embed-certs
  2. kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.47.0/release.yaml
  3. kubectl apply -f pipeline.yaml
# pipeline.yaml
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  name: dummy-2
  namespace: default
spec:
  tasks:
  - name: init
    params:
    - name: resource
      value: resouce
    taskRef:
      apiVersion: tekton.dev/v1beta1
      kind: ClusterTask
      name: init
    workspaces:
    - name: output
      workspace: shared
  workspaces:
  - description: Main workspace that is shared across each task in the build pipeline
    name: shared
  1. kubectl get pipeline dummy -o yaml:
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"tekton.dev/v1beta1","kind":"Pipeline","metadata":{"annotations":{},"name":"dummy-2","namespace":"default"},"spec":{"tasks":[{"name":"init","params":[{"name":"resource","value":"resouce"}],"taskRef":{"apiVersion":"tekton.dev/v1beta1","kind":"ClusterTask","name":"init"},"workspaces":[{"name":"output","workspace":"shared"}]}],"workspaces":[{"description":"Main workspace that is shared across each task in the build pipeline","name":"shared"}]}}
  creationTimestamp: "2023-05-17T07:51:51Z"
  generation: 1
  name: dummy-2
  namespace: default
  resourceVersion: "1360"
  uid: 114df1e3-89bd-42b2-bea2-0624cf186d4d
spec:
  tasks:
  - name: init
    params:
    - name: resource
      value: resouce
    taskRef:
      apiVersion: tekton.dev/v1beta1
      kind: ClusterTask
      name: init
    workspaces:
    - name: output
      workspace: shared
  workspaces:
  - description: Main workspace that is shared across each task in the build pipeline
    name: shared

Additional Info

  • Kubernetes version: 1.26.1

    Output of kubectl version:

Client Version: v1.27.1
Kustomize Version: v5.0.1
Server Version: v1.26.1
  • Tekton Pipeline version:

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

v0.47.0

I'm trying to understand why it is transforming it into v1.

@rh-hemartin rh-hemartin added the kind/bug Categorizes issue or PR as related to a bug. label May 17, 2023
@dibyom dibyom added kind/question Issues or PRs that are questions around the project or a particular feature and removed kind/bug Categorizes issue or PR as related to a bug. labels May 17, 2023
@dibyom
Copy link
Member

dibyom commented May 17, 2023

@rh-hectormartinezdev this is a bit confusing but we are actually still storing resources in v1beta1 not v1 in etcd. What is happening is kubectl is choosing the latest stable version "v1" by default. See here for more details.

You can request the v1beta1 representation by kubectl get pipelines.v1beta1.tekton.dev ....

Kubernetes does require that one apiversion should be convertible to another apiversion without any loss of information - we have conversion webhooks setup which allow us to do so.

@ggallen
Copy link

ggallen commented May 17, 2023

@dibyom, the real problem with this is that we are seeing the following behavior now.

Previously, when we created a PipelineRun we would get TaskRuns created as needed. However, when we upgraded to 0.44.2, we now see CustomRuns being created. So it seems like we have two choices:

  1. Switch to using CustomRuns.
  2. Figure out how to force the creation of TaskRuns rather than CustomRuns.

@rh-hectormartinezdev did some digging an I believe he determined that if the API version was tekton.dev/v1, then a CustomRun would be created, and that tekton.dev/v1beta1 would result in a TaskRun. At least that what I think he found somewhere.

So we're looking for some sort of explanation about what changed and is causing this issue, and whether we can or should pursue either #1 or #2 above. And we'll need some instructions on what to do in either case.

@ggallen
Copy link

ggallen commented May 17, 2023

And incidentally, I can't get a TaskRun to be created at all in 0.44.2, even if I specify the API version as tekton.dev/v1beta.

@ggallen
Copy link

ggallen commented May 17, 2023

Note that the CustomRun (instead of a TaskRun) is coming from the ClusterTask that the Pipeline references.

@rh-hemartin
Copy link
Contributor Author

Thanks @dibyom, I opened #6682 to address the underlying issue we are experienced that @ggallen mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Issues or PRs that are questions around the project or a particular feature
Projects
None yet
Development

No branches or pull requests

3 participants