Skip to content

Commit

Permalink
OCPBUGS-33661: capi/aws: rename preserveBootstrapIgnition
Browse files Browse the repository at this point in the history
The name doesn't really reflect the purpose of the field, but the
terraform implementation instead. Since the implementation has changed
in capi/capa, let's rename it so users don't expect the ignition object
to not be destroyed when there are enough permissions.

The old field is kept for the deprecation period but will be removed in
the future in favor of the new `BestEffortDeleteIgnition`.
  • Loading branch information
r4f4 committed May 23, 2024
1 parent 28e30ea commit 15619b3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
10 changes: 7 additions & 3 deletions data/data/install.openshift.io_installconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,11 @@ spec:
for the cluster. If set, the AMI should belong to the same region
as the cluster.
type: string
bestEffortDeleteIgnition:
description: BestEffortDeleteIgnition is an optional field that
can be used to ignore errors from S3 deletion of ignition objects
during cluster bootstrap.
type: boolean
defaultMachinePlatform:
description: DefaultMachinePlatform is the default configuration
used when installing on AWS for machine pools which do not define
Expand Down Expand Up @@ -2283,9 +2288,8 @@ spec:
\ This default is subject to change over time."
type: string
preserveBootstrapIgnition:
description: PreserveBootstrapIgnition is an optional field that
can be used to make the S3 deletion optional during bootstrap
destroy.
description: PreserveBootstrapIgnition is deprecated. Use bestEffortDeleteIgnition
instead.
type: boolean
propagateUserTags:
description: PropagateUserTags is a flag that directs in-cluster
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/cluster/tfvars/tfvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
WorkerIAMRoleName: workerIAMRoleName,
Architecture: installConfig.Config.ControlPlane.Architecture,
Proxy: installConfig.Config.Proxy,
PreserveBootstrapIgnition: installConfig.Config.AWS.PreserveBootstrapIgnition,
PreserveBootstrapIgnition: installConfig.Config.AWS.BestEffortDeleteIgnition,
MasterSecurityGroups: securityGroups,
PublicIpv4Pool: installConfig.Config.AWS.PublicIpv4Pool,
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/manifests/aws/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func GenerateClusterAssets(ic *installconfig.InstallConfig, clusterID *installco
S3Bucket: &capa.S3Bucket{
Name: fmt.Sprintf("openshift-bootstrap-data-%s", clusterID.InfraID),
PresignedURLDuration: &metav1.Duration{Duration: 1 * time.Hour},
BestEffortDeleteObjects: ptr.To(ic.Config.AWS.PreserveBootstrapIgnition),
BestEffortDeleteObjects: ptr.To(ic.Config.AWS.BestEffortDeleteIgnition),
},
ControlPlaneLoadBalancer: &capa.AWSLoadBalancerSpec{
Name: ptr.To(clusterID.InfraID + "-int"),
Expand Down
8 changes: 6 additions & 2 deletions pkg/types/aws/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,15 @@ type Platform struct {
// +optional
LBType configv1.AWSLBType `json:"lbType,omitempty"`

// PreserveBootstrapIgnition is an optional field that can be used to make the S3 deletion optional
// during bootstrap destroy.
// PreserveBootstrapIgnition is deprecated. Use bestEffortDeleteIgnition instead.
// +optional
PreserveBootstrapIgnition bool `json:"preserveBootstrapIgnition,omitempty"`

// BestEffortDeleteIgnition is an optional field that can be used to ignore errors from S3 deletion of ignition
// objects during cluster bootstrap.
// +optional
BestEffortDeleteIgnition bool `json:"bestEffortDeleteIgnition,omitempty"`

// PublicIpv4Pool is an optional field that can be used to tell the installation process to use
// Public IPv4 address that you bring to your AWS account with BYOIP.
// +optional
Expand Down
4 changes: 4 additions & 0 deletions pkg/types/conversion/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,9 @@ func convertAWS(config *types.InstallConfig) error {
if config.Platform.AWS.ExperimentalPropagateUserTag != nil {
config.Platform.AWS.PropagateUserTag = *config.Platform.AWS.ExperimentalPropagateUserTag
}
// BestEffortDeleteIgnition takes precedence when set
if !config.AWS.BestEffortDeleteIgnition {
config.AWS.BestEffortDeleteIgnition = config.AWS.PreserveBootstrapIgnition
}
return nil
}

0 comments on commit 15619b3

Please sign in to comment.