Skip to content

Commit

Permalink
updating to remove 'csi' from name
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hein <me@chrishein.com>
  • Loading branch information
christopherhein committed Mar 23, 2019
1 parent 2a1189c commit 71da442
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/eksctl.io/v1alpha4/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (c *ClusterConfig) NewNodeGroup() *NodeGroup {
AutoScaler: NewBoolFalse(),
ExternalDNS: NewBoolFalse(),
AppMesh: NewBoolFalse(),
EBSCSI: NewBoolFalse(),
EBS: NewBoolFalse(),
},
},
}
Expand Down Expand Up @@ -422,6 +422,6 @@ type (
// +optional
AppMesh *bool `json:"appMesh"`
// +optional
EBSCSI *bool `json:"ebsCSI"`
EBS *bool `json:"ebs"`
}
)
4 changes: 2 additions & 2 deletions pkg/apis/eksctl.io/v1alpha4/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func validateNodeGroupIAM(i int, ng *NodeGroup, value, fieldName, path string) e
if v := ng.IAM.WithAddonPolicies.AppMesh; v != nil && *v {
return fmt.Errorf("%s.AppMesh cannot be set at the same time", p)
}
if v := ng.IAM.WithAddonPolicies.EBSCSI; v != nil && *v {
return fmt.Errorf("%s.ebsCSI cannot be set at the same time", p)
if v := ng.IAM.WithAddonPolicies.EBS; v != nil && *v {
return fmt.Errorf("%s.ebs cannot be set at the same time", p)
}
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/eksctl.io/v1alpha4/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions pkg/cfn/builder/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ var _ = Describe("CloudFormation template builder API", func() {
AutoScaler: api.NewBoolFalse(),
ExternalDNS: api.NewBoolFalse(),
AppMesh: api.NewBoolFalse(),
EBSCSI: api.NewBoolFalse(),
EBS: api.NewBoolFalse(),
},
},
},
Expand Down Expand Up @@ -560,19 +560,19 @@ var _ = Describe("CloudFormation template builder API", func() {
"appmesh:*",
}))

Expect(obj.Resources).ToNot(HaveKey("PolicyEBSCSI"))
Expect(obj.Resources).ToNot(HaveKey("PolicyEBS"))
Expect(obj.Resources).ToNot(HaveKey("PolicyAutoScaling"))
})

})

Context("NodeGroupEBSCSI", func() {
Context("NodeGroupEBS", func() {
cfg, ng := newClusterConfigAndNodegroup(true)

ng.VolumeSize = 0
ng.IAM.WithAddonPolicies.EBSCSI = api.NewBoolTrue()
ng.IAM.WithAddonPolicies.EBS = api.NewBoolTrue()

build(cfg, "eksctl-test-ebscsi-cluster", ng)
build(cfg, "eksctl-test-ebs-cluster", ng)

roundtript()

Expand All @@ -582,11 +582,11 @@ var _ = Describe("CloudFormation template builder API", func() {
Expect(obj.Resources).To(HaveKey("NodeLaunchConfig"))
Expect(obj.Resources["NodeLaunchConfig"].Properties.BlockDeviceMappings).To(HaveLen(0))

Expect(obj.Resources).To(HaveKey("PolicyEBSCSI"))
Expect(obj.Resources["PolicyEBSCSI"].Properties.PolicyDocument.Statement).To(HaveLen(1))
Expect(obj.Resources["PolicyEBSCSI"].Properties.PolicyDocument.Statement[0].Effect).To(Equal("Allow"))
Expect(obj.Resources["PolicyEBSCSI"].Properties.PolicyDocument.Statement[0].Resource).To(Equal("*"))
Expect(obj.Resources["PolicyEBSCSI"].Properties.PolicyDocument.Statement[0].Action).To(Equal([]string{
Expect(obj.Resources).To(HaveKey("PolicyEBS"))
Expect(obj.Resources["PolicyEBS"].Properties.PolicyDocument.Statement).To(HaveLen(1))
Expect(obj.Resources["PolicyEBS"].Properties.PolicyDocument.Statement[0].Effect).To(Equal("Allow"))
Expect(obj.Resources["PolicyEBS"].Properties.PolicyDocument.Statement[0].Resource).To(Equal("*"))
Expect(obj.Resources["PolicyEBS"].Properties.PolicyDocument.Statement[0].Action).To(Equal([]string{
"ec2:AttachVolume",
"ec2:CreateSnapshot",
"ec2:CreateTags",
Expand Down
4 changes: 2 additions & 2 deletions pkg/cfn/builder/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ func (n *NodeGroupResourceSet) addResourcesForIAM() {
)
}

if v := n.spec.IAM.WithAddonPolicies.EBSCSI; v != nil && *v {
n.rs.attachAllowPolicy("PolicyEBSCSI", refIR, "*",
if v := n.spec.IAM.WithAddonPolicies.EBS; v != nil && *v {
n.rs.attachAllowPolicy("PolicyEBS", refIR, "*",
[]string{
"ec2:AttachVolume",
"ec2:CreateSnapshot",
Expand Down

0 comments on commit 71da442

Please sign in to comment.