Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increment API version to support new reconciliation API and move rel… #232

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c2de2ce
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 23, 2023
80dbf78
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 23, 2023
ecc8ba8
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 23, 2023
0ee3bd3
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 23, 2023
85667fd
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 23, 2023
433cd3c
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 24, 2023
fa3a2e2
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 24, 2023
98dece2
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 24, 2023
638efc4
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 24, 2023
73bf366
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 25, 2023
2886984
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 25, 2023
aa67802
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 25, 2023
5a36adf
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 26, 2023
4377be5
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 26, 2023
21ae816
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 26, 2023
d88af2b
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 26, 2023
32d2522
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 27, 2023
8bb45e2
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 27, 2023
214fc5f
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 28, 2023
de0e7e5
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 28, 2023
b16f469
Increment API version to support new reconciliation APPI and move rel…
shyamradhakrishnan Mar 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions api/v1beta1/ocicluster_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@ package v1beta1
import (
"github.com/oracle/cluster-api-provider-oci/api/v1beta2"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)

var clusterlogger = ctrl.Log.WithName("ocimanagedcluster-resource")

// ConvertTo converts the v1beta1 AWSCluster receiver to a v1beta2 AWSCluster.
func (src *OCICluster) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*v1beta2.OCICluster)

if err := Convert_v1beta1_OCICluster_To_v1beta2_OCICluster(src, dst, nil); err != nil {
return err
}
clusterlogger.Info("beta1 to beta2")
clusterlogger.Info("source is", "source", src)
clusterlogger.Info("destination is", "destination", dst)

