mirror of
https://github.com/rancher/os.git
synced 2025-06-29 00:06:49 +00:00
Fix --private flag for 'ros config export'
This commit is contained in:
parent
410dfbe0fd
commit
a59ec33787
@ -85,7 +85,7 @@ func Merge(bytes []byte) error {
|
|||||||
|
|
||||||
func Export(private, full bool) (string, error) {
|
func Export(private, full bool) (string, error) {
|
||||||
rawCfg, err := LoadRawConfig(full)
|
rawCfg, err := LoadRawConfig(full)
|
||||||
if private {
|
if !private {
|
||||||
rawCfg = filterPrivateKeys(rawCfg)
|
rawCfg = filterPrivateKeys(rawCfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,3 +83,21 @@ if [ "$(sudo ros config get rancher.network.dns.search)" == "[]
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
'''.strip())
|
'''.strip())
|
||||||
|
|
||||||
|
|
||||||
|
def test_ros_export(qemu):
|
||||||
|
SSH(qemu).check_call('''
|
||||||
|
set -x -e
|
||||||
|
|
||||||
|
if sudo ros config export | grep "PRIVATE KEY"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo ros config export --private | grep "PRIVATE KEY"
|
||||||
|
|
||||||
|
sudo ros config export --full | grep "udev"
|
||||||
|
sudo ros config export --private --full | grep "ntp"
|
||||||
|
sudo ros config export --full | grep "labels"
|
||||||
|
|
||||||
|
sudo ros config export --private --full | grep "PRIVATE KEY"
|
||||||
|
'''.strip())
|
||||||
|
Loading…
Reference in New Issue
Block a user