Skip to content

Commit

Permalink
Automated merge
Browse files Browse the repository at this point in the history
* upstream/main: (45 commits)
  Replace `manager` with `sail-operator` for the binary name
  Fix the update location for the rbac proxy
  Add the make clean target
  Improve kubectl utility in e2e tests (istio-ecosystem#394)
  Don't add istiod-remote chart when updating latest version (istio-ecosystem#396)
  Make patch-csv.sh more readable
  Fix patch-csv.sh so that it finds hub, image, and tag in newer Istio versions
  Ensure Primary-Remote e2e test is also skipped for 1.24 pre-release versions
  Print Istio CNI logs when test fails
  Temporarily disable RemoteIstio tests for 1.24+
  Make gen
  Add generics to EnqueueEventLogger and AdditionNotifierQueue
  Update Istio versions
  Remove reference to istiod-remote chart
  Ensure crd-all.gen.yaml file is found in newer and older Istio versions
  Add Helm artifacts publish automation (istio-ecosystem#385)
  Simplify supportedversion.go and add unit tests (istio-ecosystem#391)
  Clean up code (istio-ecosystem#392)
  Implement e2e dualStack data plane tests (istio-ecosystem#383)
  Fix error handling in deployBookinfo (istio-ecosystem#384)
  ...
  • Loading branch information
openshift-service-mesh-bot committed Oct 9, 2024
2 parents 64a14b8 + 3656ec9 commit 118cd12
Show file tree
Hide file tree
Showing 625 changed files with 15,560 additions and 4,872 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "istio build-tools",
"image": "gcr.io/istio-testing/build-tools:master-0aa2afb4bac9a4fd1bfe50a929c077a643066b3a",
"image": "gcr.io/istio-testing/build-tools:master-8463430ba963638b35745d773045701f6d02014d",
"privileged": true,
"remoteEnv": {
"USE_GKE_GCLOUD_AUTH_PLUGIN": "True",
Expand Down
40 changes: 40 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://github.com/istio-ecosystem/sail-operator/blob/main/CONTRIBUTING.md
2. Discuss your changes before you start working on them. You can open a new issue in the [Sail Operator GitHub repository](https://github.com/istio-ecosystem/sail-operator/issues) or start a discussion in the [Sail Operator Discussion](https://github.com/istio-ecosystem/sail-operator/discussions). By this way, you can get feedback from the community and ensure that your changes are aligned with the project goals.
3. If the PR is unfinished, make is as a draft.
-->

#### What type of PR is this?
<!--
In order to minimize the time taken to categorize your PR, add a label accoutring to the PR type defined above.
Please, use the following labels, according to the PR type:
* Enhancement / New Feature - enhancement
* Bug Fix - bug
* Refactor - cleanup/refactor
* Optimization - enhancement
* Test - test-e2e
* Documentation Update - documentation
-->

- [ ] Enhancement / New Feature
- [ ] Bug Fix
- [ ] Refactor
- [ ] Optimization
- [ ] Test
- [ ] Documentation Update

#### What this PR does / why we need it:


#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
Add related issue or PR if exists.
-->
Fixes #

Related Issue/PR #

#### Additional information:
32 changes: 32 additions & 0 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Helm artifact

on:
workflow_dispatch:
inputs:
release_version:
description: "Release version"
required: true

run-name: Publish Helm artifact ${{ inputs.release_version }}

env:
GIT_USER: ${{ secrets.GIT_USER }}
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
VERSION: ${{ inputs.release_version }}

jobs:
helm:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Publish Helm artifact to "gh-pages" branch
run: |
make helm-artifacts-publish \
-e GIT_CONFIG_USER_NAME="$GIT_CONFIG_USER_NAME" \
-e GIT_CONFIG_USER_EMAIL="$GIT_CONFIG_USER_EMAIL" \
-e OPERATOR_VERSION=$VERSION
env:
GIT_CONFIG_USER_NAME: "${{ github.actor }}"
GIT_CONFIG_USER_EMAIL: "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
89 changes: 89 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Release workflow

on:
workflow_dispatch:
inputs:
release_version:
description: "Release version"
required: true
bundle_channels:
description: "Bundle channels"
required: true
default: dev-0.2
is_draft_release:
description: "Draft release"
type: boolean
required: false
default: true
is_pre_release:
description: "Pre-release"
type: boolean
required: false
default: false

run-name: Release ${{ inputs.release_version }}

env:
GIT_USER: ${{ secrets.GIT_USER }}
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
VERSION: ${{ inputs.release_version }}

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Login to quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PWD }}

- uses: actions/checkout@v4

- name: Build and push operator image
run: |
make docker-buildx \
-e TAG=$VERSION
- name: Generate bundle metadata
run: |
make bundle \
-e CHANNELS=$CHANNELS
env:
CHANNELS: ${{ inputs.bundle_channels }}

- name: Publish bundle in operatorhub.io
run: |
make bundle-publish \
-e GIT_CONFIG_USER_NAME="$GIT_CONFIG_USER_NAME" \
-e GIT_CONFIG_USER_EMAIL="$GIT_CONFIG_USER_EMAIL" \
-e OPERATOR_VERSION=$VERSION \
-e OPERATOR_HUB=community-operators \
-e OWNER=k8s-operatorhub \
-e FORK=maistra
env:
GIT_CONFIG_USER_NAME: "${{ github.actor }}"
GIT_CONFIG_USER_EMAIL: "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"

- name: Publish bundle in OpenShift OperatorHub
run: |
make bundle-publish \
-e GIT_CONFIG_USER_NAME="$GIT_CONFIG_USER_NAME" \
-e GIT_CONFIG_USER_EMAIL="$GIT_CONFIG_USER_EMAIL" \
-e OPERATOR_VERSION=$VERSION \
-e OWNER=redhat-openshift-ecosystem \
-e FORK=maistra
env:
GIT_CONFIG_USER_NAME: "${{ github.actor }}"
GIT_CONFIG_USER_EMAIL: "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"

- name: Create GitHub release
run: |
make create-gh-release \
-e GH_PRE_RELEASE=$GH_PRE_RELEASE \
-e GH_RELEASE_DRAFT=$GH_RELEASE_DRAFT
env:
GH_PRE_RELEASE: ${{ github.event.inputs.is_pre_release == 'true' }}
GH_RELEASE_DRAFT: ${{ github.event.inputs.is_draft_release == 'true' }}
7 changes: 7 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Sail Operator Community Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

All members of the Sail Operator community must abide by the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).
Only by respecting each other can we develop a productive, collaborative community.

14 changes: 2 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,15 @@ If you want to contribute to the Sail Operator project, you can follow some rule
- Discuss your changes before you start working on them. You can open a new issue in the [Sail Operator GitHub repository](https://github.com/istio-ecosystem/sail-operator/issues) or start a discussion in the [Sail Operator Discussion](https://github.com/istio-ecosystem/sail-operator/discussions). By this way, you can get feedback from the community and ensure that your changes are aligned with the project goals.
- Use of Labels: We use labels in the issues to help us track the progress of the issues. You can use the labels to help you understand the status of the issue and what is needed to move forward. Those labels are:
- `backport/backport-handled`: Use this label to indicate that the issue has been backported to the appropriate branches.
- `testing`: Use this label to indicate that the issue is related to testing. Can be used in combination with other labels to mark the proper testing type, for example: `testing/e2e`, `testing/unit`, `testing/integration`.
- `test`: Use this label to indicate that the issue is related to test or add `test-needed` when a issue needs a test to be added related. Can be used in combination with other labels to mark the proper test type, for example: `test-e2e`, `test-unit`, `test-integration`.
- `good first issue`: Use this label to indicate that the issue is a good first issue for new contributors.
- `help wanted`: Use this label to indicate that the issue needs help from the community.
- `enhancement`: Use this label to indicate that the issue is an enhancement related to a new feature or improvement.
- Pull Requests: When you open a pull request, you can follow this template to help you provide the necessary information to the maintainers:
- **What type of PR is this?**
- **What this PR does / why we need it:**
- **Which issue(s) this PR fixes:** (Mark with Fixes #12345, with this the issue will be autoclosed when the PR is merged)
- **Special notes for your reviewer:**
- **Does this PR introduce a user-facing change?**
- **Additional documentation:**
- **Does this PR introduce a breaking change?**
- **Other information:**
- Labels: You can use the labels to help you track the status of the PR. The labels are the same as the issue labels. Additionally, you can use the `cleanup/refactor` to indicate that the PR is a cleanup or refactor of the codebase. Having the label just helps with filtering pull requests. It also is a hint that this work does not need an entry in the changelog

## Community meetings

This is not defined yet. We are working on defining the community meetings and how the community can participate in them. We will update this section once we have more information.

## Security Issues

If you find a security issue in the Sail Operator project, please refer to the [Security Policy](https://github.com/istio-ecosystem/sail-operator/security/policy) for more information on how to report security issues. Please do not report security issues in the public GitHub repository.
If you find a security issue in the Sail Operator project, please refer to the [Security Policy](https://github.com/istio-ecosystem/sail-operator/security/policy) for more information on how to report security issues. Please do not report security issues in the public GitHub repository.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest

ARG TARGETOS TARGETARCH

ADD out/${TARGETOS:-linux}_${TARGETARCH:-amd64}/manager /manager
ADD out/${TARGETOS:-linux}_${TARGETARCH:-amd64}/sail-operator /sail-operator
ADD resources /var/lib/sail-operator/resources

USER 65532:65532
WORKDIR /
ENTRYPOINT ["/manager"]
ENTRYPOINT ["/sail-operator"]
70 changes: 56 additions & 14 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ GINKGO_FLAGS := $(if $(VERBOSE),-v) $(if $(CI),--no-color)
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=candidate,fast,stable)
# - use environment variables to overwrite this value (e.g export CHANNELS="candidate,fast,stable")
CHANNELS ?= ${MINOR_VERSION}
CHANNEL_PREFIX := dev
ifneq (,$(findstring release-,$(shell git rev-parse --abbrev-ref HEAD)))
CHANNEL_PREFIX = stable
endif

CHANNELS ?= $(CHANNEL_PREFIX)-$(MINOR_VERSION)
ifneq ($(origin CHANNELS), undefined)
BUNDLE_CHANNELS = --channels=\"$(CHANNELS)\"
endif
Expand Down Expand Up @@ -165,16 +170,16 @@ test.e2e.ocp: ## Run the end-to-end tests against an existing OCP cluster.
GINKGO_FLAGS="$(GINKGO_FLAGS)" ${SOURCE_DIR}/tests/e2e/integ-suite-ocp.sh

.PHONY: test.e2e.kind
test.e2e.kind: ## Deploy a KinD cluster and run the end-to-end tests against it.
GINKGO_FLAGS="$(GINKGO_FLAGS)" ${SOURCE_DIR}/tests/e2e/integ-suite-kind.sh
test.e2e.kind: istioctl ## Deploy a KinD cluster and run the end-to-end tests against it.
GINKGO_FLAGS="$(GINKGO_FLAGS)" ISTIOCTL="$(ISTIOCTL)" ${SOURCE_DIR}/tests/e2e/integ-suite-kind.sh

.PHONY: test.e2e.describe
test.e2e.describe: ## Runs ginkgo outline -format indent over the e2e test to show in BDD style the steps and test structure
GINKGO_FLAGS="$(GINKGO_FLAGS)" ${SOURCE_DIR}/tests/e2e/common-operator-integ-suite.sh --describe
##@ Build

.PHONY: build
build: build-$(TARGET_ARCH) ## Build manager binary.
build: build-$(TARGET_ARCH) ## Build the sail-operator binary.

.PHONY: run
run: gen ## Run a controller from your host.
Expand Down Expand Up @@ -216,7 +221,7 @@ endif
# BUILDX_BUILD_ARGS are the additional --build-arg flags passed to the docker buildx build command.
BUILDX_BUILD_ARGS = --build-arg TARGETOS=$(TARGET_OS)

# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
# PLATFORMS defines the target platforms for the sail-operator image be build to provide support to multiple
# architectures. (i.e. make docker-buildx IMAGE=myregistry/mypoperator:0.0.1). To use this option you need to:
# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
Expand All @@ -228,8 +233,8 @@ PLATFORM_ARCHITECTURES = $(shell echo ${PLATFORMS} | sed -e 's/,/\ /g' -e 's/lin
ifndef BUILDX
define BUILDX
.PHONY: build-$(1)
build-$(1): ## Build manager binary for specific architecture.
GOARCH=$(1) LDFLAGS="$(LD_FLAGS)" common/scripts/gobuild.sh $(REPO_ROOT)/out/$(TARGET_OS)_$(1)/manager cmd/main.go
build-$(1): ## Build sail-operator binary for specific architecture.
GOARCH=$(1) LDFLAGS="$(LD_FLAGS)" common/scripts/gobuild.sh $(REPO_ROOT)/out/$(TARGET_OS)_$(1)/sail-operator cmd/main.go

.PHONY: build-all
build-all: build-$(1)
Expand All @@ -249,6 +254,9 @@ docker-buildx: build-all ## Build and push docker image with cross-platform supp
docker buildx rm project-v4-builder
rm Dockerfile.cross

clean: ## Cleans all the intermediate files and folders previously generated.
rm -rf $(REPO_ROOT)/out

##@ Deployment

.PHONY: verify-kubeconfig
Expand Down Expand Up @@ -381,7 +389,7 @@ gen-charts: ## Pull charts from istio repository.
gen: gen-all-except-bundle bundle ## Generate everything.

.PHONY: gen-all-except-bundle
gen-all-except-bundle: operator-name operator-chart controller-gen gen-api gen-charts gen-manifests gen-code gen-api-docs
gen-all-except-bundle: operator-name operator-chart controller-gen gen-api gen-charts gen-manifests gen-code gen-api-docs github-workflow

.PHONY: gen-check
gen-check: gen restore-manifest-dates check-clean-repo ## Verify that changes in generated resources have been checked in.
Expand Down Expand Up @@ -425,6 +433,9 @@ operator-chart:
sed -i -e "s|^\(image: \).*$$|\1${IMAGE}|g" \
-e "s/^\( version: \).*$$/\1${VERSION}/g" chart/values.yaml

github-workflow:
sed -i -e '1,/default:/ s/^\(.*default:\).*$$/\1 ${CHANNELS}/' .github/workflows/release.yaml

.PHONY: update-istio
update-istio: ## Update the Istio commit hash in the 'latest' entry in versions.yaml to the latest commit in the branch.
@hack/update-istio.sh
Expand All @@ -450,13 +461,15 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
GITLEAKS ?= $(LOCALBIN)/gitleaks
OPM ?= $(LOCALBIN)/opm
ISTIOCTL ?= $(LOCALBIN)/istioctl

## Tool Versions
OPERATOR_SDK_VERSION ?= v1.36.1
HELM_VERSION ?= v3.15.3
CONTROLLER_TOOLS_VERSION ?= v0.16.0
OPM_VERSION ?= v1.45.0
GITLEAKS_VERSION ?= v8.18.4
OPERATOR_SDK_VERSION ?= v1.37.0
HELM_VERSION ?= v3.16.1
CONTROLLER_TOOLS_VERSION ?= v0.16.3
OPM_VERSION ?= v1.47.0
GITLEAKS_VERSION ?= v8.20.0
ISTIOCTL_VERSION ?= 1.23.0

# GENERATE_RELATED_IMAGES defines whether `spec.relatedImages` is going to be generated or not
# To disable set flag to false
Expand All @@ -483,6 +496,28 @@ $(OPERATOR_SDK): $(LOCALBIN)
curl -sSLfo $(LOCALBIN)/operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION)/operator-sdk_$(OS)_$(ARCH) && \
chmod +x $(LOCALBIN)/operator-sdk;

.PHONY: istioctl $(ISTIOCTL)
istioctl: $(ISTIOCTL) ## Download istioctl to bin directory.
istioctl: TARGET_OS=$(shell go env GOOS)
istioctl: TARGET_ARCH=$(shell go env GOARCH)
$(ISTIOCTL): $(LOCALBIN)
@test -s $(LOCALBIN)/istioctl || { \
OSEXT=$(if $(filter $(TARGET_OS),Darwin),osx,linux); \
URL="https://github.com/istio/istio/releases/download/$(ISTIOCTL_VERSION)/istioctl-$(ISTIOCTL_VERSION)-$$OSEXT-$(TARGET_ARCH).tar.gz"; \
echo "Fetching istioctl from $$URL"; \
curl -fsL $$URL -o /tmp/istioctl.tar.gz || { \
echo "Download failed! Please check the URL and ISTIO_VERSION."; \
exit 1; \
}; \
tar -xzf /tmp/istioctl.tar.gz -C /tmp || { \
echo "Extraction failed!"; \
exit 1; \
}; \
mv /tmp/istioctl $(LOCALBIN)/istioctl; \
rm -f /tmp/istioctl.tar.gz; \
echo "istioctl has been downloaded and placed in $(LOCALBIN)"; \
}

.PHONY: controller-gen
controller-gen: $(LOCALBIN) ## Download controller-gen to bin directory. If wrong version is installed, it will be overwritten.
@test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \
Expand Down Expand Up @@ -560,6 +595,13 @@ bundle-publish-nightly: OPERATOR_VERSION=$(VERSION)-nightly-$(TODAY) ## Publish
bundle-publish-nightly: TAG=$(MINOR_VERSION)-nightly-$(TODAY)
bundle-publish-nightly: bundle-nightly bundle-publish

.PHONY: helm-artifacts-publish
helm-artifacts-publish: helm ## Publish Helm artifacts to be available for "Helm repo add"
@export GIT_USER=$(GITHUB_USER); \
export GITHUB_TOKEN=$(GITHUB_TOKEN); \
export OPERATOR_VERSION=${OPERATOR_VERSION}; \
./hack/helm-artifacts.sh

.PHONY: opm $(OPM)
opm: $(OPM)
opm: OS=$(shell go env GOOS)
Expand Down Expand Up @@ -624,7 +666,7 @@ git-hook: gitleaks ## Installs gitleaks as a git pre-commit hook.
chmod +x .git/hooks/pre-commit; \
fi

.SILENT: helm $(HELM) $(LOCALBIN) deploy-yaml gen-api operator-name operator-chart
.SILENT: helm $(HELM) $(LOCALBIN) deploy-yaml gen-api operator-name operator-chart github-workflow

COMMON_IMPORTS ?= lint-all lint-scripts lint-copyright-banner lint-go lint-yaml lint-helm format-go tidy-go check-clean-repo update-common
.PHONY: $(COMMON_IMPORTS)
Expand Down
Loading

0 comments on commit 118cd12

Please sign in to comment.