Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
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
14 changes: 14 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ jobs:
restore-keys: go-
- run: make check-log-lines

verify-config-template:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: go-${{ hashFiles('**/go.sum') }}
restore-keys: go-
- run: make check-config-template

get-script:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ check-log-lines:
./hack/log-capitalized.sh
./hack/tree_status.sh

check-config-template:
./hack/validate-config.sh

shellfiles: ${SHFMT}
$(eval SHELLFILES=$(shell ${SHFMT} -f . | grep -v vendor/ | grep -v hack/lib | grep -v hack/build-rpms.sh))

Expand Down
4 changes: 4 additions & 0 deletions hack/validate-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
if grep -q 'Comment' pkg/config/template.go | grep -vq '{{ $.Comment }}'; then
exit 1
fi
3 changes: 3 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const (
// Config represents the entire set of configuration values that can be set for
// the server. This is intended to be loaded from a toml-encoded config file.
type Config struct {
Comment string
singleConfigPath string // Path to the single config file
dropInConfigDir string // Path to the drop-in config files

Expand Down Expand Up @@ -558,6 +559,7 @@ func (t *tomlConfig) SetSystemContext(c *Config) {
}

func (t *tomlConfig) toConfig(c *Config) {
c.Comment = "# "
c.RootConfig = t.Crio.RootConfig
c.APIConfig = t.Crio.API.APIConfig
c.RuntimeConfig = t.Crio.Runtime.RuntimeConfig
Expand Down Expand Up @@ -713,6 +715,7 @@ func DefaultConfig() (*Config, error) {
}
cgroupManager := cgmgr.New()
return &Config{
Comment: "# ",
SystemContext: &types.SystemContext{
DockerRegistryUserAgent: useragent.Get(),
},
Expand Down
Loading