mirror of
https://github.com/rancher/os.git
synced 2025-08-31 22:32:14 +00:00
Merge pull request #1801 from rancher/dont-log-cloud-init-data
Don't log the cloud-init metadata to the dmesg log - it will contain …
This commit is contained in:
@@ -80,7 +80,6 @@ func saveCloudConfig() error {
|
|||||||
|
|
||||||
selectDatasource(dss)
|
selectDatasource(dss)
|
||||||
|
|
||||||
// TODO: can't run these here, but it needs to be triggered from here :()
|
|
||||||
// Apply any newly detected network config.
|
// Apply any newly detected network config.
|
||||||
cfg = rancherConfig.LoadConfig()
|
cfg = rancherConfig.LoadConfig()
|
||||||
log.Debugf("init: SaveCloudConfig(post ApplyNetworkConfig): %#v", cfg.Rancher.Network)
|
log.Debugf("init: SaveCloudConfig(post ApplyNetworkConfig): %#v", cfg.Rancher.Network)
|
||||||
@@ -121,8 +120,7 @@ func saveFiles(cloudConfigBytes, scriptBytes []byte, metadata datasource.Metadat
|
|||||||
if err := util.WriteFileAtomic(rancherConfig.CloudConfigBootFile, cloudConfigBytes, 400); err != nil {
|
if err := util.WriteFileAtomic(rancherConfig.CloudConfigBootFile, cloudConfigBytes, 400); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// TODO: Don't put secrets into the log
|
log.Infof("Wrote to %s", rancherConfig.CloudConfigBootFile)
|
||||||
log.Infof("Written to %s:\n%s", rancherConfig.CloudConfigBootFile, string(cloudConfigBytes))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
metaDataBytes, err := yaml.Marshal(metadata)
|
metaDataBytes, err := yaml.Marshal(metadata)
|
||||||
@@ -133,8 +131,7 @@ func saveFiles(cloudConfigBytes, scriptBytes []byte, metadata datasource.Metadat
|
|||||||
if err = util.WriteFileAtomic(rancherConfig.MetaDataFile, metaDataBytes, 400); err != nil {
|
if err = util.WriteFileAtomic(rancherConfig.MetaDataFile, metaDataBytes, 400); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// TODO: Don't put secrets into the log
|
log.Infof("Wrote to %s", rancherConfig.MetaDataFile)
|
||||||
log.Infof("Written to %s:\n%s", rancherConfig.MetaDataFile, string(metaDataBytes))
|
|
||||||
|
|
||||||
// if we write the empty meta yml, the merge fails.
|
// if we write the empty meta yml, the merge fails.
|
||||||
// TODO: the problem is that a partially filled one will still have merge issues, so that needs fixing - presumably by making merge more clever, and making more fields optional
|
// TODO: the problem is that a partially filled one will still have merge issues, so that needs fixing - presumably by making merge more clever, and making more fields optional
|
||||||
@@ -167,7 +164,7 @@ func saveFiles(cloudConfigBytes, scriptBytes []byte, metadata datasource.Metadat
|
|||||||
if err := rancherConfig.WriteToFile(cc, rancherConfig.CloudConfigNetworkFile); err != nil {
|
if err := rancherConfig.WriteToFile(cc, rancherConfig.CloudConfigNetworkFile); err != nil {
|
||||||
log.Errorf("Failed to save config file %s: %v", rancherConfig.CloudConfigNetworkFile, err)
|
log.Errorf("Failed to save config file %s: %v", rancherConfig.CloudConfigNetworkFile, err)
|
||||||
}
|
}
|
||||||
log.Infof("Written to %s:", rancherConfig.CloudConfigNetworkFile)
|
log.Infof("Wrote to %s", rancherConfig.CloudConfigNetworkFile)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user