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

support restricted option, jolokia agent, rbac, read only root, minimal #1037

Merged
merged 1 commit into from
Oct 25, 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
4 changes: 4 additions & 0 deletions api/v1beta1/activemqartemis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ type ActiveMQArtemisSpec struct {
// Specifies the template for various resources that the operator controls
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resource Templates"
ResourceTemplates []ResourceTemplate `json:"resourceTemplates,omitempty"`

// Restricted deployment, mtls jolokia agent with RBAC
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Restricted"
Restricted *bool `json:"restricted,omitempty"`
}

type AddressSettingsType struct {
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,9 @@ spec:
all resources
displayName: Selector
path: resourceTemplates[0].selector
- description: Restricted deployment, mtls jolokia agent with RBAC
displayName: Restricted
path: restricted
- description: Specifies the upgrades (deprecated in favour of Version)
displayName: Upgrades
path: upgrades
Expand Down
3 changes: 3 additions & 0 deletions bundle/manifests/broker.amq.io_activemqartemises.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4823,6 +4823,9 @@ spec:
type: object
type: object
type: array
restricted:
description: Restricted deployment, mtls jolokia agent with RBAC
type: boolean
upgrades:
description: Specifies the upgrades (deprecated in favour of Version)
properties:
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/broker.amq.io_activemqartemises.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4824,6 +4824,9 @@ spec:
type: object
type: object
type: array
restricted:
description: Restricted deployment, mtls jolokia agent with RBAC
type: boolean
upgrades:
description: Specifies the upgrades (deprecated in favour of Version)
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,9 @@ spec:
all resources
displayName: Selector
path: resourceTemplates[0].selector
- description: Restricted deployment, mtls jolokia agent with RBAC
displayName: Restricted
path: restricted
- description: Specifies the upgrades (deprecated in favour of Version)
displayName: Upgrades
path: upgrades
Expand Down
2 changes: 1 addition & 1 deletion controllers/activemqartemis_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (r *ActiveMQArtemisReconciler) Reconcile(ctx context.Context, request ctrl.

err = reconciler.Process(customResource, *namer, r.Client, r.Scheme)

if ProcessBrokerStatus(customResource, r.Client, r.Scheme) {
if reconciler.ProcessBrokerStatus(customResource, r.Client, r.Scheme) {
requeueRequest = true
}
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/activemqartemis_controller_cert_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (
rootCertNamespce = "cert-manager"
rootCertSecretName = "artemis-root-cert-secret"
caIssuerName = "broker-ca-issuer"
caPemTrustStoreName = "ca-truststore.pem"
caPemTrustStoreName = "ca.pem"
caTrustStorePassword = "changeit"
)

Expand All @@ -57,7 +57,7 @@ var (
rootIssuer = &cmv1.ClusterIssuer{}
rootCert = &cmv1.Certificate{}
caIssuer = &cmv1.ClusterIssuer{}
caBundleName = "ca-bundle"
caBundleName = "operator-ca"
)

type ConnectorConfig struct {
Expand Down
16 changes: 8 additions & 8 deletions controllers/activemqartemis_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7497,7 +7497,7 @@ var _ = Describe("artemis controller", func() {
Name: secretName,
Namespace: defaultNamespace,
}
secret, err := secrets.RetriveSecret(namespaceName, secretName, make(map[string]string), k8sClient)
secret, err := secrets.RetriveSecret(namespaceName, make(map[string]string), k8sClient)
g.Expect(err).To(BeNil())
data := secret.Data[envVar.ValueFrom.SecretKeyRef.Key]
//the value is a string of acceptors in xml format:
Expand Down Expand Up @@ -7552,7 +7552,7 @@ var _ = Describe("artemis controller", func() {
Name: secretName,
Namespace: defaultNamespace,
}
secret, err := secrets.RetriveSecret(namespaceName, secretName, make(map[string]string), k8sClient)
secret, err := secrets.RetriveSecret(namespaceName, make(map[string]string), k8sClient)
g.Expect(err).To(BeNil())
data := secret.Data[envVar.ValueFrom.SecretKeyRef.Key]
//the value is a string of acceptors in xml format:
Expand Down Expand Up @@ -7616,7 +7616,7 @@ var _ = Describe("artemis controller", func() {
Name: secretName,
Namespace: defaultNamespace,
}
secret, err := secrets.RetriveSecret(namespaceName, secretName, make(map[string]string), k8sClient)
secret, err := secrets.RetriveSecret(namespaceName, make(map[string]string), k8sClient)
g.Expect(err).To(BeNil())
data := secret.Data[envVar.ValueFrom.SecretKeyRef.Key]
//the value is a string of acceptors in xml format:
Expand Down Expand Up @@ -7679,12 +7679,12 @@ var _ = Describe("artemis controller", func() {
Name: secretName,
Namespace: defaultNamespace,
}
secret, err := secrets.RetriveSecret(namespaceName, secretName, make(map[string]string), k8sClient)
secret, err := secrets.RetriveSecret(namespaceName, make(map[string]string), k8sClient)
g.Expect(err).To(BeNil())
data := secret.Data[envVar.ValueFrom.SecretKeyRef.Key]
By("Checking data:" + string(data))
g.Expect(strings.Contains(string(data), "ACCEPTOR_IP:61666")).To(BeTrue())
checkSecretHasCorrectKeyValue(g, secretName, namespaceName, envVar.ValueFrom.SecretKeyRef.Key, "keyStoreProvider=SunJCE")
checkSecretHasCorrectKeyValue(g, namespaceName, envVar.ValueFrom.SecretKeyRef.Key, "keyStoreProvider=SunJCE")
}
}

Expand Down Expand Up @@ -7742,7 +7742,7 @@ var _ = Describe("artemis controller", func() {
//<acceptor name="new-acceptor">...</acceptor><another one>...
//we need to locate our target acceptor and do the check
//we use the port as a clue
checkSecretHasCorrectKeyValue(g, secretName, namespaceName, envVar.ValueFrom.SecretKeyRef.Key, "trustStoreType=JCEKS")
checkSecretHasCorrectKeyValue(g, namespaceName, envVar.ValueFrom.SecretKeyRef.Key, "trustStoreType=JCEKS")
found = true
}
}
Expand Down Expand Up @@ -7789,7 +7789,7 @@ var _ = Describe("artemis controller", func() {
Namespace: defaultNamespace,
}

secret, err := secrets.RetriveSecret(namespaceName, secretName, make(map[string]string), k8sClient)
secret, err := secrets.RetriveSecret(namespaceName, make(map[string]string), k8sClient)
g.Expect(err).Should(BeNil())

data := secret.Data[envVar.ValueFrom.SecretKeyRef.Key]
Expand Down Expand Up @@ -7848,7 +7848,7 @@ var _ = Describe("artemis controller", func() {
//<acceptor name="new-acceptor">...</acceptor><another one>...
//we need to locate our target acceptor and do the check
//we use the port as a clue
checkSecretHasCorrectKeyValue(g, secretName, namespaceName, envVar.ValueFrom.SecretKeyRef.Key, "trustStoreProvider=SUN")
checkSecretHasCorrectKeyValue(g, namespaceName, envVar.ValueFrom.SecretKeyRef.Key, "trustStoreProvider=SUN")
}
}
}, timeout, interval).Should(Succeed())
Expand Down
Loading
Loading