Skip to content

Commit

Permalink
Merge pull request #1119 from splunk/promote-develop-to-main-2.2.1
Browse files Browse the repository at this point in the history
Promote Develop to main for Splunk Operator Release 2.2.1
  • Loading branch information
gaurav-splunk authored Mar 13, 2023
2 parents 7bbc464 + 7ac22c4 commit 4c1851d
Show file tree
Hide file tree
Showing 189 changed files with 7,661 additions and 419 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OPERATOR_SDK_VERSION=v1.25.0
REVIEWERS=pdhanoya-splunk,smohan-splunk,sgontla,gaurav-splunk,jambrosiano,tpereirasplunk,jryb,vivekr-splunk,kumarajeet
OPERATOR_SDK_VERSION=v1.27.0
REVIEWERS=pdhanoya-splunk,smohan-splunk,sgontla,gaurav-splunk,jryb,vivekr-splunk,kumarajeet
GO_VERSION=1.19.2
AWSCLI_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.6.zip
KUBECTL_VERSION=v1.25.3
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/build-test-push-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
run: |
go version
go install github.com/mattn/goveralls@latest
- name: Install Ginkgo
run: |
make setup/ginkgo
go mod tidy
- name: Run Unit Tests
run: make test
- name: Run Code Coverage
Expand All @@ -58,6 +62,9 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
- name: Install Ginkgo
run: |
make setup/ginkgo
- name: setup-docker
uses: docker-practice/actions-setup-docker@v1
- name: Install Operator SDK
Expand Down Expand Up @@ -170,7 +177,7 @@ jobs:
run: |
echo "SPLUNK_ENTERPRISE_IMAGE=${{ env.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}" >> $GITHUB_ENV
- name: Install Kubectl
uses: Azure/setup-kubectl@v1
uses: Azure/setup-kubectl@v3
with:
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
- name: Install Python
Expand Down Expand Up @@ -270,6 +277,13 @@ jobs:
if: ${{ always() }}
run: |
make cluster-down
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Integration Tests # Name of the check run which will be created
path: inttest-*.xml # Path to test results
reporter: jest-junit # Format of test results
push-latest:
needs: smoke-tests
if: github.ref == 'refs/heads/main'
Expand Down Expand Up @@ -305,4 +319,4 @@ jobs:
run: |
docker tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
- name: Push Splunk Operator Image to Docker Hub
run: docker push ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
run: docker push ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
2 changes: 1 addition & 1 deletion .github/workflows/helm-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
run: |
echo "HELM_GITHUB_SHA=$GITHUB_SHA" >> $GITHUB_ENV
- name: Install Kubectl
uses: Azure/setup-kubectl@v1
uses: Azure/setup-kubectl@v3
with:
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
- name: Install kuttl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/int-test-azure-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Install Kubectl
uses: Azure/setup-kubectl@v1
uses: Azure/setup-kubectl@v3
with:
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
- name: Install Python
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Install Kubectl
uses: Azure/setup-kubectl@v1
uses: Azure/setup-kubectl@v3
with:
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
- name: Install Python
Expand Down Expand Up @@ -206,3 +206,10 @@ jobs:
if: ${{ always() }}
run: |
make cluster-down
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Integration Tests # Name of the check run which will be created
path: inttest-*.xml # Path to test results
reporter: jest-junit # Format of test results
2 changes: 1 addition & 1 deletion .github/workflows/manual-int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Install Kubectl
uses: Azure/setup-kubectl@v1
uses: Azure/setup-kubectl@v3
with:
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
- name: Install Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/namespace-scope-int-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Install Kubectl
uses: Azure/setup-kubectl@v1
uses: Azure/setup-kubectl@v3
with:
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
- name: Install Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Install Kubectl
uses: Azure/setup-kubectl@v1
uses: Azure/setup-kubectl@v3
with:
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
- name: Install Python
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ jobs:
- name: Run helm chart package creation
run: |
helm package helm-chart/splunk-operator
cp splunk-operator-${{ github.event.inputs.new_enterprise_version }}.tgz docs/
mv splunk-operator-${{ github.event.inputs.new_enterprise_version }}.tgz helm-chart/splunk-enterprise/charts
cp splunk-operator-${{ github.event.inputs.new_operator_version }}.tgz docs/
mv splunk-operator-${{ github.event.inputs.new_operator_version }}.tgz helm-chart/splunk-enterprise/charts
helm package helm-chart/splunk-enterprise
mv splunk-enterprise-${{ github.event.inputs.new_enterprise_version }}.tgz docs/
mv splunk-enterprise-${{ github.event.inputs.new_operator_version }}.tgz docs/
helm repo index --url https://splunk.github.io/splunk-operator/ docs/
- name: Reset go.mod and go.sum before creating Pull Request
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN yum -y update-minimal --security --sec-severity=Low
LABEL name="splunk" \
maintainer="[email protected]" \
vendor="splunk" \
version="2.2.0" \
version="2.2.1" \
release="1" \
summary="Simplify the Deployment & Management of Splunk Products on Kubernetes" \
description="The Splunk Operator for Kubernetes (SOK) makes it easy for Splunk Administrators to deploy and operate Enterprise deployments in a Kubernetes infrastructure. Packaged as a container, it uses the operator pattern to manage Splunk-specific custom resources, following best practices to manage all the underlying Kubernetes objects for you."
Expand Down
26 changes: 14 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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 ?= 2.2.0
VERSION ?= 2.2.1

