mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes dep to 1.24.0
As kubernetes 1.24.0 is released, updating kubernetes dependencies to 1.24.0 updates: #3086 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
fc1529f268
commit
c4f79d455f
19
vendor/k8s.io/kubernetes/pkg/util/selinux/doc.go
generated
vendored
19
vendor/k8s.io/kubernetes/pkg/util/selinux/doc.go
generated
vendored
@ -1,19 +0,0 @@
|
||||
/*
|
||||
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
39
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux.go
generated
vendored
@ -1,39 +0,0 @@
|
||||
/*
|
||||
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{}
|
||||
}
|
58
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux_linux.go
generated
vendored
58
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux_linux.go
generated
vendored
@ -1,58 +0,0 @@
|
||||
//go:build linux
|
||||
// +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)
|
||||
}
|
39
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux_unsupported.go
generated
vendored
39
vendor/k8s.io/kubernetes/pkg/util/selinux/selinux_unsupported.go
generated
vendored
@ -1,39 +0,0 @@
|
||||
//go:build !linux
|
||||
// +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
|
||||
}
|
10
vendor/k8s.io/kubernetes/pkg/util/taints/taints.go
generated
vendored
10
vendor/k8s.io/kubernetes/pkg/util/taints/taints.go
generated
vendored
@ -275,6 +275,16 @@ func TaintExists(taints []v1.Taint, taintToFind *v1.Taint) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// TaintKeyExists checks if the given taint key exists in list of taints. Returns true if exists false otherwise.
|
||||
func TaintKeyExists(taints []v1.Taint, taintKeyToMatch string) bool {
|
||||
for _, taint := range taints {
|
||||
if taint.Key == taintKeyToMatch {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func TaintSetDiff(t1, t2 []v1.Taint) (taintsToAdd []*v1.Taint, taintsToRemove []*v1.Taint) {
|
||||
for _, taint := range t1 {
|
||||
if !TaintExists(t2, &taint) {
|
||||
|
Reference in New Issue
Block a user