ad, err := Convertv1beta1AdMapTov1beta2AdMap(src.Status.AvailabilityDomains)
if err != nil {
return err
Expand Down
64 changes: 32 additions & 32 deletions config/crd/bases/infrastructure.cluster.x-k8s.io_ociclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,38 @@ spec:
vcn:
description: VCN configuration.
properties:
NetworkSecurityGroup:
cidr:
description: VCN CIDR.
type: string
id:
description: VCN OCID.
type: string
internetGateway:
description: Configuration for Internet Gateway.
properties:
id:
description: ID of Internet Gateway.
type: string
skip:
description: Skip specifies whether to skip creating internet
gateway even if any one Subnet is public.
type: boolean
type: object
name:
description: VCN Name.
type: string
natGateway:
description: Configuration for NAT Gateway.
properties:
id:
description: ID of Nat Gateway.
type: string
skip:
description: Skip specifies whether to skip creating NAT
gateway even if any one Subnet is private.
type: boolean
type: object
networkSecurityGroup:
description: Configuration for NSG management.
properties:
list:
Expand Down Expand Up @@ -1611,37 +1642,6 @@ spec:
security groups.
type: boolean
type: object
cidr:
description: VCN CIDR.
type: string
id:
description: VCN OCID.
type: string
internetGateway:
description: Configuration for Internet Gateway.
properties:
id:
description: ID of Internet Gateway.
type: string
skip:
description: Skip specifies whether to skip creating internet
gateway even if any one Subnet is public.
type: boolean
type: object
name:
description: VCN Name.
type: string
natGateway:
description: Configuration for NAT Gateway.
properties:
id:
description: ID of Nat Gateway.
type: string
skip:
description: Skip specifies whether to skip creating NAT
gateway even if any one Subnet is private.
type: boolean
type: object
routeTable:
description: Configuration for Route table.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,38 @@ spec:
vcn:
description: VCN configuration.
properties:
NetworkSecurityGroup:
cidr:
description: VCN CIDR.
type: string
id:
description: VCN OCID.
type: string
internetGateway:
description: Configuration for Internet Gateway.
properties:
id:
description: ID of Internet Gateway.
type: string
skip:
description: Skip specifies whether to skip creating
internet gateway even if any one Subnet is public.
type: boolean
type: object
name:
description: VCN Name.
type: string
natGateway:
description: Configuration for NAT Gateway.
properties:
id:
description: ID of Nat Gateway.
type: string
skip:
description: Skip specifies whether to skip creating
NAT gateway even if any one Subnet is private.
type: boolean
type: object
networkSecurityGroup:
description: Configuration for NSG management.
properties:
list:
Expand Down Expand Up @@ -1725,37 +1756,6 @@ spec:
network security groups.
type: boolean
type: object
cidr:
description: VCN CIDR.
type: string
id:
description: VCN OCID.
type: string
internetGateway:
description: Configuration for Internet Gateway.
properties:
id:
description: ID of Internet Gateway.
type: string
skip:
description: Skip specifies whether to skip creating
internet gateway even if any one Subnet is public.
type: boolean
type: object
name:
description: VCN Name.
type: string
natGateway:
description: Configuration for NAT Gateway.
properties:
id:
description: ID of Nat Gateway.
type: string
skip:
description: Skip specifies whether to skip creating
NAT gateway even if any one Subnet is private.
type: boolean
type: object
routeTable:
description: Configuration for Route table.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,38 @@ spec:
vcn:
description: VCN configuration.
properties:
NetworkSecurityGroup:
cidr:
description: VCN CIDR.
type: string
id:
description: VCN OCID.
type: string
internetGateway:
description: Configuration for Internet Gateway.
properties:
id:
description: ID of Internet Gateway.
type: string
skip:
description: Skip specifies whether to skip creating internet
gateway even if any one Subnet is public.
type: boolean
type: object
name:
description: VCN Name.
type: string
natGateway:
description: Configuration for NAT Gateway.
properties:
id:
description: ID of Nat Gateway.
type: string
skip:
description: Skip specifies whether to skip creating NAT
gateway even if any one Subnet is private.
type: boolean
type: object
networkSecurityGroup:
description: Configuration for NSG management.
properties:
list:
Expand Down Expand Up @@ -1615,37 +1646,6 @@ spec:
security groups.
type: boolean
type: object
cidr:
description: VCN CIDR.
type: string
id:
description: VCN OCID.
type: string
internetGateway:
description: Configuration for Internet Gateway.
properties:
id:
description: ID of Internet Gateway.
type: string
skip:
description: Skip specifies whether to skip creating internet
gateway even if any one Subnet is public.
type: boolean
type: object
name:
description: VCN Name.
type: string
natGateway:
description: Configuration for NAT Gateway.
properties:
id:
description: ID of Nat Gateway.
type: string
skip:
description: Skip specifies whether to skip creating NAT
gateway even if any one Subnet is private.
type: boolean
type: object
routeTable:
description: Configuration for Route table.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,38 @@ spec:
vcn:
description: VCN configuration.
properties:
NetworkSecurityGroup:
cidr:
description: VCN CIDR.
type: string
id:
description: VCN OCID.
type: string
internetGateway:
description: Configuration for Internet Gateway.
properties:
id:
description: ID of Internet Gateway.
type: string
skip:
description: Skip specifies whether to skip creating
internet gateway even if any one Subnet is public.
type: boolean
type: object
name:
description: VCN Name.
type: string
natGateway:
description: Configuration for NAT Gateway.
properties:
id:
description: ID of Nat Gateway.
type: string
skip:
description: Skip specifies whether to skip creating
NAT gateway even if any one Subnet is private.
type: boolean
type: object
networkSecurityGroup:
description: Configuration for NSG management.
properties:
list:
Expand Down Expand Up @@ -1733,37 +1764,6 @@ spec:
network security groups.
type: boolean
type: object
cidr:
description: VCN CIDR.
type: string
id:
description: VCN OCID.
type: string
internetGateway:
description: Configuration for Internet Gateway.
properties:
id:
description: ID of Internet Gateway.
type: string
skip:
description: Skip specifies whether to skip creating
internet gateway even if any one Subnet is public.
type: boolean
type: object
name:
description: VCN Name.
type: string
natGateway:
description: Configuration for NAT Gateway.
properties:
id:
description: ID of Nat Gateway.
type: string
skip:
description: Skip specifies whether to skip creating
NAT gateway even if any one Subnet is private.
type: boolean
type: object
routeTable:
description: Configuration for Route table.
properties:
Expand Down
3 changes: 1 addition & 2 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ webhooks:
- ocimanagedcontrolplanes
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
Expand Down Expand Up @@ -140,7 +139,7 @@ webhooks:
- ocimachinetemplates
sideEffects: None
- admissionReviewVersions:
- v1beta1
- v1beta2
clientConfig:
service:
name: webhook-service
Expand Down
3 changes: 3 additions & 0 deletions exp/api/v1beta1/ocimanagedcluster_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ var managedclusterlogger = ctrl.Log.WithName("ocimanagedcluster-resource")
func (src *OCIManagedCluster) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*v1beta2.OCIManagedCluster)

managedclusterlogger.Info("before - beta1 to beta2")
managedclusterlogger.Info("before - source is", "source", src)
managedclusterlogger.Info("before - destination is", "destination", dst)
joekr marked this conversation as resolved.
Show resolved Hide resolved
if err := Convert_v1beta1_OCIManagedCluster_To_v1beta2_OCIManagedCluster(src, dst, nil); err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions exp/api/v1beta2/ocimanagedcluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ var (
_ webhook.Validator = &OCIManagedCluster{}
)

// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-ocimanagedcluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=ocimanagedclusters,versions=v1beta1,name=validation.ocimanagedcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-ocimanagedcluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=ocimanagedclusters,versions=v1beta1,name=default.ocimanagedcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1
// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta2-ocimanagedcluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=ocimanagedclusters,versions=v1beta2,name=validation.ocimanagedcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta2
// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta2-ocimanagedcluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=ocimanagedclusters,versions=v1beta2,name=default.ocimanagedcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta2

func (c *OCIManagedCluster) Default() {
if c.Spec.OCIResourceIdentifier == "" {
Expand Down
Loading