Skip to content

Commit 6cbf57a

Browse files
committed
Add check to ignore cloud-config
1 parent c6ec8fa commit 6cbf57a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/providers/ionoscloud/ionoscloud.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package ionoscloud
2020

2121
import (
22+
"bytes"
2223
"os"
2324

2425
"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
@@ -48,5 +49,12 @@ func fetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
4849
f.Logger.Err("couldn't read config %q: %v", defaultFilename, err)
4950
return types.Config{}, report.Report{}, err
5051
}
52+
53+
header := []byte("#cloud-config\n")
54+
if bytes.HasPrefix(rawConfig, header) {
55+
f.Logger.Debug("config drive (%q) contains a cloud-config configuration, ignoring", defaultFilename)
56+
return types.Config{}, report.Report{}, err
57+
}
58+
5159
return util.ParseConfig(f.Logger, rawConfig)
5260
}

0 commit comments

Comments
 (0)