Skip to content

Commit f5cfcd4

Browse files
committed
OCPBUGS-33661: capi/aws: rename preserveBootstrapIgnition
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`.
1 parent d775b45 commit f5cfcd4

File tree

7 files changed

+28
-9
lines changed

7 files changed

+28
-9
lines changed

data/data/install.openshift.io_installconfigs.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,14 @@ spec:
21632163
for the cluster. If set, the AMI should belong to the same region
21642164
as the cluster.
21652165
type: string
2166+
bestEffortDeleteIgnition:
2167+
description: BestEffortDeleteIgnition is an optional field that
2168+
can be used to ignore errors from S3 deletion of ignition objects
2169+
during cluster bootstrap. The default behavior is to fail the
2170+
installation if ignition objects cannot be deleted. Enable this
2171+
functionality when there are known reasons disallowing their
2172+
deletion.
2173+
type: boolean
21662174
defaultMachinePlatform:
21672175
description: DefaultMachinePlatform is the default configuration
21682176
used when installing on AWS for machine pools which do not define
@@ -2283,9 +2291,8 @@ spec:
22832291
\ This default is subject to change over time."
22842292
type: string
22852293
preserveBootstrapIgnition:
2286-
description: PreserveBootstrapIgnition is an optional field that
2287-
can be used to make the S3 deletion optional during bootstrap
2288-
destroy.
2294+
description: PreserveBootstrapIgnition is deprecated. Use bestEffortDeleteIgnition
2295+
instead.
22892296
type: boolean
22902297
propagateUserTags:
22912298
description: PropagateUserTags is a flag that directs in-cluster

pkg/asset/cluster/tfvars/tfvars.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
334334
WorkerIAMRoleName: workerIAMRoleName,
335335
Architecture: installConfig.Config.ControlPlane.Architecture,
336336
Proxy: installConfig.Config.Proxy,
337-
PreserveBootstrapIgnition: installConfig.Config.AWS.PreserveBootstrapIgnition,
337+
PreserveBootstrapIgnition: installConfig.Config.AWS.BestEffortDeleteIgnition,
338338
MasterSecurityGroups: securityGroups,
339339
PublicIpv4Pool: installConfig.Config.AWS.PublicIpv4Pool,
340340
})

pkg/asset/installconfig/platformpermscheck.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (a *PlatformPermsCheck) Generate(dependencies asset.Parents) error {
102102
permissionGroups = append(permissionGroups, awsconfig.PermissionPublicIpv4Pool)
103103
}
104104

105-
if !ic.Config.AWS.PreserveBootstrapIgnition {
105+
if !ic.Config.AWS.BestEffortDeleteIgnition {
106106
permissionGroups = append(permissionGroups, awsconfig.PermissionDeleteIgnitionObjects)
107107
}
108108

pkg/asset/manifests/aws/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func GenerateClusterAssets(ic *installconfig.InstallConfig, clusterID *installco
153153
S3Bucket: &capa.S3Bucket{
154154
Name: fmt.Sprintf("openshift-bootstrap-data-%s", clusterID.InfraID),
155155
PresignedURLDuration: &metav1.Duration{Duration: 1 * time.Hour},
156-
BestEffortDeleteObjects: ptr.To(ic.Config.AWS.PreserveBootstrapIgnition),
156+
BestEffortDeleteObjects: ptr.To(ic.Config.AWS.BestEffortDeleteIgnition),
157157
},
158158
ControlPlaneLoadBalancer: &capa.AWSLoadBalancerSpec{
159159
Name: ptr.To(clusterID.InfraID + "-int"),

pkg/explain/printer_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ func Test_PrintFields(t *testing.T) {
153153
amiID <string>
154154
AMIID is the AMI that should be used to boot machines for the cluster. If set, the AMI should belong to the same region as the cluster.
155155
156+
bestEffortDeleteIgnition <boolean>
157+
BestEffortDeleteIgnition is an optional field that can be used to ignore errors from S3 deletion of ignition objects during cluster bootstrap. The default behavior is to fail the installation if ignition objects cannot be deleted. Enable this functionality when there are known reasons disallowing their deletion.
158+
156159
defaultMachinePlatform <object>
157160
DefaultMachinePlatform is the default configuration used when installing on AWS for machine pools which do not define their own platform configuration.
158161
@@ -173,7 +176,7 @@ func Test_PrintFields(t *testing.T) {
173176
If this field is not set explicitly, it defaults to "Classic". This default is subject to change over time.
174177
175178
preserveBootstrapIgnition <boolean>
176-
PreserveBootstrapIgnition is an optional field that can be used to make the S3 deletion optional during bootstrap destroy.
179+
PreserveBootstrapIgnition is deprecated. Use bestEffortDeleteIgnition instead.
177180
178181
propagateUserTags <boolean>
179182
PropagateUserTags is a flag that directs in-cluster operators to include the specified user tags in the tags of the AWS resources that the operators create.

pkg/types/aws/platform.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,16 @@ type Platform struct {
102102
// +optional
103103
LBType configv1.AWSLBType `json:"lbType,omitempty"`
104104

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

109+
// BestEffortDeleteIgnition is an optional field that can be used to ignore errors from S3 deletion of ignition
110+
// objects during cluster bootstrap. The default behavior is to fail the installation if ignition objects cannot be
111+
// deleted. Enable this functionality when there are known reasons disallowing their deletion.
112+
// +optional
113+
BestEffortDeleteIgnition bool `json:"bestEffortDeleteIgnition,omitempty"`
114+
110115
// PublicIpv4Pool is an optional field that can be used to tell the installation process to use
111116
// Public IPv4 address that you bring to your AWS account with BYOIP.
112117
// +optional

pkg/types/conversion/installconfig.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,5 +285,9 @@ func convertAWS(config *types.InstallConfig) error {
285285
if config.Platform.AWS.ExperimentalPropagateUserTag != nil {
286286
config.Platform.AWS.PropagateUserTag = *config.Platform.AWS.ExperimentalPropagateUserTag
287287
}
288+
// BestEffortDeleteIgnition takes precedence when set
289+
if !config.AWS.BestEffortDeleteIgnition {
290+
config.AWS.BestEffortDeleteIgnition = config.AWS.PreserveBootstrapIgnition
291+
}
288292
return nil
289293
}

0 commit comments

Comments
 (0)