Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/apiservers/service/restapi/handlers/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func validateTarget(ctx context.Context, d *data.Data) (*validate.Validator, err
return validator, nil
}

// Copied from list.go, and appears to be present other places. TODO: deduplicate
// Copied from list.go, and appears to be present other places. TODO (#6032): deduplicate
func upgradeStatusMessage(op trace.Operation, vch *vm.VirtualMachine, installerVer *version.Build, vchVer *version.Build) string {
if sameVer := installerVer.Equal(vchVer); sameVer {
return "Up to date"
Expand Down Expand Up @@ -139,7 +139,7 @@ func upgradeStatusMessage(op trace.Operation, vch *vm.VirtualMachine, installerV
}

func getVCHConfig(op trace.Operation, d *data.Data) (*config.VirtualContainerHostConfigSpec, error) {
// TODO(jzt): abstract some of this boilerplate into helpers
// TODO (#6032): abstract some of this boilerplate into helpers
validator, err := validateTarget(op.Context, d)
if err != nil {
return nil, util.WrapError(http.StatusBadRequest, err)
Expand Down
14 changes: 7 additions & 7 deletions lib/apiservers/service/restapi/handlers/vch_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func setUpLogger() *os.File {
func buildCreate(op trace.Operation, d *data.Data, finder *find.Finder, vch *models.VCH) (*create.Create, error) {
c := &create.Create{Data: d}

// TODO: deduplicate with create.processParams
// TODO (#6032): deduplicate with create.processParams

if vch != nil {
if vch.Version != "" && version.String() != string(vch.Version) {
Expand All @@ -172,7 +172,7 @@ func buildCreate(op trace.Operation, d *data.Data, finder *find.Finder, vch *mod

c.DisplayName = vch.Name

// TODO: move validation to swagger
// TODO (#6710): move validation to swagger
if err := common.CheckUnsupportedChars(c.DisplayName); err != nil {
return nil, util.NewError(http.StatusBadRequest, fmt.Sprintf("Invalid display name: %s", err))
}
Expand All @@ -196,7 +196,7 @@ func buildCreate(op trace.Operation, d *data.Data, finder *find.Finder, vch *mod
c.ResourceLimits.VCHMemoryShares = fromShares(vch.Compute.Memory.Shares)
}

resourcePath, err := fromManagedObject(op, finder, "ResourcePool", vch.Compute.Resource) // TODO: Do we need to handle clusters differently?
resourcePath, err := fromManagedObject(op, finder, "ResourcePool", vch.Compute.Resource) // TODO (#6711): Do we need to handle clusters differently?
if err != nil {
return nil, util.NewError(http.StatusBadRequest, fmt.Sprintf("Error finding resource pool: %s", err))
}
Expand Down Expand Up @@ -326,7 +326,7 @@ func buildCreate(op trace.Operation, d *data.Data, finder *find.Finder, vch *mod

if vch.Storage != nil {
if vch.Storage.ImageStores != nil && len(vch.Storage.ImageStores) > 0 {
c.ImageDatastorePath = vch.Storage.ImageStores[0] // TODO: many vs. one mismatch
c.ImageDatastorePath = vch.Storage.ImageStores[0] // TODO (#6712): many vs. one mismatch
}

if err := common.CheckUnsupportedCharsDatastore(c.ImageDatastorePath); err != nil {
Expand Down Expand Up @@ -407,7 +407,7 @@ func buildCreate(op trace.Operation, d *data.Data, finder *find.Finder, vch *mod
c.InsecureRegistries = vch.Registry.Insecure
c.WhitelistRegistries = vch.Registry.Whitelist

//params.Vch.Registry.Blacklist
//TODO (#6713): params.Vch.Registry.Blacklist

c.RegistryCAs = fromPemCertificates(vch.Registry.CertificateAuthorities)

Expand Down Expand Up @@ -452,7 +452,7 @@ func handleCreate(op trace.Operation, c *create.Create, validator *validate.Vali

vConfig := validator.AddDeprecatedFields(validator.Context, vchConfig, c.Data)

// TODO: make this configurable
// TODO (#6714): make this configurable
images := common.Images{}
vConfig.ImageFiles, err = images.CheckImagesFiles(true)
vConfig.ApplianceISO = path.Base(images.ApplianceISO)
Expand Down Expand Up @@ -523,7 +523,7 @@ func fromGateway(m *models.Gateway) string {
return ""
}

return fmt.Sprintf("%s:%s", // TODO: what if RoutingDestinations is empty?
return fmt.Sprintf("%s:%s", // TODO (#6715): what if RoutingDestinations is empty?
strings.Join(*fromIPRanges(&m.RoutingDestinations), ","),
m.Address,
)
Expand Down
6 changes: 3 additions & 3 deletions lib/apiservers/service/restapi/handlers/vch_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func mobidToID(mobid string) string {
moref := new(types.ManagedObjectReference)
ok := moref.FromString(mobid)
if !ok {
return "" // TODO: Handle? (We probably don't want to let this fail the request, but may want to convey that something unexpected happened.)
return "" // TODO (#6717): Handle? (We probably don't want to let this fail the request, but may want to convey that something unexpected happened.)
}

return moref.Value
Expand All @@ -409,7 +409,7 @@ func asPemCertificates(certificates []byte) []*models.X509Data {

err := pem.Encode(&buf, b)
if err != nil {
continue // TODO: Handle? (We probably don't want to let this fail the request, but may want to convey that something unexpected happened.)
continue // TODO (#6716): Handle? (We probably don't want to let this fail the request, but may want to convey that something unexpected happened.)
}

m = append(m, &models.X509Data{
Expand All @@ -426,7 +426,7 @@ func asPemCertificate(certificates []byte) *models.X509Data {
m := asPemCertificates(certificates)

if len(m) > 1 {
// TODO: Error? (We probably don't want to let this fail the request, but may want to convey that something unexpected happened.)
// TODO (#6716): Error? (We probably don't want to let this fail the request, but may want to convey that something unexpected happened.)
}

return m[0]
Expand Down
2 changes: 1 addition & 1 deletion lib/apiservers/service/restapi/handlers/vch_log_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (h *VCHDatacenterLogGet) Handle(params operations.GetTargetTargetDatacenter

// getDatastoreHelper validates the VCH and returns the datastore helper for the VCH. It errors when validation fails or when datastore is not ready
func getDatastoreHelper(op trace.Operation, d *data.Data) (*datastore.Helper, error) {
// TODO (angiew): abstract some of the boilerplate into helpers in common.go
// TODO (#6032): abstract some of the boilerplate into helpers in common.go
validator, err := validateTarget(op, d)
if err != nil {
return nil, util.WrapError(http.StatusBadRequest, err)
Expand Down