diff --git a/json-schema/registry.json b/json-schema/registry.json index 8106fb45f..fa87039c7 100644 --- a/json-schema/registry.json +++ b/json-schema/registry.json @@ -53,6 +53,9 @@ }, "all_features": { "type": "boolean" + }, + "locked": { + "type": "boolean" } }, "additionalProperties": false, diff --git a/pkg/config/registry/cargo.go b/pkg/config/registry/cargo.go index 5d21a1a0a..d0c6a5c18 100644 --- a/pkg/config/registry/cargo.go +++ b/pkg/config/registry/cargo.go @@ -3,4 +3,5 @@ package registry type Cargo struct { Features []string `json:"features,omitempty"` AllFeatures bool `yaml:"all_features" json:"all_features,omitempty"` + Locked bool `json:"locked,omitempty"` } diff --git a/pkg/installpackage/cargo.go b/pkg/installpackage/cargo.go index b21810880..76d4d6d3a 100644 --- a/pkg/installpackage/cargo.go +++ b/pkg/installpackage/cargo.go @@ -40,6 +40,9 @@ func getCargoArgs(version string, opts *registry.Cargo) []string { } else if len(opts.Features) != 0 { args = append(args, "--features", strings.Join(opts.Features, ",")) } + if opts.Locked { + args = append(args, "--locked") + } } return args }