Skip to content

Commit

Permalink
Upgrade Tekton Model to v0.47.0
Browse files Browse the repository at this point in the history
- Upgrade Tekton Pipelines to v0.47.0
- Upgrade Tekton Triggers to v0.23.0
- Add the new `v1` Tekton Pipelines API Group
- Merge generator code into single package per module (to avoid
  duplicating boilerplate + version drifts between API groups)
  and remove obsolete Golang setup (e.g. vendoring)
- Rename `ArrayOrString` to `ParamValue` (has been renamed upstream)
- Fix various tests, delete obsolete ones
  • Loading branch information
dziemba committed May 10, 2023
1 parent 1f73a1a commit f50ce0e
Show file tree
Hide file tree
Showing 177 changed files with 16,110 additions and 9,793 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#### Improvements
* Fix #5100: lessened the level of the non-conflicting httpclient implementation warning
* Fix #5112: Expose put method with InputStream argument in HttpRequest class
* Fix #4989: Upgrade Tekton Model to v0.47.0

#### Dependency Upgrade

Expand Down
4 changes: 4 additions & 0 deletions extensions/tekton/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
<groupId>io.sundr</groupId>
<artifactId>transform-annotations</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>tekton-model-v1</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>tekton-model-v1alpha1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.fabric8.kubernetes.client.dsl.FunctionCallable;
import io.fabric8.kubernetes.client.extension.ExtensionRootClientAdapter;
import io.fabric8.kubernetes.client.extension.SupportTestingClient;
import io.fabric8.tekton.client.dsl.V1APIGroupDSL;
import io.fabric8.tekton.client.dsl.V1alpha1APIGroupDSL;
import io.fabric8.tekton.client.dsl.V1beta1APIGroupDSL;

Expand Down Expand Up @@ -50,6 +51,11 @@ public FunctionCallable<NamespacedTektonClient> withRequestConfig(RequestConfig
return new WithRequestCallable<>(this, requestConfig);
}

@Override
public V1APIGroupDSL v1() {
return adapt(V1APIGroupClient.class);
}

