Skip to content

Commit

Permalink
Merge branch 'main' into v1.0.6
Browse files Browse the repository at this point in the history
Signed-off-by: Ratnakar <[email protected]>
  • Loading branch information
asararatnakar authored Oct 25, 2023
2 parents 97ebbcd + 26fa591 commit b04fbc9
Show file tree
Hide file tree
Showing 91 changed files with 7,169 additions and 253 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/image-build.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
tags: [v1.*]

env:
GO_VER: 1.18
GO_VER: 1.18.4
GO_TAGS: ""
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,3 @@ jobs:
run: scripts/check-license.sh
- name: gosec
run: scripts/go-sec.sh
- name: run tests
run: make test
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
ARG ARCH
ARG REGISTRY
ARG GO_VER

########## Build operator binary ##########
FROM registry.access.redhat.com/ubi8/go-toolset:$GO_VER as builder

COPY . /go/src/github.com/IBM-Blockchain/fabric-operator
WORKDIR /go/src/github.com/IBM-Blockchain/fabric-operator
RUN GOOS=linux GOARCH=${ARCH} CGO_ENABLED=1 go build -mod=vendor -tags "pkcs11" -gcflags all=-trimpath=${GOPATH} -asmflags all=-trimpath=${GOPATH} -o /tmp/build/_output/bin/ibp-operator
Expand All @@ -19,6 +18,7 @@ COPY definitions /definitions
COPY config/crd/bases /deploy/crds
COPY defaultconfig /defaultconfig
COPY docker-entrypoint.sh .

