Skip to content

Commit

Permalink
refactor: openshift-model-tuned generated from OpenAPI schemas
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa authored Oct 3, 2024
1 parent 5d97871 commit caa39cc
Show file tree
Hide file tree
Showing 19 changed files with 573 additions and 590 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ openapi-generate-java-classes:
cd kubernetes-model-generator/openshift-model-machine && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-machineconfiguration && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-monitoring && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-tuned && mvn -Pgenerate clean install

# Legacy generation of the model: TODO: remove
.PHONY: generate-model-legacy
Expand Down
1 change: 0 additions & 1 deletion kubernetes-model-generator/generateModel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ABSOLUTE_BASEDIR=$(realpath "$BASEDIR")
declare -a modules=(
"openshift-model-hive"
"openshift-model-installer"
"openshift-model-tuned"
"openshift-model-whereabouts"
"openshift-model-storageversionmigrator"
"../extensions/knative/generator"
Expand Down
4 changes: 3 additions & 1 deletion kubernetes-model-generator/openapi/generator/cmd/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
openshiftconfigv1 "github.com/openshift/api/config/v1"
openshiftcloudcredentialoperatorv1 "github.com/openshift/cloud-credential-operator/pkg/apis/cloudcredential/v1"
openshiftclusternetworkoperatorv1 "github.com/openshift/cluster-network-operator/pkg/apis/network/v1"
openshiftclusternodetuningoperatorv1 "github.com/openshift/cluster-node-tuning-operator/pkg/apis/tuned/v1"
operatorframeworkv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorframeworkv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
olm "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1"
Expand Down Expand Up @@ -54,8 +55,9 @@ var openApiRun = func(cobraCmd *cobra.Command, args []string) {
//openshiftbaremetaloperatorv1alpha1.GroupVersion.String(),
operatorframeworkv1alpha1.SchemeGroupVersion.String(),
operatorframeworkv1.GroupVersion.String(),
openshiftclusternetworkoperatorv1.GroupVersion.String(),
openshiftcloudcredentialoperatorv1.GroupVersion.String(),
openshiftclusternetworkoperatorv1.GroupVersion.String(),
openshiftclusternodetuningoperatorv1.SchemeGroupVersion.String(),
olm.SchemeGroupVersion.String(),
prometheusoperatorv1.SchemeGroupVersion.String(),
})
Expand Down
11 changes: 10 additions & 1 deletion kubernetes-model-generator/openapi/generator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ require (
github.com/openshift/api v3.9.0+incompatible
github.com/openshift/cloud-credential-operator v0.0.0-20240910052617-d668c182b0e3
github.com/openshift/cluster-network-operator v0.0.0-20240912134426-a3188633549d
github.com/openshift/cluster-node-tuning-operator v0.0.0-20241001165112-1685a8fc1376
github.com/operator-framework/api v0.27.0
github.com/operator-framework/operator-lifecycle-manager v0.0.0-00010101000000-000000000000
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.77.1
github.com/spf13/cobra v1.8.1
k8s.io/api v0.31.1
k8s.io/apiextensions-apiserver v0.31.1
Expand All @@ -33,7 +35,14 @@ replace github.com/operator-framework/api => github.com/marcnuri-forks/operator-
// TODO: WIP while this gets merged or fixed https://github.com/operator-framework/operator-lifecycle-manager/pull/3406
replace github.com/operator-framework/operator-lifecycle-manager => github.com/marcnuri-forks/operator-lifecycle-manager v0.0.0-20241002090802-7539192fbf96

require github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.77.1
// Required by some openshift operator dependencies, update to latest Kuberentes Version
replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.31.1

replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.31.1

replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.31.1

replace k8s.io/mount-utils => k8s.io/mount-utils v0.31.1

require (
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
Expand Down
5 changes: 4 additions & 1 deletion kubernetes-model-generator/openapi/generator/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ github.com/containers/ocicrypt v1.2.0 h1:X14EgRK3xNFvJEfI5O4Qn4T3E25ANudSOZz/sir
github.com/containers/ocicrypt v1.2.0/go.mod h1:ZNviigQajtdlxIZGibvblVuIFBKIuUI2M0QM12SD31U=
github.com/containers/storage v1.55.0 h1:wTWZ3YpcQf1F+dSP4KxG9iqDfpQY1otaUXjPpffuhgg=
github.com/containers/storage v1.55.0/go.mod h1:28cB81IDk+y7ok60Of6u52RbCeBRucbFOeLunhER1RQ=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
Expand Down Expand Up @@ -98,6 +98,7 @@ github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=
Expand Down Expand Up @@ -200,6 +201,8 @@ github.com/openshift/cloud-credential-operator v0.0.0-20240910052617-d668c182b0e
github.com/openshift/cloud-credential-operator v0.0.0-20240910052617-d668c182b0e3/go.mod h1:4AWWBNPuWzPtT77xDONlObrazPlBCKXd+16lupnIrQc=
github.com/openshift/cluster-network-operator v0.0.0-20240912134426-a3188633549d h1:9Xf/80gDpRc33FwCEJ6L2/DF1yU/4L6QjoYxKexDzvo=
github.com/openshift/cluster-network-operator v0.0.0-20240912134426-a3188633549d/go.mod h1:qeN8u3CfzClFoykTdlvn0kKngBuVmb3VvWHA51UxiOI=
github.com/openshift/cluster-node-tuning-operator v0.0.0-20241001165112-1685a8fc1376 h1:XOj/kwz+iOCasKM2Y+cDSbb3bRaaIFcJxXb/qYZhKhU=
github.com/openshift/cluster-node-tuning-operator v0.0.0-20241001165112-1685a8fc1376/go.mod h1:rXqYaoIJhAbETKVgBxsz7bBstuhPgA3MPvWYMUFMOF8=
github.com/operator-framework/operator-registry v1.47.0 h1:Imr7X/W6FmXczwpIOXfnX8d6Snr1dzwWxkMG+lLAfhg=
github.com/operator-framework/operator-registry v1.47.0/go.mod h1:CJ3KcP8uRxtC8l9caM1RsV7r7jYlKAd452tcxcgXyTQ=
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ var PackagePatterns = []string{
"github.com/openshift/api/.../v...",
// CRDs don't provide info for reused types
//"github.com/metal3-io/baremetal-operator/apis/metal3.io/v...",
"github.com/openshift/cluster-network-operator/pkg/apis/.../v...",
"github.com/openshift/cloud-credential-operator/pkg/apis/.../v...",
"github.com/openshift/cluster-network-operator/pkg/apis/.../v...",
"github.com/openshift/cluster-node-tuning-operator/pkg/apis/tuned/v...",
"github.com/operator-framework/api/pkg/operators/v...",
"github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v...",
"github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v...",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
//openshiftbaremetaloperatorv1alpha1 "github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1"
openshiftcloudcredentialoperatorv1 "github.com/openshift/cloud-credential-operator/pkg/apis/cloudcredential/v1"
openshiftclusternetworkoperatorv1 "github.com/openshift/cluster-network-operator/pkg/apis/network/v1"
openshiftclusternodetuningoperatorv1 "github.com/openshift/cluster-node-tuning-operator/pkg/apis/tuned/v1"
operatorframeworkv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorframeworkv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
olm "github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/apis/operators/v1"
Expand All @@ -40,8 +41,9 @@ func main() {
operatorframeworkv1alpha1.SchemeGroupVersion.String(),
operatorframeworkv1.GroupVersion.String(),
//openshiftbaremetaloperatorv1alpha1.GroupVersion.String(),
openshiftclusternetworkoperatorv1.GroupVersion.String(),
openshiftcloudcredentialoperatorv1.GroupVersion.String(),
openshiftclusternetworkoperatorv1.GroupVersion.String(),
openshiftclusternodetuningoperatorv1.SchemeGroupVersion.String(),
olm.SchemeGroupVersion.String(),
prometheusoperatorv1.SchemeGroupVersion.String(),
})
Expand Down
Loading

0 comments on commit caa39cc

Please sign in to comment.