Skip to content

Commit 9f02731

Browse files
Merge pull request #8460 from r4f4/capi-aws-preserve-ignition-rename
OCPBUGS-33661: capi/aws: rename `preserveBootstrapIgnition`
2 parents 7026956 + f5cfcd4 commit 9f02731

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
@@ -2167,6 +2167,14 @@ spec:
21672167
for the cluster. If set, the AMI should belong to the same region
21682168
as the cluster.
21692169
type: string
2170+
bestEffortDeleteIgnition:
2171+
description: BestEffortDeleteIgnition is an optional field that
2172+
can be used to ignore errors from S3 deletion of ignition objects
2173+
during cluster bootstrap. The default behavior is to fail the
2174+
installation if ignition objects cannot be deleted. Enable this
2175+
functionality when there are known reasons disallowing their
2176+
deletion.
2177+
type: boolean
21702178
defaultMachinePlatform:
21712179
description: DefaultMachinePlatform is the default configuration
21722180
used when installing on AWS for machine pools which do not define
@@ -2287,9 +2295,8 @@ spec:
22872295
\ This default is subject to change over time."
22882296
type: string
22892297
preserveBootstrapIgnition:
2290-
description: PreserveBootstrapIgnition is an optional field that
2291-
can be used to make the S3 deletion optional during bootstrap
2292-
destroy.
2298+
description: PreserveBootstrapIgnition is deprecated. Use bestEffortDeleteIgnition
2299+
instead.
22932300
type: boolean
22942301
propagateUserTags:
22952302
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)