Skip to content

Commit

Permalink
Merge pull request openshift#3179 from stevekuznetsov/skuznets/typed-…
Browse files Browse the repository at this point in the history
…clients

HOSTEDCP-1256: generate typed clients for apis
  • Loading branch information
openshift-merge-bot[bot] authored Nov 14, 2023
2 parents 4a278b6 + a60076d commit 15ce0af
Show file tree
Hide file tree
Showing 1,035 changed files with 82,206 additions and 14,049 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pre-commit: all verify test
build: hypershift-operator control-plane-operator hypershift product-cli

.PHONY: update
update: deps api api-docs app-sre-saas-template
update: deps api api-docs app-sre-saas-template clients

.PHONY: verify
verify: update staticcheck fmt vet promtool
Expand Down Expand Up @@ -90,9 +90,9 @@ api: hypershift-api cluster-api cluster-api-provider-aws cluster-api-provider-ib

.PHONY: hypershift-api
hypershift-api: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..."
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/hypershift/..."
rm -rf cmd/install/assets/hypershift-operator/*.yaml
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./api/..." output:crd:artifacts:config=cmd/install/assets/hypershift-operator
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./api/hypershift/..." output:crd:artifacts:config=cmd/install/assets/hypershift-operator

.PHONY: cluster-api
cluster-api: $(CONTROLLER_GEN)
Expand Down Expand Up @@ -131,6 +131,10 @@ cluster-api-provider-azure: $(CONTROLLER_GEN)
api-docs: $(GENAPIDOCS)
hack/gen-api-docs.sh $(GENAPIDOCS) $(DIR)

.PHONY: clients
clients:
hack/update-codegen.sh


.PHONY: release
release:
Expand Down
2 changes: 1 addition & 1 deletion api/fixtures/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/pointer"

hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
"github.com/openshift/hypershift/api/util/ipnet"
hyperv1 "github.com/openshift/hypershift/api/v1beta1"

configv1 "github.com/openshift/api/config/v1"
crclient "sigs.k8s.io/controller-runtime/pkg/client"
Expand Down
2 changes: 1 addition & 1 deletion api/fixtures/example_aws.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fixtures

import (
hyperv1 "github.com/openshift/hypershift/api/v1beta1"
hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
)

type ExampleAWSOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion api/fixtures/example_ibmcloud_powervs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
corev1 "k8s.io/api/core/v1"
crclient "sigs.k8s.io/controller-runtime/pkg/client"

hyperv1 "github.com/openshift/hypershift/api/v1beta1"
hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
)

type ExamplePowerVSOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion api/fixtures/example_kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

hyperv1 "github.com/openshift/hypershift/api/v1beta1"
hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
corev1 "k8s.io/api/core/v1"
apiresource "k8s.io/apimachinery/pkg/api/resource"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "hypershift.openshift.io", Version: "v1alpha1"}

SchemeGroupVersion = GroupVersion

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

// Resource generated code relies on this being here, but it logically belongs to the group
// DEPRECATED
func Resource(resource string) schema.GroupResource {
return schema.GroupResource{Group: GroupVersion.Group, Resource: resource}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"sigs.k8s.io/controller-runtime/pkg/conversion"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/hypershift/api/hypershift/v1beta1"
"github.com/openshift/hypershift/api/util/configrefs"
"github.com/openshift/hypershift/api/util/ipnet"
"github.com/openshift/hypershift/api/v1beta1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/google/go-cmp/cmp"
fuzz "github.com/google/gofuzz"
configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/hypershift/api/hypershift/v1beta1"
"github.com/openshift/hypershift/api/util/configrefs"
"github.com/openshift/hypershift/api/util/ipnet"
"github.com/openshift/hypershift/api/v1beta1"
"github.com/openshift/hypershift/support/conversiontest"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "hypershift.openshift.io", Version: "v1beta1"}

SchemeGroupVersion = GroupVersion

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

// Resource generated code relies on this being here, but it logically belongs to the group
// DEPRECATED
func Resource(resource string) schema.GroupResource {
return schema.GroupResource{Group: GroupVersion.Group, Resource: resource}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ func init() {
}

// HostedControlPlane defines the desired state of HostedControlPlane
// +genclient
// +kubebuilder:resource:path=hostedcontrolplanes,shortName=hcp;hcps,scope=Namespaced,categories=cluster-api
// +kubebuilder:storageversion
// +kubebuilder:subresource:status
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions api/scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
routev1 "github.com/openshift/api/route/v1"
securityv1 "github.com/openshift/api/security/v1"
agentv1 "github.com/openshift/cluster-api-provider-agent/api/v1beta1"
hyperv1alpha1 "github.com/openshift/hypershift/api/v1alpha1"
hyperv1beta1 "github.com/openshift/hypershift/api/v1beta1"
hyperv1alpha1 "github.com/openshift/hypershift/api/hypershift/v1alpha1"
hyperv1beta1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
"github.com/openshift/hypershift/support/rhobsmonitoring"
prometheusoperatorv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand Down
2 changes: 1 addition & 1 deletion api/util/configrefs/refs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets"

configv1 "github.com/openshift/api/config/v1"
hyperv1 "github.com/openshift/hypershift/api/v1beta1"
hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
)

func TestKnownConfigMapRefs(t *testing.T) {
Expand Down
51 changes: 51 additions & 0 deletions client/applyconfiguration/hypershift/v1alpha1/aescbcspec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions client/applyconfiguration/hypershift/v1alpha1/agentplatformspec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions client/applyconfiguration/hypershift/v1alpha1/apiendpoint.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 15ce0af

Please sign in to comment.