Skip to content

Commit

Permalink
reorg of existing controllers to new gov4 format
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakm-ntnx committed Nov 27, 2023
1 parent 6a31d08 commit 74e5aad
Show file tree
Hide file tree
Showing 44 changed files with 1,026 additions and 1,024 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ generate: controller-gen conversion-gen ## Generate code containing DeepCopy, De
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

$(CONVERSION_GEN) \
--input-dirs=./api/v1alpha4 \
--input-dirs=./api/v1beta1 \
--input-dirs=./api/infrastructure/v1alpha4 \
--input-dirs=./api/infrastructure/v1beta1 \
--build-tag=ignore_autogenerated_core \
--output-file-base=zz_generated.conversion \
Expand Down
12 changes: 6 additions & 6 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixCluster
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1alpha4
version: v1alpha4
- api:
crdVersion: v1
Expand All @@ -25,7 +25,7 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixCluster
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1
version: v1beta1
- api:
crdVersion: v1
Expand All @@ -34,7 +34,7 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixMachine
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1alpha4
version: v1alpha4
- api:
crdVersion: v1
Expand All @@ -43,23 +43,23 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixMachine
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1
version: v1beta1
- api:
crdVersion: v1
namespaced: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixMachineTemplate
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1alpha4
version: v1alpha4
- api:
crdVersion: v1
namespaced: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixMachineTemplate
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1
version: v1beta1
- api:
crdVersion: v1
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion api/v1alpha4/doc.go → api/infrastructure/v1alpha4/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ limitations under the License.
// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group
// +kubebuilder:object:generate=true
// +groupName=infrastructure.cluster.x-k8s.io
// +k8s:conversion-gen=github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1
// +k8s:conversion-gen=github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1
package v1alpha4
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha4

import (
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1"
apiconversion "k8s.io/apimachinery/pkg/conversion"
capiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha4

import (
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1"
apiconversion "k8s.io/apimachinery/pkg/conversion"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha4

import (
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1"
apiconversion "k8s.io/apimachinery/pkg/conversion"
capiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
Expand Down

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

File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 9 additions & 1 deletion api/infrastructure/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ import (
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

const (
// Version is the API version.
Version = "v1beta1"

// GroupName is the name of the API group.
GroupName = "infrastructure.cluster.x-k8s.io"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"}
GroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 11 additions & 3 deletions api/infrastructure/v1beta1/nutanixclustertemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
type NutanixClusterTemplateSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

Template NutanixClusterTemplateResource `json:"template"`
}

// NutanixClusterTemplateStatus defines the observed state of NutanixClusterTemplate
Expand All @@ -44,8 +44,7 @@ type NutanixClusterTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec NutanixClusterTemplateSpec `json:"spec,omitempty"`
Status NutanixClusterTemplateStatus `json:"status,omitempty"`
Spec NutanixClusterTemplateSpec `json:"spec,omitempty"`
}

//+kubebuilder:object:root=true
Expand All @@ -60,3 +59,12 @@ type NutanixClusterTemplateList struct {
func init() {
SchemeBuilder.Register(&NutanixClusterTemplate{}, &NutanixClusterTemplateList{})
}

// NutanixClusterTemplateResource describes the data needed to create a NutanixCluster from a template.
type NutanixClusterTemplateResource struct {
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
// +optional
ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty"`
Spec NutanixClusterSpec `json:"spec"`
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 74e5aad

Please sign in to comment.