Skip to content

Commit

Permalink
Fix kubernetes bindings integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Schäfer authored and anx-mschaefer committed Nov 10, 2023
1 parent c0cb848 commit dd82846
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pkg/apis/kubernetes/v1/crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ var _ = Describe("CRUD", Ordered, func() {
"cluster": clusterIdentifier,
"replicas": 1,
"memory": 2 * 1073741824,
"disk_size": 10 * 1073741824,
"disk_size": 20 * 1073741824,
},
mockedNodePoolResponse(NodePool{
Identifier: "mocked-cluster-identifier",
Expand All @@ -183,7 +183,7 @@ var _ = Describe("CRUD", Ordered, func() {
Cluster: Cluster{Identifier: clusterIdentifier},
Replicas: pointer.Int(1),
Memory: 2 * 1073741824, // 2 GiB
DiskSize: 10 * 1073741824, // 10 GiB
DiskSize: 20 * 1073741824, // 20 GiB
}

err := a.Create(context.TODO(), &nodePool)
Expand Down Expand Up @@ -226,7 +226,7 @@ var _ = Describe("CRUD", Ordered, func() {
Expect(err).ToNot(HaveOccurred())
Expect(nodePool.Name).To(Equal(nodePoolName))
Expect(nodePool.Memory).To(Equal(2 * 1073741824))
Expect(nodePool.DiskSize).To(Equal(10 * 1073741824))
Expect(nodePool.DiskSize).To(Equal(20 * 1073741824))
})

It("returns api.ErrNotFound if node pool does not exist", func() {
Expand Down Expand Up @@ -384,7 +384,7 @@ func mockedNodePoolResponse(nodePool NodePool) map[string]interface{} {
"replicas": 1,
"cpus": 2,
"memory": 2147483648,
"disk_size": 10737418240,
"disk_size": 21474836480,
"operating_system": "Flatcar Linux",
}
}
4 changes: 2 additions & 2 deletions pkg/apis/kubernetes/v1/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func Example() {
log.Fatalf("failed to await cluster creation: %s", err)
}

// define node pool with a single replica, 2 GiB of system memory and 10 GiB of disk space
nodePool := NodePool{Name: "example-np-00", Cluster: cluster, Replicas: pointer.Int(1), Memory: 2 * 1073741824, DiskSize: 10 * 1073741824}
// define node pool with a single replica, 2 GiB of system memory and 20 GiB of disk space
nodePool := NodePool{Name: "example-np-00", Cluster: cluster, Replicas: pointer.Int(1), Memory: 2 * 1073741824, DiskSize: 20 * 1073741824}

if err := a.Create(context.TODO(), &nodePool); err != nil {
log.Fatalf("failed to create nodepool: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/kubernetes/v1/node_pool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type NodePool struct {
// RAM size for each node in bytes. Must be a multiple of 1 GiB, at least 2 GiB and no more than 64 GiB
Memory int `json:"memory,omitempty"`
// Size of the disk for each node in bytes. Its performance type will be the default Anexia Engine provides for the given location.
// Must be a multiple of 1 GiB, at least 10 GiB and no more than 1600 GiB
// Must be a multiple of 1 GiB, at least 20 GiB and no more than 1600 GiB
DiskSize int `json:"disk_size,omitempty"`

// Operating system for deployment on the nodes. Default: Flatcar Linux
Expand Down

0 comments on commit dd82846

Please sign in to comment.