Skip to content

[blockstorage/noauth]: No Support Client Type #2342

@fightdou

Description

@fightdou

When I use noauth way to resize in-use status volume,I got error

code:

        provider, err := noauth.NewClient(gophercloud.AuthOptions{
		Username: "admin",
		TenantName: "admin",
	})
	if err != nil {
		fmt.Println(err)
	}
	noauthClient, err := noauth.NewBlockStorageNoAuth(provider, noauth.EndpointOpts{
		CinderEndpoint: "http://0.0.0.0:8776/v3",
	})
        noauthClient.Microversion = "3.42"
        extendOpts := volumeactions.ExtendSizeOpts{
		NewSize: 2,
	}
        volumeactions.ExtendSize(noauthClient, "08ffaadd-a863-44d8-88dc-c3daa6702b32", extendOpts).ExtractErr()

error:

Bad request with: [POST http://0.0.0.0:8776/v3/admin/volumes/08ffaadd-a863-44d8-88dc-c3daa6702b32/action], error message: {"badRequest": {"code": 400, "message": "Invalid volume: Volume 08ffaadd-a863-44d8-88dc-c3daa6702b32 status must be '{'status': 'available'}' to extend, currently in-use."}}

read https://github.com/gophercloud/gophercloud/blob/master/service_client.go , This is because the API Microversion in the header is not passed because clientType is not set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions