Skip to content

Commit

Permalink
fix(vpc/vip)!: remove deprecated subnet_id argument
Browse files Browse the repository at this point in the history
  • Loading branch information
azrod committed Jan 12, 2023
1 parent 41c08b3 commit 44f769b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 128 deletions.
20 changes: 5 additions & 15 deletions apis/vpc/v1beta1/zz_generated.deepcopy.go

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

16 changes: 0 additions & 16 deletions apis/vpc/v1beta1/zz_generated.resolvers.go

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

16 changes: 3 additions & 13 deletions apis/vpc/v1beta1/zz_vip_types.go

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

8 changes: 3 additions & 5 deletions config/vpc/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,11 @@ func Configure(p *config.Provider) {
Type: "VPCSubnet",
}
})

// flexibleengine_networking_vip_v2
// https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/resources/networking_vip_v2
p.AddResourceConfigurator("flexibleengine_networking_vip_v2", func(r *config.Resource) {
// subnet_id is the ID of the subnet to which this VIP belongs.
r.References["subnet_id"] = config.Reference{
Type: "VPCSubnet",
}
// subnet_id is DEPRECATED and generate conflict with ip_version
config.MoveToStatus(r.TerraformResource, "subnet_id")
})

}
3 changes: 0 additions & 3 deletions examples/vpc/vip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ spec:
networkIdSelector:
matchLabels:
testing.upbound.io/example-name: example_subnet
subnetIdSelector:
matchLabels:
testing.upbound.io/example-name: example_subnet
79 changes: 3 additions & 76 deletions package/crds/vpc.flexibleengine.upbound.io_vips.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,82 +156,6 @@ spec:
If omitted, the provider-level region will be used. Changing
this will create a new VIP resource.
type: string
subnetId:
description: The VIP ID.
type: string
subnetIdRef:
description: Reference to a VPCSubnet to populate subnetId.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution of
this reference is required. The default is 'Required',
which means the reconcile will fail if the reference
cannot be resolved. 'Optional' means this reference
will be a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference should
be resolved. The default is 'IfNotPresent', which will
attempt to resolve the reference only when the corresponding
field is not present. Use 'Always' to resolve the reference
on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
subnetIdSelector:
description: Selector for a VPCSubnet to populate subnetId.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object with the
same controller reference as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: Resolution specifies whether resolution of
this reference is required. The default is 'Required',
which means the reconcile will fail if the reference
cannot be resolved. 'Optional' means this reference
will be a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: Resolve specifies when this reference should
be resolved. The default is 'IfNotPresent', which will
attempt to resolve the reference only when the corresponding
field is not present. Use 'Always' to resolve the reference
on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
type: object
providerConfigRef:
default:
Expand Down Expand Up @@ -421,6 +345,9 @@ spec:
status:
description: The VIP status.
type: string
subnetId:
description: The VIP ID.
type: string
type: object
conditions:
description: Conditions of the resource.
Expand Down

0 comments on commit 44f769b

Please # to comment.