Skip to content

Commit

Permalink
fix (extensions/certmanager) : Update CertManager extension to latest…
Browse files Browse the repository at this point in the history
… version (fabric8io#4327)

+ Update CertManager extension generator-v1 module to latest version (`v1.9.0-beta.1.0.20220829113803-8465f1223efb`)
+ Update CertManager extension generator-v1alpha2, generator-v1alpha3,
  generator-v1beta1 to v1.6.0 version
+ Remove manual model classes with field name `class` (i.e. ACMEChallengeSolverHTTP01Ingress)
+ Force protobuf and yaml.v2 dependencies to not use vulnerable versions

Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia committed Aug 30, 2022
1 parent 8944160 commit 2f67687
Show file tree
Hide file tree
Showing 72 changed files with 9,003 additions and 2,168 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Bump Knative model to v0.34.0
* Bump Apache Camel-K to v1.9.2
* Update chaos-mesh extension to v2.1.3. Add PodHttpChaos, GCPChaos, BlockChaos and PhysicalMachineChaos.
* Bump Cert-Manager to `v1.9.0-beta.1.0.20220829113803-8465f1223efb`

#### New Features
* Fix #2271: Support periodic refresh of access tokens before they expire
Expand All @@ -37,6 +38,7 @@
- `io.fabric8.chaosmesh.v1alpha1.AwsChaos` => `io.fabric8.chaosmesh.v1alpha1.AWSChaos`
- `io.fabric8.chaosmesh.v1alpha1.IoChaos` => `io.fabric8.chaosmesh.v1alpha1.IOChaos`
- `io.fabric8.chaosmesh.v1alpha1.PodIoChaos` => `io.fabric8.chaosmesh.v1alpha1.PodIOChaos`

### 5.12.3 (2022-07-27)

#### Bugs
Expand Down
23 changes: 13 additions & 10 deletions extensions/certmanager/generator-v1/cmd/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package main

import (
"fmt"
certmanageracme "github.com/cert-manager/cert-manager/pkg/apis/acme/v1"
certmanager "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
"github.com/fabric8io/kubernetes-client/generator/pkg/schemagen"
certmanageracme "github.com/jetstack/cert-manager/pkg/apis/acme/v1"
certmanager "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"reflect"
)
Expand All @@ -47,18 +47,21 @@ func main() {
// go packages that are provided and where no generation is required and their corresponding java package
providedPackages := map[string]string{
// external
"k8s.io/api/core/v1": "io.fabric8.kubernetes.api.model",
"k8s.io/apimachinery/pkg/apis/meta/v1": "io.fabric8.kubernetes.api.model",
"k8s.io/apimachinery/pkg/api/resource": "io.fabric8.kubernetes.api.model",
"k8s.io/apimachinery/pkg/runtime": "io.fabric8.kubernetes.api.model.runtime",
"k8s.io/api/core/v1": "io.fabric8.kubernetes.api.model",
"k8s.io/apimachinery/pkg/apis/meta/v1": "io.fabric8.kubernetes.api.model",
"k8s.io/apimachinery/pkg/api/resource": "io.fabric8.kubernetes.api.model",
"k8s.io/apimachinery/pkg/runtime": "io.fabric8.kubernetes.api.model.runtime",
"sigs.k8s.io/gateway-api/apis/v1alpha2": "io.fabric8.kubernetes.api.model.gatewayapi.v1alpha2",
}

// mapping of go packages of this module to the resulting java package
// optional ApiGroup and ApiVersion for the go package (which is added to the generated java class)
packageMapping := map[string]schemagen.PackageInformation{
"github.com/jetstack/cert-manager/pkg/apis/certmanager/v1": {JavaPackage: "io.fabric8.certmanager.api.model.v1", ApiGroup: "cert-manager.io", ApiVersion: "v1"},
"github.com/jetstack/cert-manager/pkg/apis/acme/v1": {JavaPackage: "io.fabric8.certmanager.api.model.acme.v1", ApiGroup: "cert-manager.io", ApiVersion: "v1"},
"github.com/jetstack/cert-manager/pkg/apis/meta/v1": {JavaPackage: "io.fabric8.certmanager.api.model.meta.v1", ApiGroup: "cert-manager.io", ApiVersion: "v1"},
"github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1": {JavaPackage: "io.fabric8.certmanager.api.model.v1", ApiGroup: "cert-manager.io", ApiVersion: "v1"},
"github.com/cert-manager/cert-manager/pkg/apis/acme/v1": {JavaPackage: "io.fabric8.certmanager.api.model.acme.v1", ApiGroup: "cert-manager.io", ApiVersion: "v1"},
"github.com/cert-manager/cert-manager/pkg/apis/meta/v1": {JavaPackage: "io.fabric8.certmanager.api.model.meta.v1", ApiGroup: "cert-manager.io", ApiVersion: "v1"},
"github.com/cert-manager/cert-manager/internal/apis/acme": {JavaPackage: "io.fabric8.certmanager.api.model.acme.internal", ApiGroup: "cert-manager.io", ApiVersion: "v1"},
"github.com/cert-manager/cert-manager/internal/apis/meta": {JavaPackage: "io.fabric8.certmanager.api.model.meta.internal", ApiGroup: "cert-manager.io", ApiVersion: "v1"},
}

// converts all packages starting with <key> to a java package using an automated scheme:
Expand Down
12 changes: 8 additions & 4 deletions extensions/certmanager/generator-v1/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
module github.com/fabric8io/kubernetes-client/extensions/jetstack/generator

require (
github.com/cert-manager/cert-manager v1.9.0-beta.1.0.20220829113803-8465f1223efb
github.com/fabric8io/kubernetes-client/generator v0.0.0
github.com/jetstack/cert-manager v1.1.1
k8s.io/apiextensions-apiserver v0.19.0
k8s.io/apimachinery v0.19.0
k8s.io/apiextensions-apiserver v0.24.2
k8s.io/apimachinery v0.24.2
)

replace github.com/fabric8io/kubernetes-client/generator v0.0.0 => ./../../../generator
replace (
github.com/fabric8io/kubernetes-client/generator v0.0.0 => ./../../../generator
github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.4.0
)

go 1.15
Loading

0 comments on commit 2f67687

Please sign in to comment.