Skip to content

Commit

Permalink
Remove support for legacy IAM permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers committed Jul 18, 2020
1 parent be3e311 commit 8cecb6b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/releases/1.18-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@

* Support for the Romana networking provider is deprecated and will be removed in kops 1.19.

* Support for legacy IAM permissions is deprecated and will be removed in kops 1.19.

# Full change list since 1.17.0 release

## 1.17.0-alpha.1 to 1.18.0-alpha.1
Expand Down
2 changes: 2 additions & 0 deletions docs/releases/1.19-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ has been updated by a newer version of kops unless it is given the `--allow-kops

* Support for the Romana networking provider has been removed.

* Support for legacy IAM permissions has been removed. This removal may be temporarily deferred to kops 1.20 by setting the `LegacyIAM` feature flag.

# Required Actions

# Deprecations
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ type Assets struct {

// IAMSpec adds control over the IAM security policies applied to resources
type IAMSpec struct {
// TODO: remove Legacy in next APIVersion
Legacy bool `json:"legacy"`
AllowContainerRegistry bool `json:"allowContainerRegistry,omitempty"`
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/kops/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ func validateClusterSpec(spec *kops.ClusterSpec, c *kops.Cluster, fieldPath *fie
}
}

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

if spec.RollingUpdate != nil {
allErrs = append(allErrs, validateRollingUpdate(spec.RollingUpdate, fieldPath.Child("rollingUpdate"), false)...)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/kops/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ func Test_Validate_AdditionalPolicies(t *testing.T) {
},
},
},
IAM: &kops.IAMSpec{},
}
errs := validateClusterSpec(clusterSpec, &kops.Cluster{Spec: *clusterSpec}, field.NewPath("spec"))
testErrors(t, g.Input, errs, g.ExpectedErrors)
Expand Down
2 changes: 2 additions & 0 deletions pkg/featureflag/featureflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ var (
TerraformJSON = New("TerraformJSON", Bool(false))
// Terraform012 will output terraform in the 0.12 (hcl2) syntax
Terraform012 = New("Terraform-0.12", Bool(true))
// LegacyIAM will permit use of legacy IAM permissions.
LegacyIAM = New("LegacyIAM", Bool(false))
)

// FeatureFlag defines a feature flag
Expand Down

0 comments on commit 8cecb6b

Please sign in to comment.