Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Shilpa-Gokul committed Feb 14, 2023
1 parent c60bb3d commit 6896775
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
8 changes: 4 additions & 4 deletions cmd/capibmadm/cmd/powervs/port/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
)

type portCreateOptions struct {
networkID string
network string
ipAddress string
description string
}
Expand All @@ -53,7 +53,7 @@ capibmadm powervs port create --network <netword-id/network-name> --description
}

var portCreateOption portCreateOptions
cmd.Flags().StringVar(&portCreateOption.networkID, "network", "", "Network ID/ name on which port is to be created (Required)")
cmd.Flags().StringVar(&portCreateOption.network, "network", "", "Network ID/ name on which port is to be created (Required)")
cmd.Flags().StringVar(&portCreateOption.ipAddress, "ip-address", "", "IP Address to be assigned to the port")
cmd.Flags().StringVar(&portCreateOption.description, "description", "", "Description of the port")
cmd.RunE = func(cmd *cobra.Command, args []string) error {
Expand All @@ -69,7 +69,7 @@ capibmadm powervs port create --network <netword-id/network-name> --description

func createPort(ctx context.Context, portCreateOption portCreateOptions) error {
logger := log.Log
logger.Info("Creating Port ", "Network ID/Name", portCreateOption.networkID, "IP Address", portCreateOption.ipAddress, "Description", portCreateOption.description, "service-instance-id", options.GlobalOptions.ServiceInstanceID, "zone", options.GlobalOptions.PowerVSZone)
logger.Info("Creating Port ", "Network ID/Name", portCreateOption.network, "IP Address", portCreateOption.ipAddress, "Description", portCreateOption.description, "service-instance-id", options.GlobalOptions.ServiceInstanceID, "zone", options.GlobalOptions.PowerVSZone)
accountID, err := utils.GetAccountID(ctx, iam.GetIAMAuth())
if err != nil {
return err
Expand All @@ -81,7 +81,7 @@ func createPort(ctx context.Context, portCreateOption portCreateOptions) error {

networkClient := client.NewIBMPINetworkClient(ctx, session, options.GlobalOptions.ServiceInstanceID)

network, err := networkClient.Get(portCreateOption.networkID)
network, err := networkClient.Get(portCreateOption.network)
if err != nil {
return err
}
Expand Down
18 changes: 0 additions & 18 deletions cmd/capibmadm/cmd/powervs/port/doc.go

This file was deleted.

1 change: 1 addition & 0 deletions cmd/capibmadm/cmd/powervs/port/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package port contains the commands to operate on PowerVS Port resources.
package port

import (
Expand Down

0 comments on commit 6896775

Please sign in to comment.