RUN microdnf update \
&& microdnf install -y \
shadow-utils \
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
|-------------------|-----------|----------------|
| Josh Kneubuhl | [@jkneubuh](https://github.com/jkneubuh) | jkneubuhl#5919 |
| Ratnakar Asara | [@asararatnakar](https://github.com/asararatnakar) | ratnakar#3494 |
| David Enyeart | [@denyeart](https://github.com/denyeart) | denyeart#0989 |
| Shoaeb Jindani | [@shoaebjindani](https://github.com/shoaebjindani) | shoaebmjindani#9890 |
51 changes: 18 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,39 @@
# limitations under the License.
#

IMAGE ?= ghcr.io/hyperledger-labs/fabric-operator
TAG ?= $(shell git rev-parse --short HEAD)
IMAGE ?= hyperledger-labs/fabric-operator
ARCH ?= $(shell go env GOARCH)
OSS_GO_VER ?= 1.18
BUILD_DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
OS = $(shell go env GOOS)
SEMREV_LABEL ?= v1.0.0-$(shell git rev-parse --short HEAD)
BUILD_DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
GO_VER ?= 1.18.4

DOCKER_IMAGE_REPO ?= ghcr.io
# For compatibility with legacy install-fabric.sh conventions, strip the
# leading semrev 'v' character when preparing dist and release artifacts.
VERSION=$(shell echo $(SEMREV_LABEL) | sed -e 's/^v\(.*\)/\1/')

BUILD_ARGS=--build-arg ARCH=$(ARCH)
BUILD_ARGS+=--build-arg BUILD_ID=$(TAG)
BUILD_ARGS+=--build-arg BUILD_DATE=$(BUILD_DATE)
BUILD_ARGS+=--build-arg GO_VER=$(OSS_GO_VER)

ifneq ($(origin TRAVIS_PULL_REQUEST),undefined)
ifneq ($(TRAVIS_PULL_REQUEST), false)
TAG=pr-$(TRAVIS_PULL_REQUEST)
endif
endif
DOCKER_BUILD ?= docker build

NAMESPACE ?= n$(shell echo $(TAG) | tr -d "-")
BUILD_ARGS+=--build-arg BUILD_ID=$(VERSION)
BUILD_ARGS+=--build-arg BUILD_DATE=$(BUILD_DATE)
BUILD_ARGS+=--build-arg GO_VER=$(GO_VER)

.PHONY: build

build: ## Builds the starter pack
build:
mkdir -p bin && go build -o bin/operator

image: setup
docker build --rm . -f Dockerfile $(BUILD_ARGS) -t $(IMAGE):$(TAG)-$(ARCH)
docker tag $(IMAGE):$(TAG)-$(ARCH) $(IMAGE):latest-$(ARCH)
$(DOCKER_BUILD) -f Dockerfile $(BUILD_ARGS) -t $(IMAGE) .

govendor:
@go mod vendor

setup: govendor manifests bundle generate

image-push:
docker push $(IMAGE):$(TAG)-$(ARCH)

image-push-latest:
docker push $(IMAGE):latest-$(ARCH)

login:
docker login --username $(DOCKER_USERNAME) --password $(DOCKER_PASSWORD) $(DOCKER_IMAGE_REPO)

#######################################
#### part of autogenerate makefile ####
Expand Down Expand Up @@ -152,18 +141,14 @@ fmt:
vet:
@scripts/checks.sh

# Run go sec against code
go-sec:
@scripts/go-sec.sh

# Generate code
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="boilerplate/boilerplate.go.txt" paths="./..."

# Build the docker image
docker-build: test
docker build . -t ${IMG}

# Push the docker image
docker-push:
docker push ${IMG}

# find or download controller-gen
# download controller-gen if necessary
controller-gen:
Expand All @@ -188,7 +173,7 @@ ifeq (, $(shell which kustomize))
KUSTOMIZE_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$KUSTOMIZE_GEN_TMP_DIR ;\
go mod init tmp ;\
go install sigs.k8s.io/kustomize/kustomize/v3@v3.5.4 ;\
go install sigs.k8s.io/kustomize/kustomize/v4@v4.5.7 ;\
rm -rf $$KUSTOMIZE_GEN_TMP_DIR ;\
}
KUSTOMIZE=$(GOBIN)/kustomize
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ _Fabric, Ahoy!_
- [x] It configures Fabric networks with native Fabric CLI binaries
- [x] It configures Fabric networks with CI/CD and git-ops best-practices
- [x] It deploys _Chaincode Now!!!_ (integrated `ccaas` and `k8s` external builders)
- [x] It detects expiring and expired x509 certificates
- [x] It detects and automatically re-enrolls TLS certificates
- [x] It will provide migration and future LTS revision support
- [x] It manages hybrid cloud, multi-org, and multi-cluster Fabric networks
- [x] It runs on pure containerd _and_ mobyd (no dependencies on Docker/DIND)
Expand All @@ -48,7 +48,6 @@ _Fabric, Ahoy!_
- [x] Metrics and observability with [Prometheus and Grafana](./docs/prometheus.md)
- [ ] Operational management: Log aggregation, monitoring, alerting
- [ ] Modular CAs (Fabric CA, cert-manager.io, Vault, letsencrypt, ...)
- [ ] Automatic x509 certificate renewal
- [ ] Backup / Recovery / Upgrade
- [ ] Idemixer, Token SDK, BFT Orderer
- [ ] Layer II blockchain integration (Cactus, Weaver, Token SDK, ...)
Expand All @@ -57,6 +56,7 @@ _Fabric, Ahoy!_

## Build a Fabric Network

- Build a [multi-org](sample-network-multi-org) network on a local KIND development cluster.
- Build a [sample-network](sample-network) with Kube APIs.
- [Build a Network](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-build-network) with the [Fabric Operations Console](https://github.com/hyperledger-labs/fabric-operations-console).
- Automate your network with [Ansible Playbooks](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ansible) and the Console REST APIs.
Expand Down
7 changes: 1 addition & 6 deletions bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=fabric-opensource-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.19.0+git
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.24.1
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/

# Copy files to locations specified by labels.
COPY bundle/manifests /manifests/
COPY bundle/metadata /metadata/
COPY bundle/tests/scorecard /tests/scorecard/
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ metadata:
containerImage: todo:update
createdAt: "2020-07-14T00:00:00Z"
description: TODO
operators.operatorframework.io/builder: operator-sdk-v1.19.0+git
operators.operatorframework.io/builder: operator-sdk-v1.24.1
operators.operatorframework.io/internal-objects: '["ibpcas.ibp.com","ibppeers.ibp.com","ibporderers.ibp.com"]'
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: ""
name: fabric-opensource-operator.v1.0.0
name: fabric-opensource-operator.v1.0.0-9726bb6
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1886,4 +1886,4 @@ spec:
maturity: alpha
provider:
name: Opensource
version: 1.0.0
version: 1.0.0-9726bb6
17 changes: 0 additions & 17 deletions bundle/manifests/ibp.com_ibpcas.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
17 changes: 0 additions & 17 deletions bundle/manifests/ibp.com_ibpconsoles.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
17 changes: 0 additions & 17 deletions bundle/manifests/ibp.com_ibporderers.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
17 changes: 0 additions & 17 deletions bundle/manifests/ibp.com_ibppeers.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down
6 changes: 1 addition & 5 deletions bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ annotations:
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: fabric-opensource-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.19.0+git
operators.operatorframework.io.metrics.builder: operator-sdk-v1.24.1
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
operators.operatorframework.io.test.config.v1: tests/scorecard/
17 changes: 0 additions & 17 deletions config/crd/bases/ibp.com_ibpcas.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
17 changes: 0 additions & 17 deletions config/crd/bases/ibp.com_ibpconsoles.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
17 changes: 0 additions & 17 deletions config/crd/bases/ibp.com_ibporderers.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
17 changes: 0 additions & 17 deletions config/crd/bases/ibp.com_ibppeers.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
#
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
Loading

0 comments on commit b04fbc9

Please sign in to comment.