fix(deps): update stackit sdk modules (#373)
* fix(deps): update stackit sdk modules * Fix lint --------- Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: vicentepinto98 <vicente.pinto@freiheit.com>
This commit is contained in:
parent
29bf7cbb31
commit
ba7bf10db7
4 changed files with 25 additions and 25 deletions
|
|
@ -364,7 +364,7 @@ func (r *instanceResource) ImportState(ctx context.Context, req resource.ImportS
|
|||
tflog.Info(ctx, "Secrets Manager instance state imported")
|
||||
}
|
||||
|
||||
func mapFields(instance *secretsmanager.Instance, aclList *secretsmanager.AclList, model *Model) error {
|
||||
func mapFields(instance *secretsmanager.Instance, aclList *secretsmanager.ListACLsResponse, model *Model) error {
|
||||
if instance == nil {
|
||||
return fmt.Errorf("response input is nil")
|
||||
}
|
||||
|
|
@ -399,7 +399,7 @@ func mapFields(instance *secretsmanager.Instance, aclList *secretsmanager.AclLis
|
|||
return nil
|
||||
}
|
||||
|
||||
func mapACLs(aclList *secretsmanager.AclList, model *Model) error {
|
||||
func mapACLs(aclList *secretsmanager.ListACLsResponse, model *Model) error {
|
||||
if aclList == nil {
|
||||
return fmt.Errorf("nil ACL list")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,16 +20,16 @@ import (
|
|||
|
||||
func TestMapFields(t *testing.T) {
|
||||
tests := []struct {
|
||||
description string
|
||||
input *secretsmanager.Instance
|
||||
aclList *secretsmanager.AclList
|
||||
expected Model
|
||||
isValid bool
|
||||
description string
|
||||
input *secretsmanager.Instance
|
||||
ListACLsResponse *secretsmanager.ListACLsResponse
|
||||
expected Model
|
||||
isValid bool
|
||||
}{
|
||||
{
|
||||
"default_values",
|
||||
&secretsmanager.Instance{},
|
||||
&secretsmanager.AclList{},
|
||||
&secretsmanager.ListACLsResponse{},
|
||||
Model{
|
||||
Id: types.StringValue("pid,iid"),
|
||||
InstanceId: types.StringValue("iid"),
|
||||
|
|
@ -44,8 +44,8 @@ func TestMapFields(t *testing.T) {
|
|||
&secretsmanager.Instance{
|
||||
Name: utils.Ptr("name"),
|
||||
},
|
||||
&secretsmanager.AclList{
|
||||
Acls: &[]secretsmanager.Acl{
|
||||
&secretsmanager.ListACLsResponse{
|
||||
Acls: &[]secretsmanager.ACL{
|
||||
{
|
||||
Cidr: utils.Ptr("cidr-1"),
|
||||
Id: utils.Ptr("id-cidr-1"),
|
||||
|
|
@ -76,7 +76,7 @@ func TestMapFields(t *testing.T) {
|
|||
{
|
||||
"nil_response",
|
||||
nil,
|
||||
&secretsmanager.AclList{},
|
||||
&secretsmanager.ListACLsResponse{},
|
||||
Model{},
|
||||
false,
|
||||
},
|
||||
|
|
@ -90,7 +90,7 @@ func TestMapFields(t *testing.T) {
|
|||
{
|
||||
"no_resource_id",
|
||||
&secretsmanager.Instance{},
|
||||
&secretsmanager.AclList{},
|
||||
&secretsmanager.ListACLsResponse{},
|
||||
Model{},
|
||||
false,
|
||||
},
|
||||
|
|
@ -101,7 +101,7 @@ func TestMapFields(t *testing.T) {
|
|||
ProjectId: tt.expected.ProjectId,
|
||||
InstanceId: tt.expected.InstanceId,
|
||||
}
|
||||
err := mapFields(tt.input, tt.aclList, state)
|
||||
err := mapFields(tt.input, tt.ListACLsResponse, state)
|
||||
if !tt.isValid && err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
}
|
||||
|
|
@ -179,8 +179,8 @@ func TestToCreatePayload(t *testing.T) {
|
|||
|
||||
func TestUpdateACLs(t *testing.T) {
|
||||
// This is the response used when getting all ACLs currently, across all tests
|
||||
getAllACLsResp := secretsmanager.AclList{
|
||||
Acls: &[]secretsmanager.Acl{
|
||||
getAllACLsResp := secretsmanager.ListACLsResponse{
|
||||
Acls: &[]secretsmanager.ACL{
|
||||
{
|
||||
Cidr: utils.Ptr("acl-1"),
|
||||
Id: utils.Ptr("id-acl-1"),
|
||||
|
|
@ -391,7 +391,7 @@ func TestUpdateACLs(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
resp := secretsmanager.Acl{
|
||||
resp := secretsmanager.ACL{
|
||||
Cidr: utils.Ptr(cidr),
|
||||
Id: utils.Ptr(fmt.Sprintf("id-%s", cidr)),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue