From 8a674464803ed3f400fa8475527ce18223f0809c Mon Sep 17 00:00:00 2001 From: vshanthe Date: Fri, 20 Dec 2024 16:39:45 +0530 Subject: [PATCH 1/6] types_unit_tests --- test/unit/fixtures/linode_type_get.json | 26 ++++++++ test/unit/fixtures/linode_types_list.json | 44 +++++++++++++ test/unit/types_test.go | 76 +++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 test/unit/fixtures/linode_type_get.json create mode 100644 test/unit/fixtures/linode_types_list.json create mode 100644 test/unit/types_test.go diff --git a/test/unit/fixtures/linode_type_get.json b/test/unit/fixtures/linode_type_get.json new file mode 100644 index 000000000..040207e0a --- /dev/null +++ b/test/unit/fixtures/linode_type_get.json @@ -0,0 +1,26 @@ +{ + "id": "g6-standard-2", + "disk": 4000, + "class": "standard", + "price": { + "hourly": 0.015, + "monthly": 10 + }, + "label": "Linode 2GB", + "addons": { + "backups": { + "price": { + "hourly": 0.003, + "monthly": 2 + }, + "region_prices": [] + } + }, + "region_prices": [], + "network_out": 2000, + "memory": 4000, + "transfer": 500, + "vcpus": 2, + "gpus": 0, + "successor": null +} diff --git a/test/unit/fixtures/linode_types_list.json b/test/unit/fixtures/linode_types_list.json new file mode 100644 index 000000000..67eec4707 --- /dev/null +++ b/test/unit/fixtures/linode_types_list.json @@ -0,0 +1,44 @@ +{ + "data": [ + { + "id": "g6-nanode-1", + "disk": 25600, + "class": "nanode", + "price": { + "hourly": 0.0075, + "monthly": 5 + }, + "label": "Nanode 1GB", + "addons": null, + "region_prices": [], + "network_out": 1000, + "memory": 1024, + "transfer": 250, + "vcpus": 1, + "gpus": 0, + "successor": null + }, + { + "id": "g6-standard-2", + "disk": 51200, + "class": "standard", + "price": { + "hourly": 0.015, + "monthly": 10 + }, + "label": "Linode 2GB", + "addons": null, + "region_prices": [], + "network_out": 2000, + "memory": 2048, + "transfer": 500, + "vcpus": 2, + "gpus": 0, + "successor": null + } + ], + "page": 1, + "pages": 1, + "results": 2 + } + \ No newline at end of file diff --git a/test/unit/types_test.go b/test/unit/types_test.go new file mode 100644 index 000000000..837f122bd --- /dev/null +++ b/test/unit/types_test.go @@ -0,0 +1,76 @@ +package unit + +import ( + "context" + "fmt" + "github.com/linode/linodego" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestLinodeTypes_List(t *testing.T) { + // Load the fixture data for types + fixtureData, err := fixtures.GetFixture("linode_types_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("linode/types", fixtureData) + + types, err := base.Client.ListTypes(context.Background(), &linodego.ListOptions{}) + assert.NoError(t, err) + + // Verify a specific type exists in the list + var nanodeType *linodego.LinodeType + for _, t := range types { + if t.ID == "g6-nanode-1" { + nanodeType = &t + break + } + } + + if nanodeType == nil { + t.Errorf("Expected type 'g6-nanode-1' to be in the response, but it was not found") + } else { + assert.Equal(t, "nanode", string(nanodeType.Class), "Expected class to be 'nanode'") + assert.Equal(t, 1, nanodeType.VCPUs, "Expected VCPUs for 'g6-nanode-1' to be 1") + assert.Equal(t, 250, nanodeType.Transfer, "Expected transfer for 'g6-nanode-1' to be 250GB") + assert.NotNil(t, nanodeType.Price, "Expected 'g6-nanode-1' to have a price object") + if nanodeType.Price != nil { + assert.Equal(t, float32(5), nanodeType.Price.Monthly, "Expected monthly price for 'g6-nanode-1' to be $5") + } + } +} + +func TestLinodeType_Get(t *testing.T) { + // Load the fixture data for a specific type + fixtureData, err := fixtures.GetFixture("linode_type_get") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + typeID := "g6-standard-2" + base.MockGet(fmt.Sprintf("linode/types/%s", typeID), fixtureData) + + typeObj, err := base.Client.GetType(context.Background(), typeID) + assert.NoError(t, err) + + assert.Equal(t, typeID, typeObj.ID, "Expected type ID to match") + assert.Equal(t, "standard", string(typeObj.Class), "Expected class to be 'standard'") + assert.Equal(t, 2, typeObj.VCPUs, "Expected VCPUs to be 2") + assert.Equal(t, 4000, typeObj.Disk, "Expected disk to be 4000MB") + assert.Equal(t, 4000, typeObj.Memory, "Expected memory to be 4000MB") + assert.NotNil(t, typeObj.Price, "Expected type to have a price object") + if typeObj.Price != nil { + assert.Equal(t, float32(10), typeObj.Price.Monthly, "Expected monthly price to be $10") + } + + assert.NotNil(t, typeObj.Addons, "Expected type to have addons") + if typeObj.Addons != nil && typeObj.Addons.Backups != nil { + assert.NotNil(t, typeObj.Addons.Backups.Price, "Expected backups to have a price object") + } +} From 85c7bc3a7a066725340c7820db63d17306915b74 Mon Sep 17 00:00:00 2001 From: vshanthe Date: Fri, 27 Dec 2024 11:02:22 +0530 Subject: [PATCH 2/6] vlan_tests --- test/unit/fixtures/vlan_get_ipam_address.json | 15 +++++ test/unit/fixtures/vlans_list.json | 13 ++++ test/unit/vlan_test.go | 65 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 test/unit/fixtures/vlan_get_ipam_address.json create mode 100644 test/unit/fixtures/vlans_list.json create mode 100644 test/unit/vlan_test.go diff --git a/test/unit/fixtures/vlan_get_ipam_address.json b/test/unit/fixtures/vlan_get_ipam_address.json new file mode 100644 index 000000000..d294d9f8f --- /dev/null +++ b/test/unit/fixtures/vlan_get_ipam_address.json @@ -0,0 +1,15 @@ +{ + "data": [ + { + "interfaces": [ + { + "label": "test-vlan", + "ipam_address": "10.0.0.1/24" + } + ] + } + ], + "page": 1, + "pages": 1, + "results": 1 +} diff --git a/test/unit/fixtures/vlans_list.json b/test/unit/fixtures/vlans_list.json new file mode 100644 index 000000000..5572e8074 --- /dev/null +++ b/test/unit/fixtures/vlans_list.json @@ -0,0 +1,13 @@ +{ + "data": [ + { + "label": "test-vlan", + "linodes": [12345], + "region": "us-east", + "created": "2024-12-01T12:00:00" + } + ], + "page": 1, + "pages": 1, + "results": 1 +} diff --git a/test/unit/vlan_test.go b/test/unit/vlan_test.go new file mode 100644 index 000000000..f8aca13a5 --- /dev/null +++ b/test/unit/vlan_test.go @@ -0,0 +1,65 @@ +package unit + +import ( + "context" + "fmt" + "github.com/linode/linodego" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestVLAN_List(t *testing.T) { + // Load the fixture data for VLANs + fixtureData, err := fixtures.GetFixture("vlans_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + // Mock the GET request + base.MockGet("networking/vlans", fixtureData) + + vlans, err := base.Client.ListVLANs(context.Background(), &linodego.ListOptions{}) + assert.NoError(t, err) + assert.NotEmpty(t, vlans, "Expected non-empty VLAN list") + + // Verify a specific VLAN exists in the list + var testVLAN *linodego.VLAN + for _, v := range vlans { + if v.Label == "test-vlan" { + testVLAN = &v + break + } + } + + if testVLAN == nil { + t.Errorf("Expected VLAN 'test-vlan' to be in the response, but it was not found") + } else { + assert.Equal(t, "us-east", testVLAN.Region, "Expected region to be 'us-east'") + assert.Contains(t, testVLAN.Linodes, 12345, "Expected Linodes to include 12345") + assert.NotNil(t, testVLAN.Created, "Expected 'test-vlan' to have a created timestamp") + } +} + +func TestVLAN_GetIPAMAddress(t *testing.T) { + // Load the fixture data for VLAN IPAM address + fixtureData, err := fixtures.GetFixture("vlan_get_ipam_address") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + linodeID := 12345 + vlanLabel := "test-vlan" + // Mock the GET request + base.MockGet(fmt.Sprintf("linode/instances/%d/configs", linodeID), fixtureData) + + ipamAddress, err := base.Client.GetVLANIPAMAddress(context.Background(), linodeID, vlanLabel) + assert.NoError(t, err) + assert.NotEmpty(t, ipamAddress, "Expected non-empty IPAM address") + + // Verify the returned IPAM address + assert.Equal(t, "10.0.0.1/24", ipamAddress, "Expected IPAM address to be '10.0.0.1/24'") +} From cda5f7adfbfdfacb95ced19cddf1ef320d718ff3 Mon Sep 17 00:00:00 2001 From: vshanthe Date: Mon, 30 Dec 2024 11:05:47 +0530 Subject: [PATCH 3/6] unit_test_tag --- test/unit/fixtures/tag_create.json | 3 + test/unit/fixtures/tagged_objects_list.json | 15 +++ test/unit/fixtures/tags_list.json | 10 ++ test/unit/tag_test.go | 104 ++++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 test/unit/fixtures/tag_create.json create mode 100644 test/unit/fixtures/tagged_objects_list.json create mode 100644 test/unit/fixtures/tags_list.json create mode 100644 test/unit/tag_test.go diff --git a/test/unit/fixtures/tag_create.json b/test/unit/fixtures/tag_create.json new file mode 100644 index 000000000..fa35f0e97 --- /dev/null +++ b/test/unit/fixtures/tag_create.json @@ -0,0 +1,3 @@ +{ + "label": "new-tag" +} diff --git a/test/unit/fixtures/tagged_objects_list.json b/test/unit/fixtures/tagged_objects_list.json new file mode 100644 index 000000000..5a1abd60a --- /dev/null +++ b/test/unit/fixtures/tagged_objects_list.json @@ -0,0 +1,15 @@ +{ + "data": [ + { + "type": "linode", + "data": { + "id": 12345, + "label": "example-instance", + "region": "us-east" + } + } + ], + "page": 1, + "pages": 1, + "results": 1 + } \ No newline at end of file diff --git a/test/unit/fixtures/tags_list.json b/test/unit/fixtures/tags_list.json new file mode 100644 index 000000000..3d7318819 --- /dev/null +++ b/test/unit/fixtures/tags_list.json @@ -0,0 +1,10 @@ +{ + "data": [ + { + "label": "example-tag" + } + ], + "page": 1, + "pages": 1, + "results": 1 + } \ No newline at end of file diff --git a/test/unit/tag_test.go b/test/unit/tag_test.go new file mode 100644 index 000000000..3926d5d5c --- /dev/null +++ b/test/unit/tag_test.go @@ -0,0 +1,104 @@ +package unit + +import ( + "context" + "fmt" + "testing" + + "github.com/linode/linodego" + "github.com/stretchr/testify/assert" +) + +func TestListTags(t *testing.T) { + // Load the fixture data for tags + fixtureData, err := fixtures.GetFixture("tags_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("tags", fixtureData) + + tags, err := base.Client.ListTags(context.Background(), &linodego.ListOptions{}) + assert.NoError(t, err) + + assert.NotEmpty(t, tags, "Expected non-empty tag list") + assert.Equal(t, "example-tag", tags[0].Label, "Expected tag label to be 'example-tag'") +} + +func TestCreateTag(t *testing.T) { + // Load the fixture data for tag creation + fixtureData, err := fixtures.GetFixture("tag_create") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockPost("tags", fixtureData) + + opts := linodego.TagCreateOptions{ + Label: "new-tag", + } + + tag, err := base.Client.CreateTag(context.Background(), opts) + assert.NoError(t, err, "Expected no error when creating tag") + + // Verify the created tag's label + assert.Equal(t, "new-tag", tag.Label, "Expected created tag label to match input") +} + + +func TestDeleteTag(t *testing.T) { + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + tagLabel := "delete-tag" + base.MockDelete(fmt.Sprintf("tags/%s", tagLabel), nil) + + err := base.Client.DeleteTag(context.Background(), tagLabel) + assert.NoError(t, err, "Expected no error when deleting tag") +} + +func TestListTaggedObjects(t *testing.T) { + // Load the fixture data for tagged objects + fixtureData, err := fixtures.GetFixture("tagged_objects_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + tagLabel := "example-tag" + base.MockGet(fmt.Sprintf("tags/%s", tagLabel), fixtureData) + + taggedObjects, err := base.Client.ListTaggedObjects(context.Background(), tagLabel, &linodego.ListOptions{}) + assert.NoError(t, err) + + assert.NotEmpty(t, taggedObjects, "Expected non-empty tagged objects list") + assert.Equal(t, "linode", taggedObjects[0].Type, "Expected tagged object type to be 'linode'") +} + +func TestSortedObjects(t *testing.T) { + // Load the fixture data for tagged objects + fixtureData, err := fixtures.GetFixture("tagged_objects_list") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + tagLabel := "example-tag" + base.MockGet(fmt.Sprintf("tags/%s", tagLabel), fixtureData) + + taggedObjects, err := base.Client.ListTaggedObjects(context.Background(), tagLabel, &linodego.ListOptions{}) + assert.NoError(t, err) + + sortedObjects, err := taggedObjects.SortedObjects() + assert.NoError(t, err) + + assert.NotEmpty(t, sortedObjects.Instances, "Expected non-empty instances list in sorted objects") + assert.Equal(t, "example-instance", sortedObjects.Instances[0].Label, "Expected instance label to be 'example-instance'") +} From 5d8309a9b9a2fc05b14243e990a527bd5a0c7ed0 Mon Sep 17 00:00:00 2001 From: vshanthe Date: Mon, 30 Dec 2024 11:35:25 +0530 Subject: [PATCH 4/6] address_PR_comments --- test/unit/tag_test.go | 22 ++++++++++++++++++++-- test/unit/types_test.go | 17 ++++++++--------- test/unit/vlan_test.go | 16 +++++++--------- 3 files changed, 35 insertions(+), 20 deletions(-) diff --git a/test/unit/tag_test.go b/test/unit/tag_test.go index 3926d5d5c..3cfaef762 100644 --- a/test/unit/tag_test.go +++ b/test/unit/tag_test.go @@ -7,6 +7,7 @@ import ( "github.com/linode/linodego" "github.com/stretchr/testify/assert" + "golang.org/x/exp/slices" ) func TestListTags(t *testing.T) { @@ -24,9 +25,16 @@ func TestListTags(t *testing.T) { assert.NoError(t, err) assert.NotEmpty(t, tags, "Expected non-empty tag list") - assert.Equal(t, "example-tag", tags[0].Label, "Expected tag label to be 'example-tag'") + + // Check if a specific tag exists using slices.ContainsFunc + exists := slices.ContainsFunc(tags, func(tag linodego.Tag) bool { + return tag.Label == "example-tag" + }) + + assert.True(t, exists, "Expected tag list to contain 'example-tag'") } + func TestCreateTag(t *testing.T) { // Load the fixture data for tag creation fixtureData, err := fixtures.GetFixture("tag_create") @@ -78,9 +86,19 @@ func TestListTaggedObjects(t *testing.T) { assert.NoError(t, err) assert.NotEmpty(t, taggedObjects, "Expected non-empty tagged objects list") - assert.Equal(t, "linode", taggedObjects[0].Type, "Expected tagged object type to be 'linode'") + + // Find the specific tagged object using slices.IndexFunc + index := slices.IndexFunc(taggedObjects, func(obj linodego.TaggedObject) bool { + return obj.Type == "linode" + }) + + assert.NotEqual(t, -1, index, "Expected to find a tagged object of type 'linode'") + if index != -1 { + assert.Equal(t, "linode", taggedObjects[index].Type, "Expected tagged object type to be 'linode'") + } } + func TestSortedObjects(t *testing.T) { // Load the fixture data for tagged objects fixtureData, err := fixtures.GetFixture("tagged_objects_list") diff --git a/test/unit/types_test.go b/test/unit/types_test.go index 837f122bd..25e1623cf 100644 --- a/test/unit/types_test.go +++ b/test/unit/types_test.go @@ -6,6 +6,8 @@ import ( "github.com/linode/linodego" "github.com/stretchr/testify/assert" "testing" + "golang.org/x/exp/slices" + ) func TestLinodeTypes_List(t *testing.T) { @@ -22,18 +24,15 @@ func TestLinodeTypes_List(t *testing.T) { types, err := base.Client.ListTypes(context.Background(), &linodego.ListOptions{}) assert.NoError(t, err) - // Verify a specific type exists in the list - var nanodeType *linodego.LinodeType - for _, t := range types { - if t.ID == "g6-nanode-1" { - nanodeType = &t - break - } - } + // Use slices.IndexFunc to find the index of the specific type + index := slices.IndexFunc(types, func(t linodego.LinodeType) bool { + return t.ID == "g6-nanode-1" + }) - if nanodeType == nil { + if index == -1 { t.Errorf("Expected type 'g6-nanode-1' to be in the response, but it was not found") } else { + nanodeType := types[index] assert.Equal(t, "nanode", string(nanodeType.Class), "Expected class to be 'nanode'") assert.Equal(t, 1, nanodeType.VCPUs, "Expected VCPUs for 'g6-nanode-1' to be 1") assert.Equal(t, 250, nanodeType.Transfer, "Expected transfer for 'g6-nanode-1' to be 250GB") diff --git a/test/unit/vlan_test.go b/test/unit/vlan_test.go index f8aca13a5..8fcfd680e 100644 --- a/test/unit/vlan_test.go +++ b/test/unit/vlan_test.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/linode/linodego" "github.com/stretchr/testify/assert" + "golang.org/x/exp/slices" "testing" ) @@ -24,18 +25,15 @@ func TestVLAN_List(t *testing.T) { assert.NoError(t, err) assert.NotEmpty(t, vlans, "Expected non-empty VLAN list") - // Verify a specific VLAN exists in the list - var testVLAN *linodego.VLAN - for _, v := range vlans { - if v.Label == "test-vlan" { - testVLAN = &v - break - } - } + // Use slices.IndexFunc to find the index of the specific VLAN + index := slices.IndexFunc(vlans, func(v linodego.VLAN) bool { + return v.Label == "test-vlan" + }) - if testVLAN == nil { + if index == -1 { t.Errorf("Expected VLAN 'test-vlan' to be in the response, but it was not found") } else { + testVLAN := vlans[index] assert.Equal(t, "us-east", testVLAN.Region, "Expected region to be 'us-east'") assert.Contains(t, testVLAN.Linodes, 12345, "Expected Linodes to include 12345") assert.NotNil(t, testVLAN.Created, "Expected 'test-vlan' to have a created timestamp") From 836d77f885fee1cd47fb251be3f937a629b781f1 Mon Sep 17 00:00:00 2001 From: vshanthe Date: Mon, 30 Dec 2024 11:42:50 +0530 Subject: [PATCH 5/6] fix --- k8s/go.mod | 8 +++++--- k8s/go.sum | 8 ++++---- test/go.mod | 9 ++++++--- test/go.sum | 14 ++++++++------ 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/k8s/go.mod b/k8s/go.mod index 6ab7d0a9d..78158bc05 100644 --- a/k8s/go.mod +++ b/k8s/go.mod @@ -29,7 +29,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/net v0.32.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.24.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect @@ -37,7 +37,7 @@ require ( golang.org/x/time v0.6.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.110.1 // indirect @@ -50,4 +50,6 @@ require ( replace github.com/linode/linodego => ../ -go 1.22 +go 1.22.0 + +toolchain go1.22.1 diff --git a/k8s/go.sum b/k8s/go.sum index 263f83616..5a9ced316 100644 --- a/k8s/go.sum +++ b/k8s/go.sum @@ -91,8 +91,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -128,8 +128,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/test/go.mod b/test/go.mod index 9eef9a96c..6a1a373a5 100644 --- a/test/go.mod +++ b/test/go.mod @@ -7,7 +7,8 @@ require ( github.com/linode/linodego v1.33.0 github.com/linode/linodego/k8s v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.10.0 - golang.org/x/net v0.32.0 + golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 + golang.org/x/net v0.33.0 golang.org/x/oauth2 v0.24.0 k8s.io/client-go v0.29.4 ) @@ -42,7 +43,7 @@ require ( golang.org/x/time v0.6.0 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/api v0.29.4 // indirect @@ -55,7 +56,9 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -go 1.22 +go 1.22.0 + +toolchain go1.22.1 replace github.com/linode/linodego => ../ diff --git a/test/go.sum b/test/go.sum index b730d1c6f..3f2af3f0f 100644 --- a/test/go.sum +++ b/test/go.sum @@ -92,14 +92,16 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo= +golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -122,8 +124,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -135,8 +137,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= From 0b509566170b334d9ebf89ee42886ceef271fab4 Mon Sep 17 00:00:00 2001 From: vshanthe Date: Thu, 9 Jan 2025 10:43:50 +0530 Subject: [PATCH 6/6] fix lint --- go.work.sum | 4 ++-- test/go.mod | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/go.work.sum b/go.work.sum index 2f19f081f..5cc18d7e6 100644 --- a/go.work.sum +++ b/go.work.sum @@ -51,6 +51,8 @@ golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ug golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= @@ -60,11 +62,9 @@ golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= diff --git a/test/go.mod b/test/go.mod index 058375f32..e63ae22d0 100644 --- a/test/go.mod +++ b/test/go.mod @@ -8,8 +8,6 @@ require ( github.com/linode/linodego/k8s v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.10.0 golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 - golang.org/x/net v0.33.0 - golang.org/x/oauth2 v0.24.0 golang.org/x/net v0.34.0 golang.org/x/oauth2 v0.25.0 k8s.io/client-go v0.29.4