Skip to content

Commit e05c71b

Browse files
edmondceausuroot
authored and
root
committed
Add functionality for resolveConflicts: PRESERVE
fixes for test to pass removed v1beta1 support
1 parent e9f2823 commit e05c71b

28 files changed

+2980
-5359
lines changed

cmd/clusterawsadm/api/bootstrap/v1alpha1/conversion.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,3 @@ import (
2525
func Convert_v1beta1_AWSIAMConfigurationSpec_To_v1alpha1_AWSIAMConfigurationSpec(in *v1beta1.AWSIAMConfigurationSpec, out *AWSIAMConfigurationSpec, s conversion.Scope) error {
2626
return autoConvert_v1beta1_AWSIAMConfigurationSpec_To_v1alpha1_AWSIAMConfigurationSpec(in, out, s)
2727
}
28-
29-
func Convert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(in *v1beta1.AWSIAMRoleSpec, out *AWSIAMRoleSpec, s conversion.Scope) error {
30-
return autoConvert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(in, out, s)
31-
}

cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.conversion.go

Lines changed: 16 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/clusterawsadm/api/bootstrap/v1beta1/types.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ type AWSIAMRoleSpec struct {
8383
// ExtraStatements are additional IAM statements to be included inline for the role.
8484
ExtraStatements []iamv1.StatementEntry `json:"extraStatements,omitempty"`
8585

86-
// Path sets the path to the role.
87-
// +optional
88-
Path string `json:"path,omitempty"`
89-
90-
// PermissionsBoundary sets the ARN of the managed policy that is used to set the permissions boundary for the role.
91-
// +optional
92-
PermissionsBoundary string `json:"permissionsBoundary,omitempty"`
93-
9486
// TrustStatements is an IAM PolicyDocument defining what identities are allowed to assume this role.
9587
// See "sigs.k8s.io/cluster-api-provider-aws/v2/cmd/clusterawsadm/api/iam/v1beta1" for more documentation.
9688
TrustStatements []iamv1.StatementEntry `json:"trustStatements,omitempty"`

cmd/clusterawsadm/cloudformation/bootstrap/template.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,30 +138,24 @@ func (t Template) RenderCloudFormation() *cloudformation.Template {
138138

139139
template.Resources[AWSIAMRoleControlPlane] = &cfn_iam.Role{
140140
RoleName: t.NewManagedName("control-plane"),
141-
Path: t.Spec.ControlPlane.Path,
142141
AssumeRolePolicyDocument: t.controlPlaneTrustPolicy(),
143142
ManagedPolicyArns: t.Spec.ControlPlane.ExtraPolicyAttachments,
144143
Policies: t.controlPlanePolicies(),
145-
PermissionsBoundary: t.Spec.ControlPlane.PermissionsBoundary,
146144
Tags: converters.MapToCloudFormationTags(t.Spec.ControlPlane.Tags),
147145
}
148146

149147
template.Resources[AWSIAMRoleControllers] = &cfn_iam.Role{
150148
RoleName: t.NewManagedName("controllers"),
151-
Path: t.Spec.ControlPlane.Path,
152149
AssumeRolePolicyDocument: t.controllersTrustPolicy(),
153150
Policies: t.controllersRolePolicy(),
154-
PermissionsBoundary: t.Spec.ControlPlane.PermissionsBoundary,
155151
Tags: converters.MapToCloudFormationTags(t.Spec.ClusterAPIControllers.Tags),
156152
}
157153

158154
template.Resources[AWSIAMRoleNodes] = &cfn_iam.Role{
159155
RoleName: t.NewManagedName("nodes"),
160-
Path: t.Spec.ControlPlane.Path,
161156
AssumeRolePolicyDocument: t.nodeTrustPolicy(),
162157
ManagedPolicyArns: t.nodeManagedPolicies(),
163158
Policies: t.nodePolicies(),
164-
PermissionsBoundary: t.Spec.ControlPlane.PermissionsBoundary,
165159
Tags: converters.MapToCloudFormationTags(t.Spec.Nodes.Tags),
166160
}
167161

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,10 +2135,11 @@ spec:
21352135
default: overwrite
21362136
description: |-
21372137
ConflictResolution is used to declare what should happen if there
2138-
are parameter conflicts. Defaults to none
2138+
are parameter conflicts. Defaults to overwrite
21392139
enum:
21402140
- overwrite
21412141
- none
2142+
- preserve
21422143
type: string
21432144
name:
21442145
description: Name is the name of the addon
@@ -2937,30 +2938,6 @@ spec:
29372938
and no name is supplied then a role is created.
29382939
minLength: 2
29392940
type: string
2940-
rolePath:
2941-
description: |-
2942-
RolePath sets the path to the role. For more information about paths, see IAM Identifiers
2943-
(https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html)
2944-
in the IAM User Guide.
2945-
2946-
This parameter is optional. If it is not included, it defaults to a slash
2947-
(/).
2948-
type: string
2949-
rolePermissionsBoundary:
2950-
description: |-
2951-
RolePermissionsBoundary sets the ARN of the managed policy that is used
2952-
to set the permissions boundary for the role.
2953-
2954-
A permissions boundary policy defines the maximum permissions that identity-based
2955-
policies can grant to an entity, but does not grant permissions. Permissions
2956-
boundaries do not define the maximum permissions that a resource-based policy
2957-
can grant to an entity. To learn more, see Permissions boundaries for IAM
2958-
entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html)
2959-
in the IAM User Guide.
2960-
2961-
For more information about policy types, see Policy types (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policy-types)
2962-
in the IAM User Guide.
2963-
type: string
29642941
secondaryCidrBlock:
29652942
description: |-
29662943
SecondaryCidrBlock is the additional CIDR range to use for pod IPs.

config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,9 +911,6 @@ spec:
911911
description: Ready denotes that the ROSAControlPlane API Server is
912912
ready to receive requests.
913913
type: boolean
914-
version:
915-
description: OpenShift semantic version, for example "4.14.5".
916-
type: string
917914
required:
918915
- ready
919916
type: object

config/crd/bases/infrastructure.cluster.x-k8s.io_awsfargateprofiles.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -264,30 +264,6 @@ spec:
264264
and not delete it on deletion. If the EKSEnableIAM feature
265265
flag is true and no name is supplied then a role is created.
266266
type: string
267-
rolePath:
268-
description: |-
269-
RolePath sets the path to the role. For more information about paths, see IAM Identifiers
270-
(https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html)
271-
in the IAM User Guide.
272-
273-
This parameter is optional. If it is not included, it defaults to a slash
274-
(/).
275-
type: string
276-
rolePermissionsBoundary:
277-
description: |-
278-
RolePermissionsBoundary sets the ARN of the managed policy that is used
279-
to set the permissions boundary for the role.
280-
281-
A permissions boundary policy defines the maximum permissions that identity-based
282-
policies can grant to an entity, but does not grant permissions. Permissions
283-
boundaries do not define the maximum permissions that a resource-based policy
284-
can grant to an entity. To learn more, see Permissions boundaries for IAM
285-
entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html)
286-
in the IAM User Guide.
287-
288-
For more information about policy types, see Policy types (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policy-types)
289-
in the IAM User Guide.
290-
type: string
291267
selectors:
292268
description: Selectors specify fargate pod selectors.
293269
items:

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -938,30 +938,6 @@ spec:
938938
and not delete it on deletion. If the EKSEnableIAM feature
939939
flag is true and no name is supplied then a role is created.
940940
type: string
941-
rolePath:
942-
description: |-
943-
RolePath sets the path to the role. For more information about paths, see IAM Identifiers
944-
(https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html)
945-
in the IAM User Guide.
946-
947-
This parameter is optional. If it is not included, it defaults to a slash
948-
(/).
949-
type: string
950-
rolePermissionsBoundary:
951-
description: |-
952-
RolePermissionsBoundary sets the ARN of the managed policy that is used
953-
to set the permissions boundary for the role.
954-
955-
A permissions boundary policy defines the maximum permissions that identity-based
956-
policies can grant to an entity, but does not grant permissions. Permissions
957-
boundaries do not define the maximum permissions that a resource-based policy
958-
can grant to an entity. To learn more, see Permissions boundaries for IAM
959-
entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html)
960-
in the IAM User Guide.
961-
962-
For more information about policy types, see Policy types (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policy-types)
963-
in the IAM User Guide.
964-
type: string
965941
scaling:
966942
description: Scaling specifies scaling for the ASG behind this pool
967943
properties:

