mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: bump k8s.io/kubernetes from 1.22.3 to 1.22.4
Bumps [k8s.io/kubernetes](https://github.com/kubernetes/kubernetes) from 1.22.3 to 1.22.4. - [Release notes](https://github.com/kubernetes/kubernetes/releases) - [Commits](https://github.com/kubernetes/kubernetes/compare/v1.22.3...v1.22.4) --- updated-dependencies: - dependency-name: k8s.io/kubernetes dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
929e17d21b
commit
b2099eb3b1
19
vendor/k8s.io/kubernetes/pkg/util/selinux/doc.go
generated
vendored
Normal file
19
vendor/k8s.io/kubernetes/pkg/util/selinux/doc.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
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 selinux contains wrapper functions for the libcontainer SELinux
|
||||
// package. A NOP implementation is provided for non-linux platforms.
|
||||
package selinux // import "k8s.io/kubernetes/pkg/util/selinux"
|
39
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux.go
generated
vendored
Normal file
39
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux.go
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright 2014 The Kubernetes Authors.
|
||||
|
||||
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 selinux
|
||||
|
||||
// Note: the libcontainer SELinux package is only built for Linux, so it is
|
||||
// necessary to have a NOP wrapper which is built for non-Linux platforms to
|
||||
// allow code that links to this package not to differentiate its own methods
|
||||
// for Linux and non-Linux platforms.
|
||||
//
|
||||
// SELinuxRunner wraps certain libcontainer SELinux calls. For more
|
||||
// information, see:
|
||||
//
|
||||
// https://github.com/opencontainers/runc/blob/master/libcontainer/selinux/selinux.go
|
||||
type SELinuxRunner interface {
|
||||
// Getfilecon returns the SELinux context for the given path or returns an
|
||||
// error.
|
||||
Getfilecon(path string) (string, error)
|
||||
}
|
||||
|
||||
// NewSELinuxRunner returns a new SELinuxRunner appropriate for the platform.
|
||||
// On Linux, all methods short-circuit and return NOP values if SELinux is
|
||||
// disabled. On non-Linux platforms, a NOP implementation is returned.
|
||||
func NewSELinuxRunner() SELinuxRunner {
|
||||
return &realSELinuxRunner{}
|
||||
}
|
57
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux_linux.go
generated
vendored
Normal file
57
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux_linux.go
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
// +build linux
|
||||
|
||||
/*
|
||||
Copyright 2014 The Kubernetes Authors.
|
||||
|
||||
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 selinux
|
||||
|
||||
import (
|
||||
selinux "github.com/opencontainers/selinux/go-selinux"
|
||||
)
|
||||
|
||||
// SELinuxEnabled returns whether SELinux is enabled on the system. SELinux
|
||||
// has a tri-state:
|
||||
//
|
||||
// 1. disabled: SELinux Kernel modules not loaded, SELinux policy is not
|
||||
// checked during Kernel MAC checks
|
||||
// 2. enforcing: Enabled; SELinux policy violations are denied and logged
|
||||
// in the audit log
|
||||
// 3. permissive: Enabled, but SELinux policy violations are permitted and
|
||||
// logged in the audit log
|
||||
//
|
||||
// SELinuxEnabled returns true if SELinux is enforcing or permissive, and
|
||||
// false if it is disabled.
|
||||
func SELinuxEnabled() bool {
|
||||
return selinux.GetEnabled()
|
||||
}
|
||||
|
||||
// realSELinuxRunner is the real implementation of SELinuxRunner interface for
|
||||
// Linux.
|
||||
type realSELinuxRunner struct{}
|
||||
|
||||
var _ SELinuxRunner = &realSELinuxRunner{}
|
||||
|
||||
func (_ *realSELinuxRunner) Getfilecon(path string) (string, error) {
|
||||
if !SELinuxEnabled() {
|
||||
return "", nil
|
||||
}
|
||||
return selinux.FileLabel(path)
|
||||
}
|
||||
|
||||
// SetFileLabel applies the SELinux label on the path or returns an error.
|
||||
func SetFileLabel(path string, label string) error {
|
||||
return selinux.SetFileLabel(path, label)
|
||||
}
|
38
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux_unsupported.go
generated
vendored
Normal file
38
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux_unsupported.go
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
// +build !linux
|
||||
|
||||
/*
|
||||
Copyright 2014 The Kubernetes Authors.
|
||||
|
||||
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 selinux
|
||||
|
||||
// SELinuxEnabled always returns false on non-linux platforms.
|
||||
func SELinuxEnabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// realSELinuxRunner is the NOP implementation of the SELinuxRunner interface.
|
||||
type realSELinuxRunner struct{}
|
||||
|
||||
var _ SELinuxRunner = &realSELinuxRunner{}
|
||||
|
||||
func (_ *realSELinuxRunner) Getfilecon(path string) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// FileLabel returns the SELinux label for this path or returns an error.
|
||||
func SetFileLabel(path string, label string) error {
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user