Documentation ¶
Index ¶
- Variables
- func DiffPatch(in *v1alpha1.SubnetParameters, observed *ibmVPC.Subnet) (map[string]interface{}, error)
- func GenerateCreateOptions(in *v1alpha1.SubnetParameters) (ibmVPC.CreateSubnetOptions, error)
- func GenerateCreateSubnetParameters(isByTotalCount bool, in *ibmVPC.Subnet) (v1alpha1.SubnetParameters, error)
- func GenerateObservation(in *ibmVPC.Subnet) (v1alpha1.SubnetObservation, error)
- func GetDummyCreateParams(byTotalCount bool, ipVersionNil bool, nameNil bool, networkACLNil bool, ...) v1alpha1.SubnetParameters
- func GetDummyObservation(isByTotalCount bool, createdAtNil bool, crnNil bool, hrefNil bool, idNil bool, ...) ibmVPC.Subnet
- func IsUpToDate(in *v1alpha1.SubnetParameters, observed *ibmVPC.Subnet, l logging.Logger) (bool, error)
- func LateInitializeSpec(spec *v1alpha1.SubnetParameters, fromIBMCloud *ibmVPC.Subnet) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var ( // CrnVal is public b/c need to used it in the controller CrnVal = ibmc.RandomString(true) )
Functions ¶
func DiffPatch ¶
func DiffPatch(in *v1alpha1.SubnetParameters, observed *ibmVPC.Subnet) (map[string]interface{}, error)
DiffPatch checks whether the current subnet config (in the cloud) is up-to-date compared to the crossplane one (after late initialization)
Params
in - the crossplane parameters observed - what came from the cloud
Returns
- A map of the values that should get updated. Note that, in case that more than one option to identify a resource exists (eg id, href, crn), only one is used
- error - nil for now
func GenerateCreateOptions ¶
func GenerateCreateOptions(in *v1alpha1.SubnetParameters) (ibmVPC.CreateSubnetOptions, error)
GenerateCreateOptions returns a cloud-compliant version of the crossplane creation parameters
Params
in - the creation options, crossplane style Returns the struct to use in the cloud call error - always nil for now
func GenerateCreateSubnetParameters ¶
func GenerateCreateSubnetParameters(isByTotalCount bool, in *ibmVPC.Subnet) (v1alpha1.SubnetParameters, error)
GenerateCreateSubnetParameters gives us a create-from-crossplane version of the cloud observation results parameters
Params
isByTotalCount - whether the subnet was created via total address count in - the create options, in IBM-cloud-style
Returns
the params, crossplane-style
func GenerateObservation ¶
func GenerateObservation(in *ibmVPC.Subnet) (v1alpha1.SubnetObservation, error)
GenerateObservation returns a crossplane version of the cloud observation results parameters
Params
in - the create options, in IBM-cloud-style
Returns
the status, crossplane-style
func GetDummyCreateParams ¶
func GetDummyCreateParams( byTotalCount bool, ipVersionNil bool, nameNil bool, networkACLNil bool, publicGatewayNil bool, resourceGroupNil bool, routingTableNil bool, totalIpv4AddressCountNil bool, zoneNil bool, ipv4CIDRBlockNil bool) v1alpha1.SubnetParameters
GetDummyCreateParams returns a dummy object, ready to be used in a create-VPC-in-k8s request. Non-nil values will be the ones of the local constants above
Params
byTotalCount - whether the returned object is "ByTotalCount" or "ByCIDR" ipVersionNil - whether to set the 'IPVersion' member to nil nameNil - whether to set the 'Name' member to nil networkACLNil - whether to set the 'NetworkACL' member to nil publicGatewayNil - whether to set the 'PublicGateway' member to nil.. resourceGroupNil - whether to set the 'ResourceGroup' member to nil routingTableNil - whether to set the 'RoutingTable' member to nil totalIpv4AddressCountNil - whether to set the 'TotalIpv4AddressCount' member to nil (does not apply if the returned object is 'ByTotalCount') zoneNil - whether to set the 'Zone' member to nil (does not apply if the returned object is 'ByTotalCount') ipv4CIDRBlockNil - whether to set the 'Ipv4CIDRBlockNil' member to nil (does not apply if the returned object is 'ByCIDR')
Returns
an object appropriately populated
func GetDummyObservation ¶
func GetDummyObservation( isByTotalCount bool, createdAtNil bool, crnNil bool, hrefNil bool, idNil bool, ipVersionNil bool, ipv4CIDRBlockNil bool, nameNil bool, networkACLNil bool, networkACLCRNNil bool, networkACLDeletedNil bool, networkACLDeletedMoreInfoNil bool, networkACLHrefNil bool, networkACLIDNil bool, networkACLNameNil bool, publicGatewayNil bool, publicGatewayCRNNil bool, publicGatewayDeletedNil bool, publicGatewayDeletedMoreInfoNil bool, publicGatewayHrefNil bool, publicGatewayIDNil bool, publicGatewayNameNil bool, publicGatewayResourceTypeNil bool, resourceGroupNil bool, resourceGroupNameNil bool, resourceGroupHrefNil bool, resourceGroupIDNil bool, routingTableNil bool, routingTableDeletedNil bool, routingTableDeletedMoreInfoNil, routingTableHrefNil bool, routingTableIDNil bool, routingTableNameNil bool, routingTableResourceTypeNil bool, statusNil bool, totalIpv4AddressCountNil bool, vpcReferenceNil bool, vpcReferenceDeletedNil bool, vpcReferenceDeletedMoreInfoNil, vpcReferenceHrefNil bool, vpcReferenceIDNil bool, vpcReferenceNameNil bool, vpcReferenceCRNNil bool, zoneReferenceNil bool, zoneReferenceHrefNil bool, zoneReferenceNameNil bool) ibmVPC.Subnet
GetDummyObservation returns a dummy object, ready to be used in create-subnet-in-the-cloud request. Non-nil values will be the ones of the local constants above.
Params
isByTotalCount - determines what kind of observation we get each other param is used in controlling the value of the similarly-named field in the returned structure.
Returns
an object appropriately populated
func IsUpToDate ¶
func IsUpToDate(in *v1alpha1.SubnetParameters, observed *ibmVPC.Subnet, l logging.Logger) (bool, error)
IsUpToDate checks whether the current subnet config (in the cloud) is up-to-date compared to the crossplane one
No error is currently returned
func LateInitializeSpec ¶
LateInitializeSpec fills optional and unassigned fields with the values in the spec, from the info that comes from the cloud
Params
spec - what we get from k8s fromIBMCloud - ...what comes from the cloud
Returns
whether late initialization happened currently, always nil
Types ¶
This section is empty.