Skip to content

Commit

Permalink
caa: Move provider inclusion out of cloudmgr
Browse files Browse the repository at this point in the history
Move the init code to each provider's manager, and include
the provider packages, at the cmd level instead.

Signed-off-by: James Tumber <james.tumber@ibm.com>
  • Loading branch information
tumberino authored and bpradipt committed Dec 3, 2023
1 parent 8881b3a commit 5a77d63
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 120 deletions.
10 changes: 10 additions & 0 deletions cmd/cloud-api-adaptor/aws.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build aws

// (C) Copyright Confidential Containers Contributors
// SPDX-License-Identifier: Apache-2.0

package main

import (
_ "github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/cloud/aws"
)
10 changes: 10 additions & 0 deletions cmd/cloud-api-adaptor/azure.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build azure

// (C) Copyright Confidential Containers Contributors
// SPDX-License-Identifier: Apache-2.0

package main

import (
_ "github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/cloud/azure"
)
10 changes: 10 additions & 0 deletions cmd/cloud-api-adaptor/ibmcloud.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build ibmcloud

// (C) Copyright Confidential Containers Contributors
// SPDX-License-Identifier: Apache-2.0

package main

import (
_ "github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/cloud/ibmcloud"
)
10 changes: 10 additions & 0 deletions cmd/cloud-api-adaptor/ibmcloud_powervs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build ibmcloud_powervs

// (C) Copyright Confidential Containers Contributors
// SPDX-License-Identifier: Apache-2.0

package main

import (
_ "github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/cloud/ibmcloud-powervs"
)
10 changes: 10 additions & 0 deletions cmd/cloud-api-adaptor/libvirt.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build libvirt

// (C) Copyright Confidential Containers Contributors
// SPDX-License-Identifier: Apache-2.0

package main

import (
_ "github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/cloud/libvirt"
)
6 changes: 3 additions & 3 deletions cmd/cloud-api-adaptor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/confidential-containers/cloud-api-adaptor/cmd"
"github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor"
"github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/cloud/cloudmgr"
"github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/cloud"
"github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/proxy"
daemon "github.com/confidential-containers/cloud-api-adaptor/pkg/forwarder"
"github.com/confidential-containers/cloud-api-adaptor/pkg/podnetwork/tunneler/vxlan"
Expand Down Expand Up @@ -41,7 +41,7 @@ func printHelp(out io.Writer) {
fmt.Fprintln(out)
fmt.Fprintln(out, "Supported cloud providers are:")

for _, name := range cloudmgr.List() {
for _, name := range cloud.List() {
fmt.Fprintf(out, "\t%s\n", name)
}
fmt.Fprintln(out)
Expand Down Expand Up @@ -74,7 +74,7 @@ func (cfg *daemonConfig) Setup() (cmd.Starter, error) {
cmd.Exit(1)
}

cloud := cloudmgr.Get(cloudName)
cloud := cloud.Get(cloudName)

if cloud == nil {
fmt.Fprintf(os.Stderr, "%s: Unsupported cloud provider: %s\n\n", programName, cloudName)
Expand Down
10 changes: 10 additions & 0 deletions cmd/cloud-api-adaptor/vsphere.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build vsphere

// (C) Copyright Confidential Containers Contributors
// SPDX-License-Identifier: Apache-2.0

package main

import (
_ "github.com/confidential-containers/cloud-api-adaptor/pkg/adaptor/cloud/vsphere"
)
14 changes: 0 additions & 14 deletions pkg/adaptor/cloud/cloudmgr/aws.go

This file was deleted.

14 changes: 0 additions & 14 deletions pkg/adaptor/cloud/cloudmgr/azure.go

This file was deleted.

14 changes: 0 additions & 14 deletions pkg/adaptor/cloud/cloudmgr/ibmcloud.go

This file was deleted.

14 changes: 0 additions & 14 deletions pkg/adaptor/cloud/cloudmgr/ibmcloud_powervs.go

This file was deleted.

14 changes: 0 additions & 14 deletions pkg/adaptor/cloud/cloudmgr/libvirt.go

This file was deleted.

33 changes: 0 additions & 33 deletions pkg/adaptor/cloud/cloudmgr/manager.go

This file was deleted.

14 changes: 0 additions & 14 deletions pkg/adaptor/cloud/cloudmgr/vsphere.go

This file was deleted.

0 comments on commit 5a77d63

Please sign in to comment.