Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: mapconvでポインタを受け取る箇所でのdereferenceフィルタ指定誤りを修正 #1068

Merged
merged 1 commit into from
Aug 31, 2023
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
2 changes: 1 addition & 1 deletion pkg/commands/iaas/autobackup/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type updateParameter struct {
cflag.TagsUpdateParameter `cli:",squash" mapconv:",omitempty,squash"`
cflag.IconIDUpdateParameter `cli:",squash" mapconv:",omitempty,squash"`

Weekdays *[]string `cli:",options=weekdays" mapconv:"BackupSpanWeekdays,omitempty,filters=weekdays" validate:"omitempty,weekdays"`
Weekdays *[]string `cli:",options=weekdays" mapconv:"BackupSpanWeekdays,omitempty,filters=dereference weekdays" validate:"omitempty,weekdays"`
MaxNumOfArchives *int `cli:"max-backup-num" mapconv:"MaximumNumberOfArchives" validate:"omitempty,min=1,max=10"`
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/iaas/autoscale/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type updateParameter struct {
cflag.IconIDUpdateParameter `cli:",squash" mapconv:",omitempty,squash"`

Zones *[]string `validate:"omitempty,required"`
Config *string `validate:"omitempty,required" mapconv:",omitempty,filters=path_or_content"`
Config *string `validate:"omitempty,required" mapconv:",omitempty,filters=dereference path_or_content"`

Disabled bool
TriggerType *string `cli:"trigger-type,options=cpu router schedule" validate:"omitempty,oneof=cpu router schedule" mapconv:",omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/iaas/database/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type updateParameter struct {
ReplicaUserPassword *string `cli:",category=replication,order=20,desc=(*required when --enable-replication is specified)" validate:"omitempty,required_with=EnableReplication"`
EnableWebUI *bool `cli:",category=WebUI"`
EnableBackup *bool `cli:",category=backup,order=10"`
BackupWeekdays *[]string `cli:",options=weekdays,category=backup,order=20" mapconv:",omitempty,filters=weekdays" validate:"omitempty,max=7,weekdays"`
BackupWeekdays *[]string `cli:",options=weekdays,category=backup,order=20" mapconv:",omitempty,filters=dereference weekdays" validate:"omitempty,max=7,weekdays"`
BackupStartTimeHour *int `cli:",category=backup,order=30" mapconv:",omitempty" validate:"omitempty,min=0,max=23"`
BackupStartTimeMinute *int `cli:",category=backup,order=40" mapconv:",omitempty" validate:"omitempty,oneof=0 15 30 45"`

Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/iaas/proxylb/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type updateParameter struct {
cflag.TagsUpdateParameter `cli:",squash" mapconv:",omitempty,squash"`
cflag.IconIDUpdateParameter `cli:",squash" mapconv:",omitempty,squash"`

Plan *string `cli:",options=proxylb_plan" mapconv:",omitempty,filters=proxylb_plan_to_value" validate:"omitempty,proxylb_plan"`
Plan *string `cli:",options=proxylb_plan" mapconv:",omitempty,filters=dereference proxylb_plan_to_value" validate:"omitempty,proxylb_plan"`

HealthCheck updateParameterHealthCheck `mapconv:",omitempty"`
SorryServer updateParameterSorryServer `mapconv:",omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/iaas/server/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ type updateParameter struct {
Memory *int `cli:"memory,category=plan,order=20" mapconv:"MemoryGB"`
GPU *int `cli:"gpu,category=plan,order=30"`
CPUModel *string `cli:"cpu-model,category=plan,order=40"`
Commitment *string `cli:",options=server_plan_commitment,category=plan,order=50" mapconv:",omitempty,filters=server_plan_commitment_to_value" validate:"omitempty,server_plan_commitment"`
Generation *string `cli:",options=server_plan_generation,category=plan,order=60" mapconv:",omitempty,filters=server_plan_generation_to_value" validate:"omitempty,server_plan_generation"`
Commitment *string `cli:",options=server_plan_commitment,category=plan,order=50" mapconv:",omitempty,filters=dereference server_plan_commitment_to_value" validate:"omitempty,server_plan_commitment"`
Generation *string `cli:",options=server_plan_generation,category=plan,order=60" mapconv:",omitempty,filters=dereference server_plan_generation_to_value" validate:"omitempty,server_plan_generation"`

InterfaceDriver *string `cli:",options=interface_dirver" mapconv:",omitempty,filters=interface_driver_to_value" validate:"omitempty,interface_driver"`
InterfaceDriver *string `cli:",options=interface_driver" mapconv:",omitempty,filters=dereference interface_driver_to_value" validate:"omitempty,interface_driver"`

CDROMID *types.ID `cli:"cdrom-id,aliases=iso-image-id"`
PrivateHostID *types.ID
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/iaas/server/zz_update_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/commands/iaas/simplemonitor/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type updateParameter struct {
}

type updateParameterHealthCheck struct {
Protocol *string `cli:",options=simple_monitor_protocol" mapconv:",omitempty,filters=simple_monitor_protocol_to_value" validate:"omitempty,simple_monitor_protocol" json:",omitempty"`
Protocol *string `cli:",options=simple_monitor_protocol" mapconv:",omitempty,filters=dereference simple_monitor_protocol_to_value" validate:"omitempty,simple_monitor_protocol" json:",omitempty"`
Port *int `json:",omitempty"`
Path *string `json:",omitempty"`
Status *int `json:",omitempty"`
Expand All @@ -78,7 +78,7 @@ type updateParameterHealthCheck struct {
OID *string `json:",omitempty"`
RemainingDays *int `json:",omitempty"`
HTTP2 *bool `cli:"http2" json:",omitempty"`
FTPS *string `cli:",options=simple_monitor_ftps" mapconv:",omitempty,filters=simple_monitor_ftps_to_value" validate:"omitempty,simple_monitor_ftps" json:",omitempty"`
FTPS *string `cli:",options=simple_monitor_ftps" mapconv:",omitempty,filters=dereference simple_monitor_ftps_to_value" validate:"omitempty,simple_monitor_ftps" json:",omitempty"`
VerifySNI *bool `cli:"verify-sni" json:",omitempty"`
}

Expand Down