Skip to content

Commit

Permalink
fix (extensions/tekton) : Remove knative duck classes from tekton tri…
Browse files Browse the repository at this point in the history
…ggers model (fabric8io#5113)

+ Both tekton-triggers-v1beta1 and tekton-triggers-v1alpha1 seem to be
  generating knative duck types that result in split package warning when
  both packages are used together. Use these packages from common
  knative-model dependency rather than generating it.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
  • Loading branch information
rohanKanojia committed Jul 20, 2023
1 parent 871863d commit 42d31ca
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 1,525 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func main() {
"k8s.io/api/core/v1": "io.fabric8.kubernetes.api.model",
"k8s.io/apimachinery/pkg/apis/meta/v1": "io.fabric8.kubernetes.api.model",
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1": "io.fabric8.tekton.pipeline.v1beta1",
"knative.dev/pkg/apis/duck/v1": "io.fabric8.knative.internal.pkg.apis.duck.v1",
"knative.dev/pkg/apis/duck/v1alpha1": "io.fabric8.knative.internal.pkg.apis.duck.v1alpha1",
"knative.dev/pkg/apis/duck/v1beta1": "io.fabric8.knative.internal.pkg.apis.duck.v1beta1",
"knative.dev/pkg/apis": "io.fabric8.knative.internal.pkg.apis",
}

// mapping of go packages of this module to the resulting java package
Expand All @@ -63,9 +67,7 @@ func main() {
// - replace <key> with <value> aka "package prefix"
// - replace '/' with '.' for a valid java package name
// e.g. github.com/tektoncd/pipeline/pkg/apis/pipeline/pod/Template is mapped to "io.fabric8.tekton.internal.pipeline.pkg.apis.pipeline.pod.Template"
mappingSchema := map[string]string{
"knative.dev": "io.fabric8.tekton.triggers.internal.knative",
}
mappingSchema := map[string]string{}

// overwriting some types
manualTypeMap := map[reflect.Type]string{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func main() {
"k8s.io/api/core/v1": "io.fabric8.kubernetes.api.model",
"k8s.io/apimachinery/pkg/apis/meta/v1": "io.fabric8.kubernetes.api.model",
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1": "io.fabric8.tekton.pipeline.v1beta1",
"knative.dev/pkg/apis/duck/v1": "io.fabric8.knative.internal.pkg.apis.duck.v1",
"knative.dev/pkg/apis/duck/v1alpha1": "io.fabric8.knative.internal.pkg.apis.duck.v1alpha1",
"knative.dev/pkg/apis/duck/v1beta1": "io.fabric8.knative.internal.pkg.apis.duck.v1beta1",
"knative.dev/pkg/apis": "io.fabric8.knative.internal.pkg.apis",
}

// mapping of go packages of this module to the resulting java package
Expand All @@ -61,9 +65,7 @@ func main() {
// - replace <key> with <value> aka "package prefix"
// - replace '/' with '.' for a valid java package name
// e.g. github.com/tektoncd/pipeline/pkg/apis/pipeline/pod/Template is mapped to "io.fabric8.tekton.internal.pipeline.pkg.apis.pipeline.pod.Template"
mappingSchema := map[string]string{
"knative.dev": "io.fabric8.tekton.triggers.internal.knative",
}
mappingSchema := map[string]string{}

// overwriting some types
manualTypeMap := map[reflect.Type]string{
Expand Down
3 changes: 2 additions & 1 deletion extensions/tekton/model-triggers-v1alpha1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
*
</osgi.import>
<osgi.export>
io.fabric8.tekton.*
io.fabric8.tekton.*,
io.fabric8.knative.internal.pkg.apis.*
</osgi.export>
</properties>

Expand Down

This file was deleted.

Loading

0 comments on commit 42d31ca

Please sign in to comment.