Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.23
go-version: 1.25

- name: Install Kubebuilder
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.23 as builder
FROM golang:1.25 as builder

# Copy everything in the go src
WORKDIR /go/src/cdap.io/cdap-operator
Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha1/cdapmaster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ type SecurityContext struct {
// FSGroup mounts volumes as the specified group ID and gives the primary user access
// to that group. It is applied at the pod level.
FSGroup *int64 `json:"fsGroup,omitempty"`
// FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
// before being mounted. Refer to official Kubernetes docs.
// +kubebuilder:validation:Enum=Always;OnRootMismatch
FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"`
// AllowPrivilegeEscalation prevents the container process from running SUID binaries.
// It is applied at the container level.
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

128 changes: 128 additions & 0 deletions config/crd/bases/cdap.cdap.io_cdapmasters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4380,6 +4380,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -7214,6 +7222,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -10047,6 +10063,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -12884,6 +12908,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -15845,6 +15877,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -18677,6 +18717,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -21510,6 +21558,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -24331,6 +24387,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -28525,6 +28589,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -31369,6 +31441,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -34206,6 +34286,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -34305,6 +34393,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -37097,6 +37193,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -39933,6 +40037,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -42766,6 +42878,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down Expand Up @@ -45610,6 +45730,14 @@ spec:
to that group. It is applied at the pod level.
format: int64
type: integer
fsGroupChangePolicy:
description: |-
FSGroupChangePolicy defines behavior of changing ownership and permission of the volume
before being mounted. Refer to official Kubernetes docs.
enum:
- Always
- OnRootMismatch
type: string
privileged:
description: |-
Privileged runs container in privileged mode. It is applied at the container level.
Expand Down
26 changes: 1 addition & 25 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- create
Expand All @@ -34,6 +21,7 @@ rules:
- apps
resources:
- deployments
- statefulsets
verbs:
- create
- delete
Expand All @@ -50,18 +38,6 @@ rules:
- get
- patch
- update
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
Expand Down
8 changes: 8 additions & 0 deletions controllers/testdata/cdap_master_cr.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@
"memory": "100Mi"
}
},
"securityContext": {
"runAsUser": 1000,
"runAsGroup": 1000,
"fsGroup": 2000,
"fsGroupChangePolicy": "OnRootMismatch",
"runAsNonRoot": true,
"allowPrivilegeEscalation": false
},
"storageSize": "100Gi"
},
"messaging": {
Expand Down
1 change: 1 addition & 0 deletions controllers/testdata/logs.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"schedulerName": "default-scheduler",
"securityContext": {
"fsGroup": 2000,
"fsGroupChangePolicy": "OnRootMismatch",
"runAsGroup": 1000,
"runAsUser": 1000,
"runAsNonRoot": true
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cdap.io/cdap-operator

go 1.23
go 1.25.0

require (
github.com/go-logr/logr v1.2.3
Expand Down Expand Up @@ -59,12 +59,12 @@ require (
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
golang.org/x/crypto v0.53.0 // indirect
golang.org/x/net v0.56.0 // indirect
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
golang.org/x/sys v0.0.0-20221013171732-95e765b1cc43 // indirect
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
golang.org/x/text v0.3.8 // indirect
golang.org/x/sys v0.46.0 // indirect
golang.org/x/term v0.44.0 // indirect
golang.org/x/text v0.38.0 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
Loading
Loading