Skip to content

Invalid YAML expected type, found '-'  #33

@Lvzhenqian

Description

@Lvzhenqian

when the yaml value key has “-” strings
The key converted from the Convert function also comes with a "-" string, and an error is reported after being formatted using the format.source function
like this:

extra_args: 
      allowed-unsafe-sysctls: "net.core.*"
      node-status-update-frequency: 20s
      eviction-soft: ""
      eviction-soft-grace-period: ""
      eviction-hard: ""
// ExtraArgs
type ExtraArgs struct {
Allowed-Unsafe-Sysctls string `yaml:"allowed-unsafe-sysctls"`
Node-Status-Update-Frequency string `yaml:"node-status-update-frequency"`
Eviction-Soft string `yaml:"eviction-soft"`
Eviction-Soft-Grace-Period string `yaml:"eviction-soft-grace-period"`
Eviction-Hard string `yaml:"eviction-hard"`
}

2020/03/05 14:55:34 14:10: expected type, found '-' (and 5 more errors)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions