Skip to content

Commit

Permalink
Add check to ignore cloud-config
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbenjemaa committed Oct 17, 2024
1 parent c6ec8fa commit 6cbf57a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/providers/ionoscloud/ionoscloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package ionoscloud

import (
"bytes"
"os"

"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
Expand Down Expand Up @@ -48,5 +49,12 @@ func fetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
f.Logger.Err("couldn't read config %q: %v", defaultFilename, err)
return types.Config{}, report.Report{}, err
}

header := []byte("#cloud-config\n")
if bytes.HasPrefix(rawConfig, header) {
f.Logger.Debug("config drive (%q) contains a cloud-config configuration, ignoring", defaultFilename)
return types.Config{}, report.Report{}, err
}

return util.ParseConfig(f.Logger, rawConfig)
}

0 comments on commit 6cbf57a

Please sign in to comment.