controllers/awsmachine_controller.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ func (r *AWSMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request)
204204
machineScope, err := scope.NewMachineScope(scope.MachineScopeParams{
205205
Client: r.Client,
206206
Cluster: cluster,
207-
Logger: log,
208207
Machine: machine,
209208
InfraCluster: infraCluster,
210209
AWSMachine: awsMachine,

controlplane/eks/api/v1beta1/conversion.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ func (r *AWSManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error {
4242
dst.Spec.VpcCni.Disable = r.Spec.DisableVPCCNI
4343
dst.Spec.Partition = restored.Spec.Partition
4444
dst.Spec.RestrictPrivateSubnets = restored.Spec.RestrictPrivateSubnets
45-
dst.Spec.RolePath = restored.Spec.RolePath
46-
dst.Spec.RolePermissionsBoundary = restored.Spec.RolePermissionsBoundary
4745
dst.Status.Version = restored.Status.Version
4846
dst.Spec.BootstrapSelfManagedAddons = restored.Spec.BootstrapSelfManagedAddons
4947
return nil

controlplane/eks/api/v1beta1/zz_generated.conversion.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controlplane/eks/api/v1beta2/awsmanagedcontrolplane_types.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -88,30 +88,6 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned
8888
// +optional
8989
RoleAdditionalPolicies *[]string `json:"roleAdditionalPolicies,omitempty"`
9090

91-
// RolePath sets the path to the role. For more information about paths, see IAM Identifiers
92-
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html)
93-
// in the IAM User Guide.
94-
//
95-
// This parameter is optional. If it is not included, it defaults to a slash
96-
// (/).
97-
// +optional
98-
RolePath string `json:"rolePath,omitempty"`
99-
100-
// RolePermissionsBoundary sets the ARN of the managed policy that is used
101-
// to set the permissions boundary for the role.
102-
//
103-
// A permissions boundary policy defines the maximum permissions that identity-based
104-
// policies can grant to an entity, but does not grant permissions. Permissions
105-
// boundaries do not define the maximum permissions that a resource-based policy
106-
// can grant to an entity. To learn more, see Permissions boundaries for IAM
107-
// entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html)
108-
// in the IAM User Guide.
109-
//
110-
// For more information about policy types, see Policy types (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policy-types)
111-
// in the IAM User Guide.
112-
// +optional
113-
RolePermissionsBoundary string `json:"rolePermissionsBoundary,omitempty"`
114-
11591
// Logging specifies which EKS Cluster logs should be enabled. Entries for
11692
// each of the enabled logs will be sent to CloudWatch
11793
// +optional

controlplane/eks/api/v1beta2/types.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ type Addon struct {
134134
// +optional
135135
Configuration string `json:"configuration,omitempty"`
136136
// ConflictResolution is used to declare what should happen if there
137-
// are parameter conflicts. Defaults to none
137+
// are parameter conflicts. Defaults to overwrite
138138
// +kubebuilder:default=overwrite
139-
// +kubebuilder:validation:Enum=overwrite;none
139+
// +kubebuilder:validation:Enum=overwrite;none;preserve
140140
ConflictResolution *AddonResolution `json:"conflictResolution,omitempty"`
141141
// ServiceAccountRoleArn is the ARN of an IAM role to bind to the addons service account
142142
// +optional
@@ -154,6 +154,10 @@ var (
154154
// AddonResolutionNone indicates that if there are parameter conflicts then
155155
// resolution will not be done and an error will be reported.
156156
AddonResolutionNone = AddonResolution("none")
157+
158+
// AddonResolutionPreserve indicates that if there are parameter conflicts then
159+
// resolution will result in preserving the existing value
160+
AddonResolutionPreserve = AddonResolution("preserve")
157161
)
158162

159163
// AddonStatus defines the status for an addon.

controlplane/rosa/api/v1beta2/rosacontrolplane_types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,6 @@ type RosaControlPlaneStatus struct {
749749
// OIDCEndpointURL is the endpoint url for the managed OIDC provider.
750750
OIDCEndpointURL string `json:"oidcEndpointURL,omitempty"`
751751

752-
// OpenShift semantic version, for example "4.14.5".
753-
// +optional
754-
Version string `json:"version"`
755-
756752
// Available upgrades for the ROSA hosted control plane.
757753
AvailableUpgrades []string `json:"availableUpgrades,omitempty"`
758754
}

0 commit comments

Comments
 (0)