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
2 changes: 1 addition & 1 deletion cmd/podman/common/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *Buil
// otherwise it returns true
func useLayers() string {
layers := os.Getenv("BUILDAH_LAYERS")
if strings.ToLower(layers) == "false" || layers == "0" {
if strings.EqualFold(layers, "false") || layers == "0" {
return "false"
}
return "true"
Expand Down
2 changes: 1 addition & 1 deletion libpod/runtime_volume_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (r *Runtime) newVolume(ctx context.Context, noCreatePluginVolume bool, opti
for key, val := range volume.config.Options {
switch strings.ToLower(key) {
case "device":
if strings.ToLower(volume.config.Options["type"]) == define.TypeBind {
if strings.EqualFold(volume.config.Options["type"], define.TypeBind) {
if err := fileutils.Exists(val); err != nil {
return nil, fmt.Errorf("invalid volume option %s for driver 'local': %w", key, err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/filters/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func createAnonymousFilterVolumeFunction(filterValues []string) (libpod.VolumeFi
return func(v *libpod.Volume) bool {
for _, val := range filterValues {
anon := v.Anonymous()
invert := strings.ToLower(val) == "false" || val == "0"
invert := strings.EqualFold(val, "false") || val == "0"
if invert {
anon = !anon
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/infra/abi/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func setUpClusterClient(kconfig k8sAPI.Config, applyOptions entities.ApplyOption
caCertPool := x509.NewCertPool()

// Be insecure if user sets ca-cert-file flag to insecure
if strings.ToLower(caCertFile) == "insecure" {
if strings.EqualFold(caCertFile, "insecure") {
insecureSkipVerify = true
} else if caCertFile == "" {
caCertFile = kconfig.Clusters[0].Cluster.CertificateAuthority
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/shim/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -1021,5 +1021,5 @@ func promptUpdateSystemConn() (bool, error) {
if err != nil {
return false, err
}
return strings.ToLower(answer)[0] == 'y', nil
return len(answer) > 0 && (answer[0] == 'y' || answer[0] == 'Y'), nil
}
2 changes: 1 addition & 1 deletion pkg/specgen/generate/config_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func supportAmbientCapabilities() bool {

func shouldMask(mask string, unmask []string) bool {
for _, m := range unmask {
if strings.ToLower(m) == "all" {
if strings.EqualFold(m, "all") {
return false
}
for m1 := range strings.SplitSeq(m, ":") {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ func ParseRestartPolicy(policy string) (string, uint, error) {
case 1:
// No retries specified
policyType = splitRestart[0]
if strings.ToLower(splitRestart[0]) == "never" {
if strings.EqualFold(splitRestart[0], "never") {
policyType = define.RestartPolicyNo
}
case 2:
Expand Down