Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use roles instead of cluster roles for SBJ #301

Merged
merged 1 commit into from
Apr 24, 2024
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 api/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ExternalAccess struct {
type MonitoringConfig struct {
// If true, the Operator will create monitoring resources
//+kubebuilder:validation:XValidation:rule=(self || !oldSelf),message=Feature cannot be disabled
//+kubebuilder:default:=false
//+kubebuilder:default:=true
Enabled bool `json:"enabled"`
}

Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/fulcio_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var _ = Describe("Fulcio", func() {
validObject.Spec.Config.MetaIssuers = []OIDCIssuer{
{
ClientID: "client",
Type: "email",
Type: "email",
},
}

Expand Down
4 changes: 0 additions & 4 deletions api/v1alpha1/securesign_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ type SecuresignSpec struct {
Rekor RekorSpec `json:"rekor,omitempty"`
Fulcio FulcioSpec `json:"fulcio,omitempty"`
Trillian TrillianSpec `json:"trillian,omitempty"`
// If true, the Operator will create segment backup job and cronjob and required RBAC
//+kubebuilder:validation:XValidation:rule=(self || !oldSelf),message=Feature cannot be disabled
//+kubebuilder:default:=false
Analytics bool `json:"analytics"`
//+kubebuilder:default:={keys:{{name: rekor.pub},{name: ctfe.pub},{name: fulcio_v1.crt.pem}}}
Tuf TufSpec `json:"tuf,omitempty"`
Ctlog CTlogSpec `json:"ctlog,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions bundle/manifests/rhtas-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ metadata:
"enabled": true
},
"monitoring": {
"enabled": false
"enabled": true
}
},
"rekor": {
"externalAccess": {
"enabled": true
},
"monitoring": {
"enabled": false
"enabled": true
}
},
"trillian": {
Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/rhtas.redhat.com_fulcios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ spec:
description: Enable Service monitors for fulcio
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring resources
type: boolean
x-kubernetes-validations:
Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/rhtas.redhat.com_rekors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
description: Enable Service monitors for rekor
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring resources
type: boolean
x-kubernetes-validations:
Expand Down
4 changes: 2 additions & 2 deletions bundle/manifests/rhtas.redhat.com_securesigns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ spec:
description: Enable Service monitors for fulcio
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring
resources
type: boolean
Expand Down Expand Up @@ -443,7 +443,7 @@ spec:
description: Enable Service monitors for rekor
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring
resources
type: boolean
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/rhtas.redhat.com_ctlogs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
description: Enable Service monitors for ctlog
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring resources
type: boolean
x-kubernetes-validations:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/rhtas.redhat.com_fulcios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ spec:
description: Enable Service monitors for fulcio
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring resources
type: boolean
x-kubernetes-validations:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/rhtas.redhat.com_rekors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
description: Enable Service monitors for rekor
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring resources
type: boolean
x-kubernetes-validations:
Expand Down
18 changes: 4 additions & 14 deletions config/crd/bases/rhtas.redhat.com_securesigns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,14 @@ spec:
spec:
description: SecuresignSpec defines the desired state of Securesign
properties:
analytics:
default: false
description: If true, the Operator will create segment backup job
and cronjob and required RBAC
type: boolean
x-kubernetes-validations:
- message: Feature cannot be disabled
rule: (self || !oldSelf)
ctlog:
description: CTlogSpec defines the desired state of CTlog component
properties:
monitoring:
description: Enable Service monitors for ctlog
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring
resources
type: boolean
Expand Down Expand Up @@ -371,7 +363,7 @@ spec:
description: Enable Service monitors for fulcio
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring
resources
type: boolean
Expand Down Expand Up @@ -443,7 +435,7 @@ spec:
description: Enable Service monitors for rekor
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring
resources
type: boolean
Expand Down Expand Up @@ -641,7 +633,7 @@ spec:
description: Enable Monitoring for Logsigner and Logserver
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring
resources
type: boolean
Expand Down Expand Up @@ -723,8 +715,6 @@ spec:
minimum: 1
type: integer
type: object
required:
- analytics
type: object
status:
description: SecuresignStatus defines the observed state of Securesign
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/rhtas.redhat.com_trillians.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ spec:
description: Enable Monitoring for Logsigner and Logserver
properties:
enabled:
default: false
default: true
description: If true, the Operator will create monitoring resources
type: boolean
x-kubernetes-validations:
Expand Down
11 changes: 11 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ rules:
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- prometheuses/api
verbs:
- create
- get
- update
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down Expand Up @@ -233,6 +241,7 @@ rules:
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
Expand All @@ -245,6 +254,7 @@ rules:
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
Expand All @@ -257,6 +267,7 @@ rules:
verbs:
- create
- delete
- deletecollection
JasonPowr marked this conversation as resolved.
Show resolved Hide resolved
- get
- list
- patch
Expand Down
7 changes: 4 additions & 3 deletions config/samples/rhtas_v1alpha1_securesign.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ metadata:
app.kubernetes.io/name: securesign-sample
app.kubernetes.io/instance: securesign-sample
app.kubernetes.io/part-of: trusted-artifact-signer
annotations:
rhtas.redhat.com/metrics: "true"
name: securesign-sample
namespace: rhtas-operator
spec:
rekor:
externalAccess:
enabled: true
monitoring:
enabled: false
enabled: true
trillian:
database:
create: true
Expand All @@ -30,7 +31,7 @@ spec:
organizationEmail: jdoe@redhat.com
commonName: fulcio.hostname
monitoring:
enabled: false
enabled: true
tuf:
externalAccess:
enabled: true
Expand Down
Loading
Loading