diff --git a/lke_node_pools.go b/lke_node_pools.go index fc90ed25d..d6980451f 100644 --- a/lke_node_pools.go +++ b/lke_node_pools.go @@ -75,6 +75,7 @@ type LKENodePool struct { Label *string `json:"label"` Autoscaler LKENodePoolAutoscaler `json:"autoscaler"` + FirewallID *int `json:"firewall_id,omitempty"` // NOTE: Disk encryption may not currently be available to all users. DiskEncryption InstanceDiskEncryption `json:"disk_encryption,omitempty"` @@ -96,6 +97,7 @@ type LKENodePoolCreateOptions struct { Label *string `json:"label,omitempty"` Autoscaler *LKENodePoolAutoscaler `json:"autoscaler,omitempty"` + FirewallID *int `json:"firewall_id,omitempty"` // K8sVersion and UpdateStrategy only works for LKE Enterprise to support node pool upgrades. // It may not currently be available to all users and is under v4beta. @@ -112,6 +114,7 @@ type LKENodePoolUpdateOptions struct { Label *string `json:"label,omitempty"` Autoscaler *LKENodePoolAutoscaler `json:"autoscaler,omitempty"` + FirewallID *int `json:"firewall_id,omitempty"` // K8sVersion and UpdateStrategy only works for LKE Enterprise to support node pool upgrades. // It may not currently be available to all users and is under v4beta. @@ -131,6 +134,7 @@ func (l LKENodePool) GetCreateOptions() (o LKENodePoolCreateOptions) { o.K8sVersion = l.K8sVersion o.UpdateStrategy = l.UpdateStrategy o.Label = l.Label + o.FirewallID = l.FirewallID return o } @@ -145,6 +149,7 @@ func (l LKENodePool) GetUpdateOptions() (o LKENodePoolUpdateOptions) { o.K8sVersion = l.K8sVersion o.UpdateStrategy = l.UpdateStrategy o.Label = l.Label + o.FirewallID = l.FirewallID return o } diff --git a/test/unit/fixtures/lke_e_node_pool_create.json b/test/unit/fixtures/lke_e_node_pool_create.json index f1c7c5059..73c81160d 100644 --- a/test/unit/fixtures/lke_e_node_pool_create.json +++ b/test/unit/fixtures/lke_e_node_pool_create.json @@ -13,5 +13,6 @@ "disk_encryption": "enabled", "k8s_version": "v1.31.1+lke1", "update_strategy": "on_recycle", - "label": "custom-label-create" + "label": "custom-label-create", + "firewall_id": 12345 } \ No newline at end of file diff --git a/test/unit/fixtures/lke_e_node_pool_update.json b/test/unit/fixtures/lke_e_node_pool_update.json index 4eda20b65..b56f250bf 100644 --- a/test/unit/fixtures/lke_e_node_pool_update.json +++ b/test/unit/fixtures/lke_e_node_pool_update.json @@ -13,5 +13,6 @@ "disk_encryption": "enabled", "k8s_version": "v1.31.1+lke1", "update_strategy": "rolling_update", - "label": "custom-label-update" + "label": "custom-label-update", + "firewall_id": 12345 } \ No newline at end of file diff --git a/test/unit/lke_node_pools_test.go b/test/unit/lke_node_pools_test.go index 5b8377092..c01b63670 100644 --- a/test/unit/lke_node_pools_test.go +++ b/test/unit/lke_node_pools_test.go @@ -201,6 +201,7 @@ func TestLKEEnterpriseNodePool_Create(t *testing.T) { K8sVersion: linodego.Pointer("v1.31.1+lke1"), UpdateStrategy: linodego.Pointer(linodego.LKENodePoolOnRecycle), Label: linodego.Pointer("custom-label-create"), + FirewallID: linodego.Pointer(12345), } base.MockPost("lke/clusters/123/pools", fixtureData) @@ -212,6 +213,7 @@ func TestLKEEnterpriseNodePool_Create(t *testing.T) { assert.Equal(t, "v1.31.1+lke1", *nodePool.K8sVersion) assert.Equal(t, "on_recycle", string(*nodePool.UpdateStrategy)) assert.Equal(t, linodego.Pointer("custom-label-create"), nodePool.Label) + assert.Equal(t, 12345, *nodePool.FirewallID) } func TestLKEEnterpriseNodePool_Update(t *testing.T) { @@ -226,6 +228,7 @@ func TestLKEEnterpriseNodePool_Update(t *testing.T) { K8sVersion: linodego.Pointer("v1.31.1+lke1"), UpdateStrategy: linodego.Pointer(linodego.LKENodePoolRollingUpdate), Label: linodego.Pointer("custom-label-update"), + FirewallID: linodego.Pointer(12345), } base.MockPut("lke/clusters/123/pools/12345", fixtureData) @@ -235,4 +238,5 @@ func TestLKEEnterpriseNodePool_Update(t *testing.T) { assert.Equal(t, "v1.31.1+lke1", *nodePool.K8sVersion) assert.Equal(t, "rolling_update", string(*nodePool.UpdateStrategy)) assert.Equal(t, linodego.Pointer("custom-label-update"), nodePool.Label) + assert.Equal(t, 12345, *nodePool.FirewallID) }