github.com/vmware/govmomi@v0.51.0/cli/pool/resource_config_spec.go (about) 1 // © Broadcom. All Rights Reserved. 2 // The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. 3 // SPDX-License-Identifier: Apache-2.0 4 5 package pool 6 7 import ( 8 "context" 9 "flag" 10 11 "github.com/vmware/govmomi/cli/flags" 12 "github.com/vmware/govmomi/vim25/types" 13 ) 14 15 func NewResourceConfigSpecFlag() *ResourceConfigSpecFlag { 16 return &ResourceConfigSpecFlag{types.DefaultResourceConfigSpec(), nil} 17 } 18 19 type ResourceConfigSpecFlag struct { 20 types.ResourceConfigSpec 21 *flags.ResourceAllocationFlag 22 } 23 24 func (s *ResourceConfigSpecFlag) Register(ctx context.Context, f *flag.FlagSet) { 25 s.ResourceAllocationFlag = flags.NewResourceAllocationFlag(&s.CpuAllocation, &s.MemoryAllocation) 26 s.ResourceAllocationFlag.Register(ctx, f) 27 } 28 29 func (s *ResourceConfigSpecFlag) Process(ctx context.Context) error { 30 return nil 31 }