@Override
public V1beta1APIGroupDSL v1beta1() {
return adapt(V1beta1APIGroupClient.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@
package io.fabric8.tekton.client;

import io.fabric8.kubernetes.client.Client;
import io.fabric8.tekton.client.dsl.V1APIGroupDSL;
import io.fabric8.tekton.client.dsl.V1alpha1APIGroupDSL;
import io.fabric8.tekton.client.dsl.V1beta1APIGroupDSL;

/**
* Main interface for Tekton client library.
*/
public interface TektonClient extends Client {
/**
* API entrypoint for tekton.dev/v1 API group resources
*
* @return {@link V1APIGroupDSL} for Tekton resource operations in this API group.
*/
V1APIGroupDSL v1();

/**
* API entrypoint for tekton.dev/v1beta1 API group resources
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import io.fabric8.kubernetes.client.Client;
import io.fabric8.kubernetes.client.extension.ExtensionAdapter;
import io.fabric8.tekton.client.dsl.V1APIGroupDSL;
import io.fabric8.tekton.client.dsl.V1alpha1APIGroupDSL;
import io.fabric8.tekton.client.dsl.V1beta1APIGroupDSL;

Expand All @@ -34,6 +35,7 @@ public TektonClient adapt(Client client) {

@Override
public void registerClients(ClientFactory factory) {
factory.register(V1APIGroupDSL.class, new V1APIGroupClient());
factory.register(V1beta1APIGroupDSL.class, new V1beta1APIGroupClient());
factory.register(V1alpha1APIGroupDSL.class, new V1alpha1APIGroupClient());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* Copyright (C) 2015 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.fabric8.tekton.client;

import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.kubernetes.client.extension.ClientAdapter;
import io.fabric8.tekton.client.dsl.V1APIGroupDSL;
import io.fabric8.tekton.pipeline.v1.Pipeline;
import io.fabric8.tekton.pipeline.v1.PipelineList;
import io.fabric8.tekton.pipeline.v1.PipelineRun;
import io.fabric8.tekton.pipeline.v1.PipelineRunList;
import io.fabric8.tekton.pipeline.v1.Task;
import io.fabric8.tekton.pipeline.v1.TaskList;
import io.fabric8.tekton.pipeline.v1.TaskRun;
import io.fabric8.tekton.pipeline.v1.TaskRunList;

public class V1APIGroupClient extends ClientAdapter<V1APIGroupClient> implements V1APIGroupDSL {

@Override
public V1APIGroupClient newInstance() {
return new V1APIGroupClient();
}

@Override
public MixedOperation<Pipeline, PipelineList, Resource<Pipeline>> pipelines() {
return resources(Pipeline.class, PipelineList.class);
}

@Override
public MixedOperation<PipelineRun, PipelineRunList, Resource<PipelineRun>> pipelineRuns() {
return resources(PipelineRun.class, PipelineRunList.class);
}

@Override
public MixedOperation<Task, TaskList, Resource<Task>> tasks() {
return resources(Task.class, TaskList.class);
}

@Override
public MixedOperation<TaskRun, TaskRunList, Resource<TaskRun>> taskRuns() {
return resources(TaskRun.class, TaskRunList.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,16 @@
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.kubernetes.client.extension.ClientAdapter;
import io.fabric8.tekton.client.dsl.V1alpha1APIGroupDSL;
import io.fabric8.tekton.pipeline.v1alpha1.ClusterTask;
import io.fabric8.tekton.pipeline.v1alpha1.ClusterTaskList;
import io.fabric8.tekton.pipeline.v1alpha1.Condition;
import io.fabric8.tekton.pipeline.v1alpha1.ConditionList;
import io.fabric8.tekton.pipeline.v1alpha1.Pipeline;
import io.fabric8.tekton.pipeline.v1alpha1.PipelineList;
import io.fabric8.tekton.pipeline.v1alpha1.PipelineRun;
import io.fabric8.tekton.pipeline.v1alpha1.PipelineRunList;
import io.fabric8.tekton.pipeline.v1alpha1.Task;
import io.fabric8.tekton.pipeline.v1alpha1.TaskList;
import io.fabric8.tekton.pipeline.v1alpha1.TaskRun;
import io.fabric8.tekton.pipeline.v1alpha1.TaskRunList;
import io.fabric8.tekton.resource.v1alpha1.PipelineResource;
import io.fabric8.tekton.resource.v1alpha1.PipelineResourceList;
import io.fabric8.tekton.resolution.v1alpha1.ResolutionRequest;
import io.fabric8.tekton.resolution.v1alpha1.ResolutionRequestList;
import io.fabric8.tekton.triggers.v1alpha1.ClusterInterceptor;
import io.fabric8.tekton.triggers.v1alpha1.ClusterInterceptorList;
import io.fabric8.tekton.triggers.v1alpha1.ClusterTriggerBinding;
import io.fabric8.tekton.triggers.v1alpha1.ClusterTriggerBindingList;
import io.fabric8.tekton.triggers.v1alpha1.EventListener;
import io.fabric8.tekton.triggers.v1alpha1.EventListenerList;
import io.fabric8.tekton.triggers.v1alpha1.Interceptor;
import io.fabric8.tekton.triggers.v1alpha1.InterceptorList;
import io.fabric8.tekton.triggers.v1alpha1.Trigger;
import io.fabric8.tekton.triggers.v1alpha1.TriggerBinding;
import io.fabric8.tekton.triggers.v1alpha1.TriggerBindingList;
Expand All @@ -54,36 +44,6 @@ public V1alpha1APIGroupClient newInstance() {
return new V1alpha1APIGroupClient();
}

@Override
public MixedOperation<Pipeline, PipelineList, Resource<Pipeline>> pipelines() {
return resources(Pipeline.class, PipelineList.class);
}

@Override
public MixedOperation<PipelineRun, PipelineRunList, Resource<PipelineRun>> pipelineRuns() {
return resources(PipelineRun.class, PipelineRunList.class);
}

@Override
public MixedOperation<PipelineResource, PipelineResourceList, Resource<PipelineResource>> pipelineResources() {
return resources(PipelineResource.class, PipelineResourceList.class);
}

@Override
public MixedOperation<Task, TaskList, Resource<Task>> tasks() {
return resources(Task.class, TaskList.class);
}

@Override
public MixedOperation<TaskRun, TaskRunList, Resource<TaskRun>> taskRuns() {
return resources(TaskRun.class, TaskRunList.class);
}

@Override
public MixedOperation<Condition, ConditionList, Resource<Condition>> conditions() {
return resources(Condition.class, ConditionList.class);
}

@Override
public MixedOperation<TriggerTemplate, TriggerTemplateList, Resource<TriggerTemplate>> triggerTemplates() {
return resources(TriggerTemplate.class, TriggerTemplateList.class);
Expand All @@ -104,11 +64,6 @@ public MixedOperation<EventListener, EventListenerList, Resource<EventListener>>
return resources(EventListener.class, EventListenerList.class);
}

@Override
public NonNamespaceOperation<ClusterTask, ClusterTaskList, Resource<ClusterTask>> clusterTasks() {
return resources(ClusterTask.class, ClusterTaskList.class);
}

@Override
public NonNamespaceOperation<ClusterTriggerBinding, ClusterTriggerBindingList, Resource<ClusterTriggerBinding>> clusterTriggerBindings() {
return resources(ClusterTriggerBinding.class, ClusterTriggerBindingList.class);
Expand All @@ -118,4 +73,14 @@ public NonNamespaceOperation<ClusterTriggerBinding, ClusterTriggerBindingList, R
public NonNamespaceOperation<ClusterInterceptor, ClusterInterceptorList, Resource<ClusterInterceptor>> clusterInterceptors() {
return resources(ClusterInterceptor.class, ClusterInterceptorList.class);
}

@Override
public MixedOperation<Interceptor, InterceptorList, Resource<Interceptor>> interceptors() {
return resources(Interceptor.class, InterceptorList.class);
}

@Override
public MixedOperation<ResolutionRequest, ResolutionRequestList, Resource<ResolutionRequest>> resolutionRequests() {
return resources(ResolutionRequest.class, ResolutionRequestList.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import io.fabric8.tekton.client.dsl.V1beta1APIGroupDSL;
import io.fabric8.tekton.pipeline.v1beta1.ClusterTask;
import io.fabric8.tekton.pipeline.v1beta1.ClusterTaskList;
import io.fabric8.tekton.pipeline.v1beta1.CustomRun;
import io.fabric8.tekton.pipeline.v1beta1.CustomRunList;
import io.fabric8.tekton.pipeline.v1beta1.Pipeline;
import io.fabric8.tekton.pipeline.v1beta1.PipelineList;
import io.fabric8.tekton.pipeline.v1beta1.PipelineRun;
Expand All @@ -30,6 +32,8 @@
import io.fabric8.tekton.pipeline.v1beta1.TaskList;
import io.fabric8.tekton.pipeline.v1beta1.TaskRun;
import io.fabric8.tekton.pipeline.v1beta1.TaskRunList;
import io.fabric8.tekton.resolution.v1beta1.ResolutionRequest;
import io.fabric8.tekton.resolution.v1beta1.ResolutionRequestList;
import io.fabric8.tekton.triggers.v1beta1.ClusterTriggerBinding;
import io.fabric8.tekton.triggers.v1beta1.ClusterTriggerBindingList;
import io.fabric8.tekton.triggers.v1beta1.EventListener;
Expand Down Expand Up @@ -68,6 +72,11 @@ public MixedOperation<TaskRun, TaskRunList, Resource<TaskRun>> taskRuns() {
return resources(TaskRun.class, TaskRunList.class);
}

@Override
public MixedOperation<CustomRun, CustomRunList, Resource<CustomRun>> customRuns() {
return resources(CustomRun.class, CustomRunList.class);
}

@Override
public NonNamespaceOperation<ClusterTask, ClusterTaskList, Resource<ClusterTask>> clusterTasks() {
return resources(ClusterTask.class, ClusterTaskList.class);
Expand Down Expand Up @@ -97,4 +106,9 @@ public MixedOperation<EventListener, EventListenerList, Resource<EventListener>>
public NonNamespaceOperation<ClusterTriggerBinding, ClusterTriggerBindingList, Resource<ClusterTriggerBinding>> clusterTriggerBindings() {
return resources(ClusterTriggerBinding.class, ClusterTriggerBindingList.class);
}

@Override
public MixedOperation<ResolutionRequest, ResolutionRequestList, Resource<ResolutionRequest>> resolutionRequests() {
return resources(ResolutionRequest.class, ResolutionRequestList.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Copyright (C) 2015 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.fabric8.tekton.client.dsl;

import io.fabric8.kubernetes.client.Client;
import io.fabric8.kubernetes.client.dsl.MixedOperation;
import io.fabric8.kubernetes.client.dsl.Resource;
import io.fabric8.tekton.pipeline.v1.Pipeline;
import io.fabric8.tekton.pipeline.v1.PipelineList;
import io.fabric8.tekton.pipeline.v1.PipelineRun;
import io.fabric8.tekton.pipeline.v1.PipelineRunList;
import io.fabric8.tekton.pipeline.v1.Task;
import io.fabric8.tekton.pipeline.v1.TaskList;
import io.fabric8.tekton.pipeline.v1.TaskRun;
import io.fabric8.tekton.pipeline.v1.TaskRunList;

public interface V1APIGroupDSL extends Client {
/**
* API entrypoint for Pipeline(tekton.dev/v1)
*
* @return MixedOperation for Pipeline class
*/
MixedOperation<Pipeline, PipelineList, Resource<Pipeline>> pipelines();

/**
* API entrypoint for PipelineRun(tekton.dev/v1)
*
* @return MixedOperation for PipelineRun class
*/
MixedOperation<PipelineRun, PipelineRunList, Resource<PipelineRun>> pipelineRuns();

/**
* API entrypoint for Task(tekton.dev/v1)
*
* @return MixedOperation for Task class
*/
MixedOperation<Task, TaskList, Resource<Task>> tasks();

/**
* API entrypoint for TaskRun(tekton.dev/v1)
*
* @return MixedOperation for TaskRun class
*/
MixedOperation<TaskRun, TaskRunList, Resource<TaskRun>> taskRuns();
}
Loading

0 comments on commit f50ce0e

Please sign in to comment.