From 00ffad00e3e6bd8f9d757e37c292b3a87c420293 Mon Sep 17 00:00:00 2001 From: Shyam Radhakrishnan Date: Tue, 22 Aug 2023 08:23:16 +0530 Subject: [PATCH 1/3] Add support for dns label --- api/v1beta1/types.go | 10 ++++++++++ api/v1beta1/zz_generated.conversion.go | 4 ++++ api/v1beta1/zz_generated.deepcopy.go | 10 ++++++++++ api/v1beta2/types.go | 10 ++++++++++ api/v1beta2/zz_generated.deepcopy.go | 10 ++++++++++ cloud/scope/subnet_reconciler.go | 1 + cloud/scope/subnet_reconciler_test.go | 2 ++ cloud/scope/vcn_reconciler.go | 1 + cloud/scope/vcn_reconciler_test.go | 18 +++++++++++------- 9 files changed, 59 insertions(+), 7 deletions(-) diff --git a/api/v1beta1/types.go b/api/v1beta1/types.go index 7d6d609f..ef0eea58 100644 --- a/api/v1beta1/types.go +++ b/api/v1beta1/types.go @@ -856,6 +856,11 @@ type Subnet struct { // The security list associated with Subnet. // +optional SecurityList *SecurityList `json:"securityList,omitempty"` + + // DnsLabel DNS label for the subnet, used in conjunction with the VNIC's hostname and + // VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC + // within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + DnsLabel *string `json:"dnsLabel,omitempty"` } // NSG defines configuration for a Network Security Group. @@ -920,6 +925,11 @@ type VCN struct { // +listType=map // +listMapKey=name NetworkSecurityGroups []*NSG `json:"networkSecurityGroups,omitempty"` + + // DnsLabel specifies a DNS label for the VCN, used in conjunction with the VNIC's hostname and + // subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC + // within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + DnsLabel *string `json:"dnsLabel,omitempty"` } // LoadBalancer Configuration diff --git a/api/v1beta1/zz_generated.conversion.go b/api/v1beta1/zz_generated.conversion.go index 2956d670..3426c929 100644 --- a/api/v1beta1/zz_generated.conversion.go +++ b/api/v1beta1/zz_generated.conversion.go @@ -3096,6 +3096,7 @@ func autoConvert_v1beta1_Subnet_To_v1beta2_Subnet(in *Subnet, out *v1beta2.Subne out.CIDR = in.CIDR out.Type = v1beta2.SubnetType(in.Type) out.SecurityList = (*v1beta2.SecurityList)(unsafe.Pointer(in.SecurityList)) + out.DnsLabel = (*string)(unsafe.Pointer(in.DnsLabel)) return nil } @@ -3111,6 +3112,7 @@ func autoConvert_v1beta2_Subnet_To_v1beta1_Subnet(in *v1beta2.Subnet, out *Subne out.CIDR = in.CIDR out.Type = SubnetType(in.Type) out.SecurityList = (*SecurityList)(unsafe.Pointer(in.SecurityList)) + out.DnsLabel = (*string)(unsafe.Pointer(in.DnsLabel)) return nil } @@ -3194,6 +3196,7 @@ func autoConvert_v1beta1_VCN_To_v1beta2_VCN(in *VCN, out *v1beta2.VCN, s convers // WARNING: in.PublicRouteTableId requires manual conversion: does not exist in peer-type out.Subnets = *(*[]*v1beta2.Subnet)(unsafe.Pointer(&in.Subnets)) // WARNING: in.NetworkSecurityGroups requires manual conversion: does not exist in peer-type + out.DnsLabel = (*string)(unsafe.Pointer(in.DnsLabel)) return nil } @@ -3207,6 +3210,7 @@ func autoConvert_v1beta2_VCN_To_v1beta1_VCN(in *v1beta2.VCN, out *VCN, s convers // WARNING: in.ServiceGateway requires manual conversion: does not exist in peer-type // WARNING: in.RouteTable requires manual conversion: does not exist in peer-type // WARNING: in.NetworkSecurityGroup requires manual conversion: does not exist in peer-type + out.DnsLabel = (*string)(unsafe.Pointer(in.DnsLabel)) return nil } diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index ab034f8f..682c700c 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -2295,6 +2295,11 @@ func (in *Subnet) DeepCopyInto(out *Subnet) { *out = new(SecurityList) (*in).DeepCopyInto(*out) } + if in.DnsLabel != nil { + in, out := &in.DnsLabel, &out.DnsLabel + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet. @@ -2432,6 +2437,11 @@ func (in *VCN) DeepCopyInto(out *VCN) { } } } + if in.DnsLabel != nil { + in, out := &in.DnsLabel, &out.DnsLabel + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VCN. diff --git a/api/v1beta2/types.go b/api/v1beta2/types.go index a282d033..6e0f5298 100644 --- a/api/v1beta2/types.go +++ b/api/v1beta2/types.go @@ -855,6 +855,11 @@ type Subnet struct { // The security list associated with Subnet. // +optional SecurityList *SecurityList `json:"securityList,omitempty"` + + // DnsLabel DNS label for the subnet, used in conjunction with the VNIC's hostname and + // VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC + // within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + DnsLabel *string `json:"dnsLabel,omitempty"` } // NSG defines configuration for a Network Security Group. @@ -913,6 +918,11 @@ type VCN struct { // Configuration for NSG management. // +optional NetworkSecurityGroup NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + + // DnsLabel specifies a DNS label for the VCN, used in conjunction with the VNIC's hostname and + // subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC + // within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + DnsLabel *string `json:"dnsLabel,omitempty"` } // LoadBalancerType is an enumeration of the supported load balancer types. diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 7b6b6ffa..200ec0e8 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -2592,6 +2592,11 @@ func (in *Subnet) DeepCopyInto(out *Subnet) { *out = new(SecurityList) (*in).DeepCopyInto(*out) } + if in.DnsLabel != nil { + in, out := &in.DnsLabel, &out.DnsLabel + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet. @@ -2698,6 +2703,11 @@ func (in *VCN) DeepCopyInto(out *VCN) { in.ServiceGateway.DeepCopyInto(&out.ServiceGateway) in.RouteTable.DeepCopyInto(&out.RouteTable) in.NetworkSecurityGroup.DeepCopyInto(&out.NetworkSecurityGroup) + if in.DnsLabel != nil { + in, out := &in.DnsLabel, &out.DnsLabel + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VCN. diff --git a/cloud/scope/subnet_reconciler.go b/cloud/scope/subnet_reconciler.go index 83a8cbbc..343fbb8b 100644 --- a/cloud/scope/subnet_reconciler.go +++ b/cloud/scope/subnet_reconciler.go @@ -111,6 +111,7 @@ func (s *ClusterScope) CreateSubnet(ctx context.Context, spec infrastructurev1be RouteTableId: routeTable, FreeformTags: s.GetFreeFormTags(), DefinedTags: s.GetDefinedTags(), + DnsLabel: spec.DnsLabel, } if spec.SecurityList != nil { createSubnetDetails.SecurityListIds = []string{*spec.SecurityList.ID} diff --git a/cloud/scope/subnet_reconciler_test.go b/cloud/scope/subnet_reconciler_test.go index 155e9e64..a4823a1e 100644 --- a/cloud/scope/subnet_reconciler_test.go +++ b/cloud/scope/subnet_reconciler_test.go @@ -133,6 +133,7 @@ func TestClusterScope_ReconcileSubnet(t *testing.T) { EgressRules: customEgress, IngressRules: customIngress, }, + DnsLabel: common.String("label"), }, { Role: infrastructurev1beta2.ServiceLoadBalancerRole, @@ -235,6 +236,7 @@ func TestClusterScope_ReconcileSubnet(t *testing.T) { ProhibitPublicIpOnVnic: common.Bool(true), RouteTableId: common.String("private"), SecurityListIds: []string{"sec_list_id"}, + DnsLabel: common.String("label"), }, })).Return( core.CreateSubnetResponse{ diff --git a/cloud/scope/vcn_reconciler.go b/cloud/scope/vcn_reconciler.go index 20f1e66f..e6a5577b 100644 --- a/cloud/scope/vcn_reconciler.go +++ b/cloud/scope/vcn_reconciler.go @@ -133,6 +133,7 @@ func (s *ClusterScope) CreateVCN(ctx context.Context, spec infrastructurev1beta2 CidrBlocks: []string{spec.CIDR}, FreeformTags: s.GetFreeFormTags(), DefinedTags: s.GetDefinedTags(), + DnsLabel: spec.DnsLabel, } vcnResponse, err := s.VCNClient.CreateVcn(ctx, core.CreateVcnRequest{ CreateVcnDetails: vcnDetails, diff --git a/cloud/scope/vcn_reconciler_test.go b/cloud/scope/vcn_reconciler_test.go index 8013e9e2..d44cefd7 100644 --- a/cloud/scope/vcn_reconciler_test.go +++ b/cloud/scope/vcn_reconciler_test.go @@ -40,7 +40,7 @@ func TestClusterScope_CreateVCN(t *testing.T) { vcnClient := mock_vcn.NewMockClient(mockCtrl) vcnClient.EXPECT().CreateVcn(gomock.Any(), Eq(func(request interface{}) error { - return createVcnDisplayNameMatcher(request, "normal") + return vcnMatcher(request, "normal", common.String("label")) })). Return(core.CreateVcnResponse{ Vcn: core.Vcn{ @@ -48,7 +48,7 @@ func TestClusterScope_CreateVCN(t *testing.T) { }, }, nil) vcnClient.EXPECT().CreateVcn(gomock.Any(), Eq(func(request interface{}) error { - return createVcnDisplayNameMatcher(request, "error") + return vcnMatcher(request, "error", nil) })). Return(core.CreateVcnResponse{}, errors.New("some error")) @@ -63,7 +63,8 @@ func TestClusterScope_CreateVCN(t *testing.T) { spec: infrastructurev1beta2.OCIClusterSpec{ NetworkSpec: infrastructurev1beta2.NetworkSpec{ Vcn: infrastructurev1beta2.VCN{ - Name: "normal", + Name: "normal", + DnsLabel: common.String("label"), }, }, }, @@ -602,7 +603,7 @@ func TestClusterScope_ReconcileVCN(t *testing.T) { }}, nil) vcnClient.EXPECT().CreateVcn(gomock.Any(), Eq(func(request interface{}) error { - return createVcnDisplayNameMatcher(request, "not_found") + return vcnMatcher(request, "not_found", nil) })). Return(core.CreateVcnResponse{ Vcn: core.Vcn{ @@ -705,13 +706,16 @@ func TestClusterScope_ReconcileVCN(t *testing.T) { } } -func createVcnDisplayNameMatcher(request interface{}, matchStr string) error { +func vcnMatcher(request interface{}, displayName string, dnsLabel *string) error { r, ok := request.(core.CreateVcnRequest) if !ok { return errors.New("expecting CreateVcnRequest type") } - if *r.CreateVcnDetails.DisplayName != matchStr { - return errors.New(fmt.Sprintf("expecting DisplayName as %s", matchStr)) + if *r.CreateVcnDetails.DisplayName != displayName { + return errors.New(fmt.Sprintf("expecting DisplayName as %s", displayName)) + } + if !reflect.DeepEqual(r.CreateVcnDetails.DnsLabel, dnsLabel) { + return errors.New(fmt.Sprintf("expecting DnsLabel as %v", dnsLabel)) } return nil } From a641189f13090495746f026d157d8d1acc9a8cbb Mon Sep 17 00:00:00 2001 From: Shyam Radhakrishnan Date: Tue, 22 Aug 2023 18:54:51 +0530 Subject: [PATCH 2/3] Add support for dns label --- ...cluster.x-k8s.io_ociclusteridentities.yaml | 3 +- ...tructure.cluster.x-k8s.io_ociclusters.yaml | 27 ++++++++++++++-- ....cluster.x-k8s.io_ociclustertemplates.yaml | 31 +++++++++++++++++-- ...uster.x-k8s.io_ocimachinepoolmachines.yaml | 3 +- ...ture.cluster.x-k8s.io_ocimachinepools.yaml | 3 +- ...tructure.cluster.x-k8s.io_ocimachines.yaml | 3 +- ....cluster.x-k8s.io_ocimachinetemplates.yaml | 3 +- ...e.cluster.x-k8s.io_ocimanagedclusters.yaml | 27 ++++++++++++++-- ...r.x-k8s.io_ocimanagedclustertemplates.yaml | 31 +++++++++++++++++-- ...ster.x-k8s.io_ocimanagedcontrolplanes.yaml | 3 +- ...8s.io_ocimanagedcontrolplanetemplates.yaml | 3 +- ...uster.x-k8s.io_ocimanagedmachinepools.yaml | 3 +- ...k8s.io_ocimanagedmachinepooltemplates.yaml | 3 +- ...uster.x-k8s.io_ocivirtualmachinepools.yaml | 3 +- config/webhook/manifests.yaml | 2 -- 15 files changed, 118 insertions(+), 30 deletions(-) diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusteridentities.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusteridentities.yaml index ab18d0bf..0941704c 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusteridentities.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusteridentities.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ociclusteridentities.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml index 52402018..657dde91 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ociclusters.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io @@ -130,6 +129,12 @@ spec: cidr: description: VCN CIDR. type: string + dnsLabel: + description: DnsLabel specifies a DNS label for the VCN, used + in conjunction with the VNIC's hostname and subnet's DNS + label to form a fully qualified domain name (FQDN) for each + VNIC within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: VCN OCID. type: string @@ -535,6 +540,12 @@ spec: cidr: description: Subnet CIDR. type: string + dnsLabel: + description: DnsLabel DNS label for the subnet, used + in conjunction with the VNIC's hostname and VCN's + DNS label to form a fully qualified domain name (FQDN) + for each VNIC within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: Subnet OCID. type: string @@ -1279,6 +1290,12 @@ spec: cidr: description: VCN CIDR. type: string + dnsLabel: + description: DnsLabel specifies a DNS label for the VCN, used + in conjunction with the VNIC's hostname and subnet's DNS + label to form a fully qualified domain name (FQDN) for each + VNIC within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: VCN OCID. type: string @@ -1737,6 +1754,12 @@ spec: cidr: description: Subnet CIDR. type: string + dnsLabel: + description: DnsLabel DNS label for the subnet, used + in conjunction with the VNIC's hostname and VCN's + DNS label to form a fully qualified domain name (FQDN) + for each VNIC within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: Subnet OCID. type: string diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclustertemplates.yaml index 88f24adb..01a086cc 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ociclustertemplates.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ociclustertemplates.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io @@ -143,6 +142,13 @@ spec: cidr: description: VCN CIDR. type: string + dnsLabel: + description: DnsLabel specifies a DNS label for the + VCN, used in conjunction with the VNIC's hostname + and subnet's DNS label to form a fully qualified + domain name (FQDN) for each VNIC within this subnet + (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: VCN OCID. type: string @@ -602,6 +608,13 @@ spec: cidr: description: Subnet CIDR. type: string + dnsLabel: + description: DnsLabel DNS label for the subnet, + used in conjunction with the VNIC's hostname + and VCN's DNS label to form a fully qualified + domain name (FQDN) for each VNIC within this + subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: Subnet OCID. type: string @@ -1336,6 +1349,13 @@ spec: cidr: description: VCN CIDR. type: string + dnsLabel: + description: DnsLabel specifies a DNS label for the + VCN, used in conjunction with the VNIC's hostname + and subnet's DNS label to form a fully qualified + domain name (FQDN) for each VNIC within this subnet + (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: VCN OCID. type: string @@ -1852,6 +1872,13 @@ spec: cidr: description: Subnet CIDR. type: string + dnsLabel: + description: DnsLabel DNS label for the subnet, + used in conjunction with the VNIC's hostname + and VCN's DNS label to form a fully qualified + domain name (FQDN) for each VNIC within this + subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: Subnet OCID. type: string diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepoolmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepoolmachines.yaml index 5df3d87d..4131abd3 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepoolmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepoolmachines.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimachinepoolmachines.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepools.yaml index a2c49c73..d9f539b2 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinepools.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimachinepools.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml index a34096cf..7a426b01 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachines.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimachines.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml index 1aed9e43..4fd3a9da 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimachinetemplates.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimachinetemplates.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclusters.yaml index bb6dcead..462bc038 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclusters.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimanagedclusters.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io @@ -133,6 +132,12 @@ spec: cidr: description: VCN CIDR. type: string + dnsLabel: + description: DnsLabel specifies a DNS label for the VCN, used + in conjunction with the VNIC's hostname and subnet's DNS + label to form a fully qualified domain name (FQDN) for each + VNIC within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: VCN OCID. type: string @@ -538,6 +543,12 @@ spec: cidr: description: Subnet CIDR. type: string + dnsLabel: + description: DnsLabel DNS label for the subnet, used + in conjunction with the VNIC's hostname and VCN's + DNS label to form a fully qualified domain name (FQDN) + for each VNIC within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: Subnet OCID. type: string @@ -1285,6 +1296,12 @@ spec: cidr: description: VCN CIDR. type: string + dnsLabel: + description: DnsLabel specifies a DNS label for the VCN, used + in conjunction with the VNIC's hostname and subnet's DNS + label to form a fully qualified domain name (FQDN) for each + VNIC within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: VCN OCID. type: string @@ -1743,6 +1760,12 @@ spec: cidr: description: Subnet CIDR. type: string + dnsLabel: + description: DnsLabel DNS label for the subnet, used + in conjunction with the VNIC's hostname and VCN's + DNS label to form a fully qualified domain name (FQDN) + for each VNIC within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: Subnet OCID. type: string diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml index a8f3ad43..986436bd 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedclustertemplates.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimanagedclustertemplates.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io @@ -148,6 +147,13 @@ spec: cidr: description: VCN CIDR. type: string + dnsLabel: + description: DnsLabel specifies a DNS label for the + VCN, used in conjunction with the VNIC's hostname + and subnet's DNS label to form a fully qualified + domain name (FQDN) for each VNIC within this subnet + (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: VCN OCID. type: string @@ -607,6 +613,13 @@ spec: cidr: description: Subnet CIDR. type: string + dnsLabel: + description: DnsLabel DNS label for the subnet, + used in conjunction with the VNIC's hostname + and VCN's DNS label to form a fully qualified + domain name (FQDN) for each VNIC within this + subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: Subnet OCID. type: string @@ -1346,6 +1359,13 @@ spec: cidr: description: VCN CIDR. type: string + dnsLabel: + description: DnsLabel specifies a DNS label for the + VCN, used in conjunction with the VNIC's hostname + and subnet's DNS label to form a fully qualified + domain name (FQDN) for each VNIC within this subnet + (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: VCN OCID. type: string @@ -1862,6 +1882,13 @@ spec: cidr: description: Subnet CIDR. type: string + dnsLabel: + description: DnsLabel DNS label for the subnet, + used in conjunction with the VNIC's hostname + and VCN's DNS label to form a fully qualified + domain name (FQDN) for each VNIC within this + subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + type: string id: description: Subnet OCID. type: string diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml index ce2b8109..369727e1 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanes.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimanagedcontrolplanes.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml index 13c5cb29..456a6aeb 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedcontrolplanetemplates.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimanagedcontrolplanetemplates.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepools.yaml index 6b3808e5..3d0960b8 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepools.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimanagedmachinepools.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml index 13e8a7af..214732b3 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocimanagedmachinepooltemplates.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocimanagedmachinepooltemplates.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocivirtualmachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocivirtualmachinepools.yaml index fa0ecfbe..41f01a4f 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ocivirtualmachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ocivirtualmachinepools.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.10.0 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ocivirtualmachinepools.infrastructure.cluster.x-k8s.io spec: group: infrastructure.cluster.x-k8s.io diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 842e827e..e7b323f2 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -2,7 +2,6 @@ apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: - creationTimestamp: null name: mutating-webhook-configuration webhooks: - admissionReviewVersions: @@ -114,7 +113,6 @@ webhooks: apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: - creationTimestamp: null name: validating-webhook-configuration webhooks: - admissionReviewVersions: From 923ab949779f020fb9932f9845c40d027d995fc0 Mon Sep 17 00:00:00 2001 From: Shyam Radhakrishnan Date: Wed, 23 Aug 2023 08:46:58 +0530 Subject: [PATCH 3/3] Add support for dns label --- api/v1beta1/types.go | 2 ++ api/v1beta2/types.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/api/v1beta1/types.go b/api/v1beta1/types.go index ef0eea58..1f3cdf4f 100644 --- a/api/v1beta1/types.go +++ b/api/v1beta1/types.go @@ -860,6 +860,7 @@ type Subnet struct { // DnsLabel DNS label for the subnet, used in conjunction with the VNIC's hostname and // VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC // within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + // +optional DnsLabel *string `json:"dnsLabel,omitempty"` } @@ -929,6 +930,7 @@ type VCN struct { // DnsLabel specifies a DNS label for the VCN, used in conjunction with the VNIC's hostname and // subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC // within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + // +optional DnsLabel *string `json:"dnsLabel,omitempty"` } diff --git a/api/v1beta2/types.go b/api/v1beta2/types.go index 6e0f5298..c2092344 100644 --- a/api/v1beta2/types.go +++ b/api/v1beta2/types.go @@ -859,6 +859,7 @@ type Subnet struct { // DnsLabel DNS label for the subnet, used in conjunction with the VNIC's hostname and // VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC // within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + // +optional DnsLabel *string `json:"dnsLabel,omitempty"` } @@ -922,6 +923,7 @@ type VCN struct { // DnsLabel specifies a DNS label for the VCN, used in conjunction with the VNIC's hostname and // subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC // within this subnet (for example, `bminstance1.subnet123.vcn1.oraclevcn.com`). + // +optional DnsLabel *string `json:"dnsLabel,omitempty"` }