Skip to content

Commit

Permalink
fix (extensions/istio) : Remove clashing packages in istio-model-v1be…
Browse files Browse the repository at this point in the history
…ta1 (#5000)

+ Packages from v1alpha apiGroups were getting generated in both
  istio-model-v1alpha3 and istio-model-v1beta1 modules due to
  mappingSchema generating everything in go package path `istio.io/api`

+ Modify mappingSchema to specify full package path of required packages
  only. Also make istio-model-v1beta1 depend on istio-model-v1alpha3 for
  dependent packages instead of generating them on their own

Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia authored and manusa committed Apr 20, 2023
1 parent 575c9b4 commit 7d41264
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 785 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 @@
* Fix #4985: triggering the immediate cleanup of the okhttp idle task
* Fix #4988: Ensuring that previous requests are closed before retry
* Fix #4993: Quantity class should have @JsonIgnore on the additionalProperties parameter
* Fix #5000: Remove clashing `v1alpha` apigroup packages in `istio-model-v1beta1`
* fix #5002: Jetty response completion accounts for header processing
* Fix #5009: addressing issue with serialization of wrapped polymorphic types
* Fix #5020: updating the resourceVersion on a delete with finalizers
Expand Down
4 changes: 3 additions & 1 deletion extensions/istio/generator-v1alpha3/cmd/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ func main() {
// - replace <key> with <value> aka "package prefix"
// - replace '/' with '.' for a valid java package name
mappingSchema := map[string]string{
"istio.io/api": "io.fabric8.istio.api",
"github.com/gogo/protobuf/types": "io.fabric8.istio.api.internal.protobuf.types",
"istio.io/api/analysis/v1alpha1": "io.fabric8.istio.api.analysis.v1alpha1",
"istio.io/api/meta/v1alpha1": "io.fabric8.istio.api.meta.v1alpha1",
"istio.io/api/networking/v1alpha3": "io.fabric8.istio.api.networking.v1alpha3",
}

// overwriting some times
Expand Down
6 changes: 5 additions & 1 deletion extensions/istio/generator-v1beta1/cmd/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ func main() {
providedPackages := map[string]string{
"k8s.io/apimachinery/pkg/apis/meta/v1": "io.fabric8.kubernetes.api.model",
"k8s.io/api/core/v1": "io.fabric8.kubernetes.api.model",
"istio.io/api/analysis/v1alpha1": "io.fabric8.istio.api.analysis.v1alpha1",
"istio.io/api/meta/v1alpha1": "io.fabric8.istio.api.meta.v1alpha1",
}

// mapping of go packages of this module to the resulting java package
Expand All @@ -83,7 +85,9 @@ func main() {
// - replace <key> with <value> aka "package prefix"
// - replace '/' with '.' for a valid java package name
mappingSchema := map[string]string{
"istio.io/api": "io.fabric8.istio.api",
"istio.io/api/networking/v1beta1": "io.fabric8.istio.api.networking.v1beta1",
"istio.io/api/type/v1beta1": "io.fabric8.istio.api.type.v1beta1",
"istio.io/api/security/v1beta1": "io.fabric8.istio.api.security.v1beta1",
}

// overwriting some times
Expand Down
5 changes: 4 additions & 1 deletion extensions/istio/model-v1beta1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<properties>
<osgi.import>
io.fabric8.kubernetes.api.builder,
!io.fabric8.istio.*,
*
</osgi.import>
<osgi.export>
Expand All @@ -42,6 +41,10 @@
</properties>

<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>istio-model-v1alpha3</artifactId>
</dependency>
<dependency>
<groupId>io.sundr</groupId>
<artifactId>builder-annotations</artifactId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7d41264

Please sign in to comment.