# SPLUNK_ENTERPRISE_IMAGE defines the splunk docker tag that is used as default image.
SPLUNK_ENTERPRISE_IMAGE ?= "docker.io/splunk/splunk:edge"
Expand Down Expand Up @@ -73,13 +73,13 @@ else
SCANNER_FILE = clair-scanner_windows_amd64.exe
endif

SED := sed -i
SED := sed -i
ifeq ($(shell uname), Linux)
SED = sed -i
SED = sed -i
else ifeq ($(shell uname), Darwin)
SED = sed -i ""
SED = sed -i ""
else
SED = sed -i
SED = sed -i
endif

# Setting SHELL to bash allows bash commands to be executed by recipes.
Expand Down Expand Up @@ -122,15 +122,16 @@ scheck: ## Run static check against code
go install honnef.co/go/tools/cmd/[email protected]
staticcheck ./...

vet: ## Run go vet against code.
vet: setup/ginkgo ## Run go vet against code.
go vet ./...

test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -v -covermode=count -coverprofile=coverage.out --timeout=300s ./pkg/splunk/common ./pkg/splunk/enterprise ./pkg/splunk/controller ./pkg/splunk/client ./pkg/splunk/util ./controllers
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" ginkgo --junit-report=unit_test.xml --output-dir=`pwd` -vv --trace --keep-going --timeout=3h --cover --covermode=count --coverprofile=coverage.out ./pkg/splunk/common ./pkg/splunk/enterprise ./pkg/splunk/controller ./pkg/splunk/client ./pkg/splunk/util ./controllers


##@ Build

build: generate fmt vet ## Build manager binary.
build: setup/ginkgo generate fmt vet ## Build manager binary.
go build -o bin/manager main.go

run: manifests generate fmt vet ## Run a controller from your host.
Expand Down Expand Up @@ -176,7 +177,7 @@ deploy: manifests kustomize uninstall ## Deploy controller to the K8s cluster sp
$(SED) "s/namespace: ${NAMESPACE}/namespace: splunk-operator/g" config/default/kustomization.yaml
$(SED) "s/value: \"${WATCH_NAMESPACE}\"/value: WATCH_NAMESPACE_VALUE/g" config/default/kustomization.yaml
$(SED) "s|${SPLUNK_ENTERPRISE_IMAGE}|SPLUNK_ENTERPRISE_IMAGE|g" config/default/kustomization.yaml

undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -

Expand Down Expand Up @@ -363,20 +364,21 @@ setup/devsetup:
@echo Installing operator-sdk
@curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
@sudo chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk


clean: stop_clair_scanner
@rm -rf ./build/_output
@docker rmi $(IMG) || true
@rm -f clair-scanner
@rm -rf clair-scanner-logs

cleanup:
cleanup:
@./tools/cleanup.sh

.PHONY: setup/ginkgo
setup/ginkgo:
@echo Installing ginkgo
@go get github.com/onsi/ginkgo/ginkgo
@go get github.com/onsi/ginkgo/v2
@go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@latest
@echo Installing gomega
@go get github.com/onsi/gomega/...
3 changes: 3 additions & 0 deletions api/v4/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ type Spec struct {

// ServiceTemplate is a template used to create Kubernetes services
ServiceTemplate corev1.Service `json:"serviceTemplate"`

// TopologySpreadConstraint https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
}

// Phase is used to represent the current phase of a custom resource
Expand Down
7 changes: 7 additions & 0 deletions api/v4/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=splunk-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.25.0
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.27.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
Loading

0 comments on commit 4c1851d

Please sign in to comment.