diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code-quality.yml similarity index 94% rename from .github/workflows/code_quality.yml rename to .github/workflows/code-quality.yml index 188c0cdc..afa5d3cf 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code-quality.yml @@ -14,7 +14,7 @@ jobs: pull-requests: write checks: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit fetch-depth: 0 # a full history is required for pull request analysis diff --git a/README.md b/README.md index 61bb180c..3885bddc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This repository is a fork of 0)...) + diags = append(diags, disk.Read(ctx, d, allDiskInfo, vmID, client, nodeName, len(clone) > 0)...) if vmConfig.EFIDisk != nil { efiDisk := map[string]interface{}{} @@ -3742,7 +3742,7 @@ func vmReadCustom( } else { // disk format may not be returned by config API if it is default for the storage, and that may be different // from the default qcow2, so we need to read it from the storage API to make sure we have the correct value - volume, err := api.Node(nodeName).Storage(fileIDParts[0]).GetDatastoreFile(ctx, vmConfig.EFIDisk.FileVolume) + volume, err := client.Node(nodeName).Storage(fileIDParts[0]).GetDatastoreFile(ctx, vmConfig.EFIDisk.FileVolume) if err != nil { diags = append(diags, diag.FromErr(e)...) } else { @@ -4467,7 +4467,7 @@ func vmReadCustom( } } - vmAPI := api.Node(nodeName).VM(vmID) + vmAPI := client.Node(nodeName).VM(vmID) started := d.Get(mkStarted).(bool) agentTimeout, e := getAgentTimeout(d) @@ -4713,7 +4713,7 @@ func vmUpdatePool( func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { config := m.(proxmoxtf.ProviderConfiguration) - api, e := config.GetClient() + client, e := config.GetClient() if e != nil { return diag.FromErr(e) } @@ -4726,7 +4726,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D return diag.FromErr(e) } - e = vmUpdatePool(ctx, d, api.Pool(), vmID) + e = vmUpdatePool(ctx, d, client.Pool(), vmID) if e != nil { return diag.FromErr(e) } @@ -4740,7 +4740,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D oldNodeNameValue, _ := d.GetChange(mkNodeName) oldNodeName := oldNodeNameValue.(string) - vmAPI := api.Node(oldNodeName).VM(vmID) + vmAPI := client.Node(oldNodeName).VM(vmID) trueValue := types.CustomBool(true) migrateBody := &vms.MigrateRequestBody{ @@ -4755,7 +4755,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D } } - vmAPI := api.Node(nodeName).VM(vmID) + vmAPI := client.Node(nodeName).VM(vmID) updateBody := &vms.UpdateRequestBody{ IDEDevices: vms.CustomStorageDevices{ @@ -4994,7 +4994,7 @@ func vmUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.D cpuAffinity := cpuBlock[mkCPUAffinity].(string) // Only the root account is allowed to change the CPU architecture, which makes this check necessary. - if api.API().IsRootTicket() || + if client.API().IsRootTicket() || cpuArchitecture != dvCPUArchitecture { updateBody.CPUArchitecture = &cpuArchitecture } @@ -5359,7 +5359,7 @@ func vmUpdateDiskLocationAndSize( ) diag.Diagnostics { config := m.(proxmoxtf.ProviderConfiguration) - api, err := config.GetClient() + client, err := config.GetClient() if err != nil { return diag.FromErr(err) } @@ -5373,7 +5373,7 @@ func vmUpdateDiskLocationAndSize( return diag.FromErr(err) } - vmAPI := api.Node(nodeName).VM(vmID) + vmAPI := client.Node(nodeName).VM(vmID) // Determine if any of the disks are changing location and/or size, and initiate the necessary actions. //nolint: nestif diff --git a/qodana.yaml b/qodana.yaml new file mode 100644 index 00000000..88af6d93 --- /dev/null +++ b/qodana.yaml @@ -0,0 +1,9 @@ +version: "1.0" +linter: jetbrains/qodana-go:2023.3 +include: + - name: CheckDependencyLicenses +exclude: + - name: All + paths: + - CONTRIBUTORS.md + - README.md