Skip to content

Commit

Permalink
Remove SecurityContextConstraints parameter and references (#977)
Browse files Browse the repository at this point in the history
* remove references to scc creation

* rm commented tests

* rm unused functions
  • Loading branch information
celenechang authored Nov 10, 2023
1 parent 966cde5 commit d4a0ed3
Show file tree
Hide file tree
Showing 21 changed files with 2 additions and 982 deletions.
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ core,github.com/mailru/easyjson,MIT
core,github.com/matttproud/golang_protobuf_extensions/pbutil,Apache-2.0
core,github.com/modern-go/concurrent,Apache-2.0
core,github.com/modern-go/reflect2,Apache-2.0
core,github.com/openshift/api/security/v1,Apache-2.0
core,github.com/pkg/errors,BSD-2-Clause
core,github.com/pmezard/go-difflib/difflib,BSD-3-Clause
core,github.com/prometheus/client_golang/prometheus,Apache-2.0
Expand Down
18 changes: 0 additions & 18 deletions apis/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package v2alpha1

import (
securityv1 "github.com/openshift/api/security/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -944,10 +943,6 @@ type DatadogAgentComponentOverride struct {
// +listMapKey=name
Volumes []corev1.Volume `json:"volumes,omitempty"`

// Configure the SecurityContextConstraints for each component.
// +optional
SecurityContextConstraints *SecurityContextConstraintsConfig `json:"securityContextConstraints,omitempty"`

// Pod-level SecurityContext.
// +optional
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
Expand Down Expand Up @@ -992,19 +987,6 @@ type DatadogAgentComponentOverride struct {
Disabled *bool `json:"disabled,omitempty"`
}

// SecurityContextConstraintsConfig provides SecurityContextConstraints configurations for the components.
// +k8s:openapi-gen=true
type SecurityContextConstraintsConfig struct {
// Create defines whether to create a SecurityContextConstraints for the current component.
// If CustomConfiguration is not set, setting Create to `true` creates a default SCC.
// +optional
Create *bool `json:"create,omitempty"`

// CustomConfiguration defines a custom SCC configuration to use if Create is `true`.
// +optional
CustomConfiguration *securityv1.SecurityContextConstraints `json:"customConfiguration,omitempty"`
}

// DatadogAgentGenericContainer is the generic structure describing any container's common configuration.
// +k8s:openapi-gen=true
type DatadogAgentGenericContainer struct {
Expand Down
8 changes: 0 additions & 8 deletions apis/datadoghq/v2alpha1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,3 @@ func IsNetworkPolicyEnabled(dda *DatadogAgent) (bool, NetworkPolicyFlavor) {
}
return false, ""
}

// ShouldCreateSCC returns whether a scc should be created for a component
func ShouldCreateSCC(dda *DatadogAgent, componentName ComponentName) bool {
if dda.Spec.Override[componentName] != nil && dda.Spec.Override[componentName].SecurityContextConstraints != nil {
return apiutils.BoolValue(dda.Spec.Override[componentName].SecurityContextConstraints.Create)
}
return false
}
31 changes: 0 additions & 31 deletions apis/datadoghq/v2alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions apis/datadoghq/v2alpha1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d4a0ed3

Please sign in to comment.