Skip to content

Commit

Permalink
feat(deps,iam,mks,dbaas): bump Go 1.22.7 -> 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
sel-bukharov committed Nov 26, 2024
1 parent 3b1565e commit c78131e
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 58 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- master
schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"

jobs:
acceptance-test:
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: "1.23"

- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
Expand All @@ -30,5 +30,5 @@ jobs:
run: make testacc
env:
OS_DOMAIN_NAME: ${{ secrets.OS_DOMAIN_NAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

jobs:
goreleaser:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: "1.23"

- name: Import GPG key
id: import_gpg
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: "1.23"
- run: make test

golangci-lint:
Expand All @@ -22,17 +22,17 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: "1.23"
- uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
version: v1.62.0

tidy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
go-version: "1.23"
- run: go mod tidy -v
- run: git diff --exit-code
47 changes: 20 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
Terraform Selectel Provider
=========================
# Terraform Selectel Provider

- Website: https://www.terraform.io
- [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)
* Website: <https://www.terraform.io>
* [![Gitter chat](https://badges.gitter.im/hashicorp-terraform/Lobby.png)](https://gitter.im/hashicorp-terraform/Lobby)
* Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)

<img alt="Terraform Selectel Provider" src="https://selectel.ru/blog/wp-content/uploads/2019/03/[email protected]" width="600px">

Maintainers
-----------
## Maintainers

This provider plugin is maintained by:

Expand All @@ -17,63 +15,58 @@ This provider plugin is maintained by:
* Ilya Kulakov ([@TawR1024](https://github.com/TawR1024))
* Tatyana Voloshina ([@T-Sh](https://github.com/T-Sh))

Requirements
------------
## Requirements

- [Terraform](https://www.terraform.io/downloads.html) 0.12.x
- [Go](https://golang.org/doc/install) 1.22 (to build the provider plugin)
* [Terraform](https://www.terraform.io/downloads.html) 0.12.x
* [Go](https://golang.org/doc/install) 1.23 (to build the provider plugin)

Building The Provider
---------------------
## Building The Provider

Clone the repository

```sh
$ git clone [email protected]:selectel/terraform-provider-selectel.git
git clone [email protected]:selectel/terraform-provider-selectel.git
```

Enter the provider directory and build the provider

```sh
$ cd terraform-provider-selectel
$ make build
cd terraform-provider-selectel
make build
```

Using the provider
----------------------
## Using the provider

Getting Started with Terraform at Selectel: [kb.selectel.com](https://kb.selectel.com/docs/selectel-cloud-platform/main-services/instructions/how_to_use_terraform/).
Documentation is available at: [docs/providers/selectel](https://www.terraform.io/docs/providers/selectel/index.html).
You can find examples in this repository: [examples](https://github.com/terraform-providers/terraform-provider-selectel/tree/master/examples).
Also there are lots of examples in the [selectel/terraform-examples](https://github.com/selectel/terraform-examples).

Developing the Provider
---------------------------
## Developing the Provider

If you wish to work on the provider, you'll first need [Go](https://golang.org) installed on your machine (version 1.17+ is *required*).
If you wish to work on the provider, you'll first need [Go](https://golang.org) installed on your machine (version 1.17+ is _required_).

To compile the provider, run `make build`. This will build the provider and put the provider binary in the current directory.

```sh
$ make build
make build
```

In order to test the provider, you can simply run `make test`.

```sh
$ make test
make test
```

In order to run the full suite of Acceptance tests, run `make testacc`.

*Note:* Acceptance tests create real resources, and often cost money to run.
_Note:_ Acceptance tests create real resources, and often cost money to run.

```sh
$ make testacc
make testacc
```

Releasing the Provider
----------------------
## Releasing the Provider

This repository contains a GitHub Action configured to automatically build and
publish assets for release when a tag is pushed that matches the pattern `v*`
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/terraform-providers/terraform-provider-selectel

go 1.22.7
go 1.23

require (
github.com/hashicorp/go-retryablehttp v0.7.7
Expand Down
1 change: 0 additions & 1 deletion selectel/import_selectel_iam_user_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

func TestAccIAMV1UserImportBasic(t *testing.T) {
resourceName := "selectel_iam_user_v1.user_tf_acc_test_1"
//nolint:goconst
userEmail := acctest.RandomWithPrefix("tf-acc") + "@example.com"

resource.Test(t, resource.TestCase{
Expand Down
26 changes: 13 additions & 13 deletions selectel/mks.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ func mksClusterV1StateRefreshFunc(
}
}

func mksClusterV1KubeVersionDiffSuppressFunc(_, old, new string, d *schema.ResourceData) bool {
func mksClusterV1KubeVersionDiffSuppressFunc(_, oldVersion, newVersion string, d *schema.ResourceData) bool {
if d.Id() == "" {
return false
}

currentMajor, err := kubeVersionToMajor(old)
currentMajor, err := kubeVersionToMajor(oldVersion)
if err != nil {
log.Printf("[DEBUG] error getting a major part of the current kube version %s: %s", old, err)
log.Printf("[DEBUG] error getting a major part of the current kube version %s: %s", oldVersion, err)

return false
}
desiredMajor, err := kubeVersionToMajor(new)
desiredMajor, err := kubeVersionToMajor(newVersion)
if err != nil {
log.Printf("[DEBUG] error getting a major part of the desired kube version %s: %s", new, err)
log.Printf("[DEBUG] error getting a major part of the desired kube version %s: %s", newVersion, err)

return false
}
Expand All @@ -96,15 +96,15 @@ func mksClusterV1KubeVersionDiffSuppressFunc(_, old, new string, d *schema.Resou
return true
}

currentMinor, err := kubeVersionToMinor(old)
currentMinor, err := kubeVersionToMinor(oldVersion)
if err != nil {
log.Printf("[DEBUG] error getting a minor part of the current kube version %s: %s", old, err)
log.Printf("[DEBUG] error getting a minor part of the current kube version %s: %s", oldVersion, err)

return false
}
desiredMinor, err := kubeVersionToMinor(new)
desiredMinor, err := kubeVersionToMinor(newVersion)
if err != nil {
log.Printf("[DEBUG] error getting a minor part of the desired kube version %s: %s", new, err)
log.Printf("[DEBUG] error getting a minor part of the desired kube version %s: %s", newVersion, err)

return false
}
Expand All @@ -119,15 +119,15 @@ func mksClusterV1KubeVersionDiffSuppressFunc(_, old, new string, d *schema.Resou
return true
}

currentPatch, err := kubeVersionToPatch(old)
currentPatch, err := kubeVersionToPatch(oldVersion)
if err != nil {
log.Printf("[DEBUG] error getting a patch part of the current kube version %s: %s", old, err)
log.Printf("[DEBUG] error getting a patch part of the current kube version %s: %s", oldVersion, err)

return false
}
desiredPatch, err := kubeVersionToPatch(new)
desiredPatch, err := kubeVersionToPatch(newVersion)
if err != nil {
log.Printf("[DEBUG] error getting a patch part of the desired kube version %s: %s", new, err)
log.Printf("[DEBUG] error getting a patch part of the desired kube version %s: %s", newVersion, err)

return true
}
Expand Down
4 changes: 2 additions & 2 deletions selectel/resource_selectel_dbaas_kafka_topic_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func resourceDBaaSTopicV1Create(ctx context.Context, d *schema.ResourceData, met
topicCreateOpts := dbaas.TopicCreateOpts{
DatastoreID: d.Get("datastore_id").(string),
Name: d.Get("name").(string),
Partitions: uint16(d.Get("partitions").(int)),
Partitions: uint16(d.Get("partitions").(int)), //nolint:gosec
}

log.Print(msgCreate(objectTopic, topicCreateOpts))
Expand Down Expand Up @@ -90,7 +90,7 @@ func resourceDBaaSTopicV1Update(ctx context.Context, d *schema.ResourceData, met
}

if d.HasChange("partitions") {
partitions := uint16(d.Get("partitions").(int))
partitions := uint16(d.Get("partitions").(int)) //nolint:gosec
updateOpts := dbaas.TopicUpdateOpts{
Partitions: partitions,
}
Expand Down
8 changes: 4 additions & 4 deletions selectel/resource_selectel_mks_nodegroup_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ func resourceMKSNodegroupV1() *schema.Resource {
},
CustomizeDiff: customdiff.All(
// We need to recreate nodegroup if flavor changed.
customdiff.ForceNewIfChange("flavor_id", func(_ context.Context, old, new, _ interface{}) bool {
return old.(string) != new.(string)
customdiff.ForceNewIfChange("flavor_id", func(_ context.Context, oldVersion, newVersion, _ interface{}) bool {
return oldVersion.(string) != newVersion.(string)
}),
customdiff.ForceNewIfChange("local_volume", func(_ context.Context, old, new, _ interface{}) bool {
return old.(bool) != new.(bool)
customdiff.ForceNewIfChange("local_volume", func(_ context.Context, oldVersion, newVersion, _ interface{}) bool {
return oldVersion.(bool) != newVersion.(bool)
}),
),
}
Expand Down

0 comments on commit c78131e

Please sign in to comment.