Skip to content

Commit

Permalink
Moved util/proc.go to util/proc/proc.go, added boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
MyIgel committed Mar 21, 2022
1 parent 07a79a0 commit f940a79
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cmd/executor/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/GoogleContainerTools/kaniko/pkg/logging"
"github.com/GoogleContainerTools/kaniko/pkg/timing"
"github.com/GoogleContainerTools/kaniko/pkg/util"
"github.com/GoogleContainerTools/kaniko/pkg/util/proc"
"github.com/containerd/containerd/platforms"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/pkg/errors"
Expand Down Expand Up @@ -233,7 +234,7 @@ func addHiddenFlags(cmd *cobra.Command) {
}

func checkContained() bool {
return util.GetContainerRuntime(0, 0) != util.RuntimeNotFound
return proc.GetContainerRuntime(0, 0) != proc.RuntimeNotFound
}

// cacheFlagsValid makes sure the flags passed in related to caching are valid
Expand Down
21 changes: 18 additions & 3 deletions pkg/util/proc.go → pkg/util/proc/proc.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
// Package util proc provides tools for inspecting proc.
package util
/*
Copyright 2022 Google LLC
// Part of https://github.com/genuinetools/bpfd/blob/a4bfa5e3e9d1bfdbc56268a36a0714911ae9b6bf/proc/proc.go
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Ported from https://github.com/genuinetools/bpfd/blob/a4bfa5e3e9d1bfdbc56268a36a0714911ae9b6bf/proc/proc.go

package proc

import (
"fmt"
Expand Down
18 changes: 17 additions & 1 deletion pkg/util/proc_test.go → pkg/util/proc/proc_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
package util
/*
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package proc

import (
"testing"
Expand Down

0 comments on commit f940a79

Please sign in to comment.