Skip to content

Commit

Permalink
Revert "fixing operator suite test (#65)" (#93)
Browse files Browse the repository at this point in the history
This reverts commit 8dbe398.
  • Loading branch information
Maanas-23 authored Feb 20, 2025
1 parent 8dbe398 commit 71a609b
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 352 deletions.
28 changes: 2 additions & 26 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,17 @@ jobs:
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
fetch-depth: "0"
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Install dependencies
run: go mod tidy
working-directory: ${{ matrix.modules }}
- name: golangci-lint ${{ matrix.modules }}
uses: golangci/golangci-lint-action@v6
with:
working-directory: ${{ matrix.modules }}
args: -v --timeout 5m
version: v1.63.4
test:
needs: detect-modules
runs-on: ubuntu-latest
strategy:
matrix:
modules: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Install dependencies
run: go mod tidy
working-directory: ${{ matrix.modules }}
- name: test ${{ matrix.modules }}
run: cd ${{ matrix.modules }} && make test
version: v1.63.4
15 changes: 0 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,3 @@ deploy: ## Deploy the operator and resolver
undeploy: ## Undeploy the operator and resolver
kubectl delete -f ./install.yaml

.PHONY: test
test: test-operator test-resolver test-pkg ## Run all tests

.PHONY: test-operator
test-operator: ## Run operator tests
cd operator && make test

.PHONY: test-resolver
test-resolver: ## Run resolver tests
cd resolver && make test

.PHONY: test-pkg
test-pkg: ## Run pkg tests
cd pkg && make test

7 changes: 1 addition & 6 deletions charts/elasti/templates/elastiservice-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,7 @@ spec:
items:
properties:
metadata:
description: |-
RawMessage is a raw encoded JSON value.
It implements [Marshaler] and [Unmarshaler] and can
be used to delay JSON decoding or precompute a JSON encoding.
format: byte
type: string
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
Expand Down
13 changes: 12 additions & 1 deletion operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ all: build

##@ General

# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
# More info on the usage of ANSI control characters for terminal formatting:
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
# More info on the awk command:
# http://linuxcommand.org/lc3_adv_awk.php

.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
Expand All @@ -50,7 +61,7 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -v $$(go list ./... | grep -v /e2e) -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out

# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
Expand Down
8 changes: 4 additions & 4 deletions operator/api/v1alpha1/elastiservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ limitations under the License.
package v1alpha1

import (
"encoding/json"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -78,8 +76,10 @@ type ElastiServiceList struct {
}

type ScaleTrigger struct {
Type string `json:"type"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Schemaless
Metadata any `json:"metadata,omitempty"`
}

type AutoscalerSpec struct {
Expand Down
54 changes: 1 addition & 53 deletions operator/api/v1alpha1/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 @@ -73,12 +73,7 @@ spec:
items:
properties:
metadata:
description: |-
RawMessage is a raw encoded JSON value.
It implements [Marshaler] and [Unmarshaler] and can
be used to delay JSON decoding or precompute a JSON encoding.
format: byte
type: string
x-kubernetes-preserve-unknown-fields: true
type:
type: string
required:
Expand Down
15 changes: 0 additions & 15 deletions operator/hack/boilerplate.go.txt

This file was deleted.

Loading

0 comments on commit 71a609b

Please sign in to comment.