Skip to content

Commit

Permalink
Merge pull request #2955 from gophercloud/bp-v2-ddb64b9
Browse files Browse the repository at this point in the history
[v2] Rename imageservice -> image
  • Loading branch information
pierreprinetti committed Feb 28, 2024
2 parents 8eb18a0 + eb19b36 commit ad23971
Show file tree
Hide file tree
Showing 45 changed files with 54 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: functional-imageservice
name: functional-image
on:
pull_request:
paths:
- '**imageservice**'
- '**image**'
schedule:
- cron: '0 0 */3 * *'
jobs:
functional-imageservice:
functional-image:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
openstack_version: "stable/victoria"
ubuntu_version: "20.04"
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} with Glance and run imageservice acceptance tests
name: Deploy OpenStack ${{ matrix.name }} with Glance and run image acceptance tests
steps:
- name: Checkout Gophercloud
uses: actions/checkout@v4
Expand All @@ -52,7 +52,7 @@ jobs:
run: ./script/acceptancetest
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
ACCEPTANCE_TESTS_FILTER: "^.*imageservice.*$"
ACCEPTANCE_TESTS_FILTER: "^.*image.*$"
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand All @@ -61,5 +61,5 @@ jobs:
if: failure()
uses: actions/upload-artifact@v4
with:
name: functional-imageservice-${{ matrix.name }}
name: functional-image-${{ matrix.name }}
path: /tmp/devstack-logs/*
6 changes: 3 additions & 3 deletions internal/acceptance/clients/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ func NewIdentityV3UnauthenticatedClient() (*gophercloud.ServiceClient, error) {
return openstack.NewIdentityV3(client, gophercloud.EndpointOpts{})
}

// NewImageServiceV2Client returns a *ServiceClient for making calls to the
// NewImageV2Client returns a *ServiceClient for making calls to the
// OpenStack Image v2 API. An error will be returned if authentication or
// client creation was not possible.
func NewImageServiceV2Client() (*gophercloud.ServiceClient, error) {
func NewImageV2Client() (*gophercloud.ServiceClient, error) {
ao, err := openstack.AuthOptionsFromEnv()
if err != nil {
return nil, err
Expand All @@ -479,7 +479,7 @@ func NewImageServiceV2Client() (*gophercloud.ServiceClient, error) {

client = configureDebug(client)

return openstack.NewImageServiceV2(client, gophercloud.EndpointOpts{
return openstack.NewImageV2(client, gophercloud.EndpointOpts{
Region: os.Getenv("OS_REGION_NAME"),
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestImageStage(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

image, err := CreateEmptyImage(t, client)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build acceptance || imageservice || imageimport
// +build acceptance imageservice imageimport
//go:build acceptance || image || imageimport
// +build acceptance image imageimport

package v2

Expand All @@ -12,7 +12,7 @@ import (
)

func TestGetImportInfo(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

importInfo, err := GetImportInfo(t, client)
Expand All @@ -22,7 +22,7 @@ func TestGetImportInfo(t *testing.T) {
}

func TestCreateImport(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

image, err := CreateEmptyImage(t, client)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build acceptance || imageservice || images
// +build acceptance imageservice images
//go:build acceptance || image || images
// +build acceptance image images

package v2

Expand All @@ -11,13 +11,13 @@ import (

"github.com/gophercloud/gophercloud/v2/internal/acceptance/clients"
"github.com/gophercloud/gophercloud/v2/internal/acceptance/tools"
"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/images"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/images"
"github.com/gophercloud/gophercloud/v2/pagination"
th "github.com/gophercloud/gophercloud/v2/testhelper"
)

func TestImagesListEachPage(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

listOpts := images.ListOpts{
Expand All @@ -41,7 +41,7 @@ func TestImagesListEachPage(t *testing.T) {
}

func TestImagesListAllPages(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

image, err := CreateEmptyImage(t, client)
Expand Down Expand Up @@ -70,7 +70,7 @@ func TestImagesListAllPages(t *testing.T) {
}

func TestImagesListByDate(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

date := time.Date(2014, 1, 1, 1, 1, 1, 0, time.UTC)
Expand Down Expand Up @@ -118,7 +118,7 @@ func TestImagesListByDate(t *testing.T) {
}

func TestImagesFilter(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

image, err := CreateEmptyImage(t, client)
Expand All @@ -143,7 +143,7 @@ func TestImagesFilter(t *testing.T) {
}

func TestImagesUpdate(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

image, err := CreateEmptyImage(t, client)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package v2 contains common functions for creating imageservice resources
// Package v2 contains common functions for creating image resources
// for use in acceptance tests. See the `*_test.go` files for example usages.
package v2

Expand All @@ -11,10 +11,10 @@ import (

"github.com/gophercloud/gophercloud/v2"
"github.com/gophercloud/gophercloud/v2/internal/acceptance/tools"
"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/imagedata"
"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/imageimport"
"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/images"
"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/tasks"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/imagedata"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/imageimport"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/images"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/tasks"
th "github.com/gophercloud/gophercloud/v2/testhelper"
)

Expand Down Expand Up @@ -77,7 +77,7 @@ const ImportImageURL = "http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_
// CreateTask will create a task to import the CirrOS image.
// An error will be returned if a task couldn't be created.
func CreateTask(t *testing.T, client *gophercloud.ServiceClient, imageURL string) (*tasks.Task, error) {
t.Logf("Attempting to create an Imageservice import task with image: %s", imageURL)
t.Logf("Attempting to create an Image service import task with image: %s", imageURL)
opts := tasks.CreateOpts{
Type: "import",
Input: map[string]interface{}{
Expand All @@ -104,7 +104,7 @@ func CreateTask(t *testing.T, client *gophercloud.ServiceClient, imageURL string

// GetImportInfo will retrieve Import API information.
func GetImportInfo(t *testing.T, client *gophercloud.ServiceClient) (*imageimport.ImportInfo, error) {
t.Log("Attempting to get the Imageservice Import API information")
t.Log("Attempting to get the Image service Import API information")
importInfo, err := imageimport.Get(context.TODO(), client).Extract()
if err != nil {
return nil, err
Expand Down Expand Up @@ -159,7 +159,7 @@ func DeleteImageFile(t *testing.T, filepath string) {
t.Logf("Successfully deleted image file %s", filepath)
}

// ImportImage will import image data from the remote source to the Imageservice.
// ImportImage will import image data from the remote source to the Image service.
func ImportImage(t *testing.T, client *gophercloud.ServiceClient, imageID string) error {
importOpts := imageimport.CreateOpts{
Name: imageimport.WebDownloadMethod,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build acceptance || imageservice || tasks
// +build acceptance imageservice tasks
//go:build acceptance || image || tasks
// +build acceptance image tasks

package v2

Expand All @@ -9,13 +9,13 @@ import (

"github.com/gophercloud/gophercloud/v2/internal/acceptance/clients"
"github.com/gophercloud/gophercloud/v2/internal/acceptance/tools"
"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/tasks"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/tasks"
"github.com/gophercloud/gophercloud/v2/pagination"
th "github.com/gophercloud/gophercloud/v2/testhelper"
)

func TestTasksListEachPage(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

listOpts := tasks.ListOpts{
Expand All @@ -36,7 +36,7 @@ func TestTasksListEachPage(t *testing.T) {
}

func TestTasksListAllPages(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

listOpts := tasks.ListOpts{}
Expand All @@ -53,12 +53,12 @@ func TestTasksListAllPages(t *testing.T) {
}

func TestTaskCreate(t *testing.T) {
client, err := clients.NewImageServiceV2Client()
client, err := clients.NewImageV2Client()
th.AssertNoErr(t, err)

task, err := CreateTask(t, client, ImportImageURL)
if err != nil {
t.Fatalf("Unable to create an Imageservice task: %v", err)
t.Fatalf("Unable to create an Image service task: %v", err)
}

tools.PrintResource(t, task)
Expand Down
6 changes: 3 additions & 3 deletions openstack/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ func NewDNSV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (
return sc, err
}

// NewImageServiceV2 creates a ServiceClient that may be used to access the v2
// image service.
func NewImageServiceV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
// NewImageV2 creates a ServiceClient that may be used to access the v2 image
// service.
func NewImageV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) {
sc, err := initClientOpts(client, eo, "image")
sc.ResourceBase = sc.Endpoint + "v2/"
return sc, err
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func Upload(ctx context.Context, client *gophercloud.ServiceClient, id string, d
return
}

// Stage performs PUT call on the existing image object in the Imageservice with
// Stage performs PUT call on the existing image object in the Image service with
// the provided file.
// Existing image object must be in the "queued" status.
func Stage(ctx context.Context, client *gophercloud.ServiceClient, id string, data io.Reader) (r StageResult) {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"testing"

"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/imagedata"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/imagedata"
th "github.com/gophercloud/gophercloud/v2/testhelper"
fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client"
)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Package imageimport enables management of images import and retrieval of the
Imageservice Import API information.
Image service Import API information.
Example to Get an information about the Import API
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"testing"

"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/imageimport"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/imageimport"
th "github.com/gophercloud/gophercloud/v2/testhelper"
fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Image struct {
Name string `json:"name"`

// Status is the image status. It can be "queued" or "active"
// See imageservice/v2/images/type.go
// See image/v2/images/type.go
Status ImageStatus `json:"status"`

// Tags is a list of image tags. Tags are arbitrarily defined strings
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/images"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/images"
"github.com/gophercloud/gophercloud/v2/pagination"
th "github.com/gophercloud/gophercloud/v2/testhelper"
fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/members"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/members"
"github.com/gophercloud/gophercloud/v2/pagination"
th "github.com/gophercloud/gophercloud/v2/testhelper"
fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Package tasks enables management and retrieval of tasks from the OpenStack
Imageservice.
Image service.
Example to List Tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type ListOptsBuilder interface {
}

// ListOpts allows the filtering and sorting of paginated collections through
// the OpenStack Imageservice tasks API.
// the OpenStack Image service tasks API.
type ListOpts struct {
// Integer value for the limit of values to return.
Limit int `q:"limit"`
Expand Down Expand Up @@ -90,7 +90,7 @@ func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
})
}

// Get retrieves a specific Imageservice task based on its ID.
// Get retrieves a specific Image service task based on its ID.
func Get(ctx context.Context, c *gophercloud.ServiceClient, taskID string) (r GetResult) {
resp, err := c.Get(ctx, getURL(c, taskID), &r.Body, nil)
_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
Expand All @@ -102,7 +102,7 @@ type CreateOptsBuilder interface {
ToTaskCreateMap() (map[string]interface{}, error)
}

// CreateOpts specifies parameters of a new Imageservice task.
// CreateOpts specifies parameters of a new Image service task.
type CreateOpts struct {
Type string `json:"type" required:"true"`
Input map[string]interface{} `json:"input"`
Expand All @@ -117,7 +117,7 @@ func (opts CreateOpts) ToTaskCreateMap() (map[string]interface{}, error) {
return b, nil
}

// Create requests the creation of a new Imageservice task on the server.
// Create requests the creation of a new Image service task on the server.
func Create(ctx context.Context, client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) {
b, err := opts.ToTaskCreateMap()
if err != nil {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package testing
import (
"time"

"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/tasks"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/tasks"
)

// TasksListResult represents raw server response from a server to a list call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/tasks"
"github.com/gophercloud/gophercloud/v2/openstack/image/v2/tasks"
"github.com/gophercloud/gophercloud/v2/pagination"
th "github.com/gophercloud/gophercloud/v2/testhelper"
fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client"
Expand Down
File renamed without changes.

0 comments on commit ad23971

Please sign in to comment.