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 9c61130
Show file tree
Hide file tree
Showing 22 changed files with 34 additions and 1,525 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Fix #5293: Ensured the mock server uses only generic or JsonNode parsing
* Fix #4225: [crd-generator] Principled generation of enum values instead of considering more properties
* Fix #5327: Ensured that the informer reconnect task terminates after client close
* Fix #5113: Clashing package names in trigger model dependencies

#### Improvements
* Fix #5166: Remove opinionated messages from Config's `errorMessages` and deprecate it
Expand Down
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 9c61130

Please sign in to comment.