We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3184d67 commit 2d45b03Copy full SHA for 2d45b03
pkg/cidata/schema.go
@@ -1,7 +1,9 @@
1
package cidata
2
3
import (
4
+ "bytes"
5
_ "embed"
6
+ "fmt"
7
"strings"
8
9
"github.com/santhosh-tekuri/jsonschema/v5"
@@ -15,6 +17,9 @@ const schemaURL = "https://raw.githubusercontent.com/canonical/cloud-init/main/c
15
17
var schemaText string
16
18
19
func validateCloudConfig(userData []byte) error {
20
+ if !bytes.HasPrefix(userData, []byte("#cloud-config")) {
21
+ return fmt.Errorf("missing #cloud-config")
22
+ }
23
var m interface{}
24
err := yaml.Unmarshal(userData, &m)
25
if err != nil {
0 commit comments