mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
build: move e2e dependencies into e2e/go.mod
Several packages are only used while running the e2e suite. These packages are less important to update, as the they can not influence the final executable that is part of the Ceph-CSI container-image. By moving these dependencies out of the main Ceph-CSI go.mod, it is easier to identify if a reported CVE affects Ceph-CSI, or only the testing (like most of the Kubernetes CVEs). Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
15da101b1b
commit
bec6090996
88
e2e/vendor/k8s.io/component-base/tracing/api/v1/config.go
generated
vendored
Normal file
88
e2e/vendor/k8s.io/component-base/tracing/api/v1/config.go
generated
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
Copyright 2021 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 v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
"k8s.io/component-base/featuregate"
|
||||
)
|
||||
|
||||
var (
|
||||
maxSamplingRatePerMillion = int32(1000000)
|
||||
)
|
||||
|
||||
// ValidateTracingConfiguration validates the tracing configuration
|
||||
func ValidateTracingConfiguration(traceConfig *TracingConfiguration, featureGate featuregate.FeatureGate, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if traceConfig == nil {
|
||||
return allErrs
|
||||
}
|
||||
if traceConfig.SamplingRatePerMillion != nil {
|
||||
allErrs = append(allErrs, validateSamplingRate(*traceConfig.SamplingRatePerMillion, fldPath.Child("samplingRatePerMillion"))...)
|
||||
}
|
||||
if traceConfig.Endpoint != nil {
|
||||
allErrs = append(allErrs, validateEndpoint(*traceConfig.Endpoint, fldPath.Child("endpoint"))...)
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func validateSamplingRate(rate int32, fldPath *field.Path) field.ErrorList {
|
||||
errs := field.ErrorList{}
|
||||
if rate < 0 {
|
||||
errs = append(errs, field.Invalid(
|
||||
fldPath, rate,
|
||||
"sampling rate must be positive",
|
||||
))
|
||||
}
|
||||
if rate > maxSamplingRatePerMillion {
|
||||
errs = append(errs, field.Invalid(
|
||||
fldPath, rate,
|
||||
"sampling rate per million must be less than or equal to one million",
|
||||
))
|
||||
}
|
||||
return errs
|
||||
}
|
||||
|
||||
func validateEndpoint(endpoint string, fldPath *field.Path) field.ErrorList {
|
||||
errs := field.ErrorList{}
|
||||
if !strings.Contains(endpoint, "//") {
|
||||
endpoint = "dns://" + endpoint
|
||||
}
|
||||
url, err := url.Parse(endpoint)
|
||||
if err != nil {
|
||||
errs = append(errs, field.Invalid(
|
||||
fldPath, endpoint,
|
||||
err.Error(),
|
||||
))
|
||||
return errs
|
||||
}
|
||||
switch url.Scheme {
|
||||
case "dns":
|
||||
case "unix":
|
||||
case "unix-abstract":
|
||||
default:
|
||||
errs = append(errs, field.Invalid(
|
||||
fldPath, endpoint,
|
||||
fmt.Sprintf("unsupported scheme: %v. Options are none, dns, unix, or unix-abstract. See https://github.com/grpc/grpc/blob/master/doc/naming.md", url.Scheme),
|
||||
))
|
||||
}
|
||||
return errs
|
||||
}
|
29
e2e/vendor/k8s.io/component-base/tracing/api/v1/doc.go
generated
vendored
Normal file
29
e2e/vendor/k8s.io/component-base/tracing/api/v1/doc.go
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2022 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.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
// Package v1 contains the configuration API for tracing.
|
||||
//
|
||||
// The intention is to only have a single version of this API, potentially with
|
||||
// new fields added over time in a backwards-compatible manner. Fields for
|
||||
// alpha or beta features are allowed as long as they are defined so that not
|
||||
// changing the defaults leaves those features disabled.
|
||||
//
|
||||
// The "v1" package name is just a reminder that API compatibility rules apply,
|
||||
// not an indication of the stability of all features covered by it.
|
||||
|
||||
package v1 // import "k8s.io/component-base/tracing/api/v1"
|
32
e2e/vendor/k8s.io/component-base/tracing/api/v1/types.go
generated
vendored
Normal file
32
e2e/vendor/k8s.io/component-base/tracing/api/v1/types.go
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
Copyright 2022 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 v1
|
||||
|
||||
// TracingConfiguration provides versioned configuration for OpenTelemetry tracing clients.
|
||||
type TracingConfiguration struct {
|
||||
// Endpoint of the collector this component will report traces to.
|
||||
// The connection is insecure, and does not currently support TLS.
|
||||
// Recommended is unset, and endpoint is the otlp grpc default, localhost:4317.
|
||||
// +optional
|
||||
Endpoint *string `json:"endpoint,omitempty"`
|
||||
|
||||
// SamplingRatePerMillion is the number of samples to collect per million spans.
|
||||
// Recommended is unset. If unset, sampler respects its parent span's sampling
|
||||
// rate, but otherwise never samples.
|
||||
// +optional
|
||||
SamplingRatePerMillion *int32 `json:"samplingRatePerMillion,omitempty"`
|
||||
}
|
48
e2e/vendor/k8s.io/component-base/tracing/api/v1/zz_generated.deepcopy.go
generated
vendored
Normal file
48
e2e/vendor/k8s.io/component-base/tracing/api/v1/zz_generated.deepcopy.go
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 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.
|
||||
*/
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TracingConfiguration) DeepCopyInto(out *TracingConfiguration) {
|
||||
*out = *in
|
||||
if in.Endpoint != nil {
|
||||
in, out := &in.Endpoint, &out.Endpoint
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.SamplingRatePerMillion != nil {
|
||||
in, out := &in.SamplingRatePerMillion, &out.SamplingRatePerMillion
|
||||
*out = new(int32)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TracingConfiguration.
|
||||
func (in *TracingConfiguration) DeepCopy() *TracingConfiguration {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TracingConfiguration)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
Reference in New Issue
Block a user