Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix site build #16531

Merged
merged 1 commit into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion content/en/docs/tutorials/clusters/apparmor.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,18 @@ k8s-apparmor-example-deny-write (enforce)
First, we need to load the profile we want to use onto our nodes. The profile we'll use simply
denies all file writes:

{{< code language="text" file="deny-write.profile" >}}
```shell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tengqm . Just to be clear, why is the external .profile file a problem (besides that there is a build issue with recent versions of Hugo?).
This same issue was raised in PR #16151.
/lgtm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I didn't check the shortcode for code. It smells like a nit in the parsing logic for file name.
Since we already have codenew to replace code shortcode, I am not inclined to fix the code shortcode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbhawkey, @tengqm I agree that deny-write.profile has so few lines that it doesn't need to be a separate file. But I was curious.

This compile error appears starting with Hugo v0.56.0, which had a lot of changes to the codebase.

In the Kubernetes website code, neither the code nor codenew shortcodes could find deny-write.profile, which was in the same directory as apparmor.md (I tried several different things). To compile without error in Hugo v0.56+, I created a new directory:
content/en/examples/tutorials/clusters

Then moved deny-write.profile from content/en/docs/tutorials/clusters to the new directory since codenew looks for files in examples.

Finally I changed content/en/docs/tutorials/clusters/apparmor.md line 181 to use the codenew shortcode:
{{< codenew language="text" file="tutorials/clusters/deny-write.profile" >}}

#include <tunables/global>

profile k8s-apparmor-example-deny-write flags=(attach_disconnected) {
#include <abstractions/base>

file,

# Deny all file writes.
deny /** w,
}
```

Since we don't know where the Pod will be scheduled, we'll need to load the profile on all our
nodes. For this example we'll just use SSH to install the profiles, but other approaches are
Expand Down
10 changes: 0 additions & 10 deletions content/en/docs/tutorials/clusters/deny-write.profile

This file was deleted.

13 changes: 12 additions & 1 deletion content/ko/docs/tutorials/clusters/apparmor.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,18 @@ k8s-apparmor-example-deny-write (enforce)
먼저 노드에서 사용하려는 프로파일을 적재해야 한다. 사용할 프로파일은 단순히
파일 쓰기를 거부할 것이다.

{{< code language="text" file="deny-write.profile" >}}
```shell
#include <tunables/global>

profile k8s-apparmor-example-deny-write flags=(attach_disconnected) {
#include <abstractions/base>

file,

# Deny all file writes.
deny /** w,
}
```

파드를 언제 스케줄할지 알지 못하므로 모든 노드에 프로파일을 적재해야 한다.
이 예시에서는 SSH를 이용하여 프로파일을 설치할 것이나 다른 방법은
Expand Down
10 changes: 0 additions & 10 deletions content/ko/docs/tutorials/clusters/deny-write.profile

This file was deleted.