Skip to content

Commit

Permalink
Merge branch 'main' into feature/propose-jgroup-port
Browse files Browse the repository at this point in the history
  • Loading branch information
johgoe authored Jan 2, 2024
2 parents 23b1e46 + 1b2280d commit aa5aaf1
Show file tree
Hide file tree
Showing 48 changed files with 7,316 additions and 397 deletions.
22 changes: 1 addition & 21 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,8 @@ name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: RoddieKieley

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Get X version of the source
2. '...'

**Platform (please complete the following information):**
- OS: [e.g. Fedora]
- Version [e.g. 32]
- Go [e.g. 1.13.4

**Expected behavior**
Optional, use if not obvious. A clear and concise description of what you expected to happen.

**Screenshots**
Optional, add screenshots to help explain your problem.

**Additional context**
Optional. Add any other context about the problem here.
Please provide a clear and concise description of what the bug is or a description of how to reproduce
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ jobs:

steps:
- name: Install prerequisites
run: sudo apt-get install pass
run: >
sudo apt-get update &&
sudo apt-get install pass
- name: Checkout the repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -107,6 +109,7 @@ jobs:
-d "$(jq -c -n --arg tag_name "${RELEASE_TAG}" '{"tag_name":$tag_name,"generate_release_notes":true}')" | jq -r '.id')
RELEASE_PACKAGE="activemq-artemis-operator-${RELEASE_TAG}"
INSTALL_YAML="activemq-artemis-operator.yaml"
rm -rf /tmp/${RELEASE_PACKAGE}
mkdir -p /tmp/${RELEASE_PACKAGE}
cp -r deploy/* /tmp/${RELEASE_PACKAGE}
Expand All @@ -118,3 +121,6 @@ jobs:
curl -v -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.BOT_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" -H "Content-Type: application/octet-stream" \
"https://uploads.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets?name=${RELEASE_PACKAGE}.zip" --data-binary "@/tmp/${RELEASE_PACKAGE}.zip"
curl -v -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.BOT_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" -H "Content-Type: text/plain" \
"https://uploads.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}/assets?name=${INSTALL_YAML}" --data "@/tmp/${RELEASE_PACKAGE}/${INSTALL_YAML}"
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM registry.access.redhat.com/ubi8/go-toolset:1.19 as builder

ARG TARGETOS
ARG TARGETARCH
Expand Down Expand Up @@ -28,17 +28,16 @@ COPY pkg/ pkg/
COPY version/ version/
### END REMOTE SOURCE

# Set up the workspace
RUN mkdir -p /workspace
RUN mv $REMOTE_SOURCE_DIR/app /workspace
WORKDIR /workspace/app
# Set up the workdir
WORKDIR /opt/app-root/src
RUN cp -r $REMOTE_SOURCE_DIR/app/* .

# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -ldflags="-X '${GO_MODULE}/version.BuildTimestamp=`date '+%Y-%m-%dT%H:%M:%S'`'" -o /workspace/manager main.go
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -ldflags="-X '${GO_MODULE}/version.BuildTimestamp=`date '+%Y-%m-%dT%H:%M:%S'`'" -o manager main.go

FROM registry.access.redhat.com/ubi8:8.6-855 as base-env

Expand All @@ -54,10 +53,10 @@ WORKDIR /
RUN mkdir -p ${USER_HOME}/bin

# Copy the manager binary
COPY --from=builder /workspace/manager ${OPERATOR}
COPY --from=builder /opt/app-root/src/manager ${OPERATOR}

# Copy the entrypoint script
COPY --from=builder /workspace/app/entrypoint/entrypoint ${USER_HOME}/bin/entrypoint
COPY --from=builder /opt/app-root/src/entrypoint/entrypoint ${USER_HOME}/bin/entrypoint

# Set operator bin owner and permissions
RUN chown -R `id -u`:0 ${USER_HOME}/bin && chmod -R 755 ${USER_HOME}/bin
Expand All @@ -71,4 +70,4 @@ ENTRYPOINT ["${USER_HOME}/bin/entrypoint"]
LABEL name="artemiscloud/activemq-artemis-operator"
LABEL description="ActiveMQ Artemis Broker Operator"
LABEL maintainer="Roddie Kieley <rkieley@redhat.com>"
LABEL version="1.0.15"
LABEL version="1.0.16"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 1.0.15
VERSION ?= 1.0.16

KUBE_CLI=kubectl
OPERATOR_VERSION := 1.0.15
OPERATOR_VERSION := 1.0.16
OPERATOR_ACCOUNT_NAME := activemq-artemis-operator
OPERATOR_CLUSTER_ROLE_NAME := operator-role
OPERATOR_IMAGE_REPO := quay.io/artemiscloud/activemq-artemis-operator
Expand Down
37 changes: 35 additions & 2 deletions api/v1beta1/activemqartemis_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
corev1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
Expand Down Expand Up @@ -67,6 +68,9 @@ type ActiveMQArtemisSpec struct {
// The ingress domain to expose the application. By default, on Kubernetes it is apps.artemiscloud.io and on OpenShift it is the Ingress Controller domain.
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Ingress Domain",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
IngressDomain string `json:"ingressDomain,omitempty"`
// Specifies the template for various resources that the operator controls
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resource Templates"
ResourceTemplates []ResourceTemplate `json:"resourceTemplates,omitempty"`
}

type AddressSettingsType struct {
Expand Down Expand Up @@ -349,7 +353,7 @@ type DeploymentPlanType struct {
// Specifies the tolerations
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Tolerations"
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// Assign labels to a broker pod, the keys `ActiveMQArtemis` and `application` are not allowed
// Assign labels to broker pods, the keys `ActiveMQArtemis` and `application` are not allowed
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Labels"
Labels map[string]string `json:"labels,omitempty"`
// Specifies the node selector
Expand All @@ -361,7 +365,7 @@ type DeploymentPlanType struct {
// Specifies the pod security context
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Pod Security Context"
PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`
// Custom annotations to be added to broker pod
// Custom annotations to be added to broker pods
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Annotations"
Annotations map[string]string `json:"annotations,omitempty"`
// Specifies the pod disruption budget
Expand All @@ -372,6 +376,35 @@ type DeploymentPlanType struct {
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
}

type ResourceTemplate struct {
// Select which resources to match, an empty selector will match all resources
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Selector"
Selector *ResourceSelector `json:"selector,omitempty"`

// Custom annotations
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Annotations"
Annotations map[string]string `json:"annotations,omitempty"`

// Custom labels
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Labels"
Labels map[string]string `json:"labels,omitempty"`

// Custom attributes applied as strategic merge patch by the operator
//+kubebuilder:pruning:PreserveUnknownFields
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Patch"
Patch *unstructured.Unstructured `json:"patch,omitempty"`
}

// match criteria to restrict the selection of resources
type ResourceSelector struct {
// APIGroup is the group version string of resources to match
APIGroup *string `json:"apiGroup,omitempty"`
// Kind is the type of resources to match
Kind *string `json:"kind,omitempty"`
// Name is the pattern matcher for the Name of resources to match
Name *string `json:"name,omitempty"`
}

// Affinity is a group of affinity scheduling rules.
type AffinityConfig struct {
// Describes node affinity scheduling rules for the pod.
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/activemqartemissecurity_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ type ConnectorConfigType struct {
// Whether management connection is secured
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Secured",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
Secured *bool `json:"secured,omitempty"`
// The keystore type for management connector
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="KeyStore Type",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
KeyStoreType *string `json:"keyStoreType,omitempty"`
// The keystore provider for management connector
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="KeyStore Provider",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
KeyStoreProvider *string `json:"keyStoreProvider,omitempty"`
Expand All @@ -337,6 +340,9 @@ type ConnectorConfigType struct {
// The keystore password for management connector
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="KeyStore Password",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
KeyStorePassword *string `json:"keyStorePassword,omitempty"`
// The truststore type for management connector
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="TrustStore Type",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
TrustStoreType *string `json:"trustStoreType,omitempty"`
// The truststore provider for management connector
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="TrustStore Provider",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
TrustStoreProvider *string `json:"trustStoreProvider,omitempty"`
Expand Down
2 changes: 0 additions & 2 deletions api/v1beta1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
admissionv1beta1 "k8s.io/api/admission/v1beta1"
//+kubebuilder:scaffold:imports
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
Expand All @@ -43,7 +42,6 @@ import (
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.

var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment
var ctx context.Context
Expand Down
85 changes: 85 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.

Loading

0 comments on commit aa5aaf1

Please sign in to comment.