Skip to content

Commit

Permalink
Merge pull request kubernetes#6510 from tengqm/frontmatter-workaround
Browse files Browse the repository at this point in the history
Workaround for Jekyllr frontmatter
  • Loading branch information
tengqm authored Dec 1, 2017
2 parents e5acb8e + b84ac59 commit a99a42f
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 15 deletions.
1 change: 0 additions & 1 deletion cn/docs/tutorials/stateful-application/web.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
Expand Down
3 changes: 1 addition & 2 deletions cn/docs/tutorials/stateful-application/webp.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -42,4 +41,4 @@ spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
storage: 1Gi
1 change: 0 additions & 1 deletion cn/docs/user-guide/multi-pod.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Pod
metadata:
Expand Down
2 changes: 1 addition & 1 deletion docs/tasks/access-application-cluster/frontend.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: Service
apiVersion: v1
kind: Service
metadata:
name: frontend
spec:
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/stateful-application/web.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
Expand Down
3 changes: 1 addition & 2 deletions docs/tutorials/stateful-application/webp.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -45,4 +44,4 @@ spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
storage: 1Gi
1 change: 0 additions & 1 deletion docs/tutorials/stateful-application/zookeeper.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
Expand Down
1 change: 0 additions & 1 deletion docs/user-guide/environment-guide/backend-rc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: ReplicationController
metadata:
Expand Down
1 change: 0 additions & 1 deletion docs/user-guide/environment-guide/backend-srv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
Expand Down
1 change: 0 additions & 1 deletion docs/user-guide/environment-guide/show-rc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: ReplicationController
metadata:
Expand Down
1 change: 0 additions & 1 deletion docs/user-guide/environment-guide/show-srv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
Expand Down
1 change: 0 additions & 1 deletion docs/user-guide/multi-pod.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Pod
metadata:
Expand Down
9 changes: 8 additions & 1 deletion test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ func walkConfigFiles(inDir string, fn func(name, path string, data [][]byte)) er
if err != nil {
return err
}
// workaround for Jekyllr limit
if bytes.HasPrefix(data, []byte("---\n")) {
return fmt.Errorf("YAML file cannot start with \"---\", please remove the first line")
}
name := strings.TrimSuffix(file, ext)

var docs [][]byte
Expand All @@ -217,7 +221,10 @@ func walkConfigFiles(inDir string, fn func(name, path string, data [][]byte)) er
if err != nil {
return fmt.Errorf("%s: %v", path, err)
}
docs = append(docs, out)
// deal with "empty" document (e.g. pure comments)
if string(out) != "null" {
docs = append(docs, out)
}
}
} else {
docs = append(docs, data)
Expand Down

0 comments on commit a99a42f

Please sign in to comment.