Skip to content

Commit

Permalink
Merge pull request #11641 from johngmyers/remove-legacy-iam
Browse files Browse the repository at this point in the history
Remove fallback support for legacy IAM
  • Loading branch information
k8s-ci-robot committed May 31, 2021
2 parents 9725853 + b82b129 commit e265251
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 307 deletions.
7 changes: 1 addition & 6 deletions docs/contributing/adding_a_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,7 @@ are built by `BuildAWSPolicyMaster()` in pkg/model/iam/iam_builder.go:
```

```go
func addCiliumEniPermissions(p *Policy, resource stringorslice.StringOrSlice, legacyIAM bool) {
if legacyIAM {
// Legacy IAM provides ec2:*, so no additional permissions required
return
}

func addCiliumEniPermissions(p *Policy, resource stringorslice.StringOrSlice) {
p.Statement = append(p.Statement,
&Statement{
Effect: StatementEffectAllow,
Expand Down
6 changes: 1 addition & 5 deletions pkg/apis/kops/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,10 @@ func validateClusterSpec(spec *kops.ClusterSpec, c *kops.Cluster, fieldPath *fie
}
}

if (spec.IAM == nil || spec.IAM.Legacy) && !featureflag.LegacyIAM.Enabled() {
if spec.IAM == nil || spec.IAM.Legacy {
allErrs = append(allErrs, field.Forbidden(fieldPath.Child("iam", "legacy"), "legacy IAM permissions are no longer supported"))
}

if (spec.IAM == nil || spec.IAM.Legacy) && featureflag.UseServiceAccountIAM.Enabled() {
allErrs = append(allErrs, field.Forbidden(fieldPath.Child("iam", "legacy"), "legacy IAM permissions are not supported with UseServiceAccountIAM"))
}

if spec.RollingUpdate != nil {
allErrs = append(allErrs, validateRollingUpdate(spec.RollingUpdate, fieldPath.Child("rollingUpdate"), false)...)
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/featureflag/featureflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ var (
SkipEtcdVersionCheck = New("SkipEtcdVersionCheck", Bool(false))
// TerraformJSON outputs terraform in JSON instead of hcl output. JSON output can be also parsed by terraform 0.12
TerraformJSON = New("TerraformJSON", Bool(false))
// LegacyIAM will permit use of legacy IAM permissions.
LegacyIAM = New("LegacyIAM", Bool(false))
// ClusterAddons activates experimental cluster-addons support
ClusterAddons = New("ClusterAddons", Bool(false))
// UseServiceAccountIAM controls whether we use pod-level IAM permissions for our system pods and kOps addons.
Expand Down
Loading

0 comments on commit e265251

Please sign in to comment.