Skip to content

Commit

Permalink
Merge branch 'main' into block-deleting-unowned-lease
Browse files Browse the repository at this point in the history
  • Loading branch information
mshitrit authored Aug 30, 2023
2 parents 18d6f67 + 63ce1ce commit 6f1d9de
Show file tree
Hide file tree
Showing 3,776 changed files with 48 additions and 1,372,695 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build_root_image:
namespace: openshift
name: release
tag: rhel-8-release-golang-1.20-openshift-4.14
12 changes: 6 additions & 6 deletions .github/workflows/pre-submit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs: # jobs to run
with:
fetch-depth: 0

- name: Verify imports are sorted
run: make test-imports
- name: Build
run: make build

- name: Verify there are no packages to vendor
run: make verify-vendor
- name: Run all linters etc.
run: make lint

- name: Run checks and unit tests
run: make check
- name: Run unit tests
run: make test
36 changes: 18 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GO_VERSION refers to the version of Golang to be downloaded when running dockerized version
GO_VERSION = 1.20
GOIMPORTS_VERSION = v0.8.0
SORT_IMPORTS_VERSION = v0.1.0
GOIMPORTS_VERSION = v0.11.0
SORT_IMPORTS_VERSION = v0.2.1

# Run go in a container
# --rm = remove container when stopped
Expand Down Expand Up @@ -29,17 +29,24 @@ rm -rf $$TMP_DIR ;\
}
endef

.PHONY: build
build: ## Build.
go build ./...

.PHONY: test
test: ## Run tests.
test: ## Run unit tests.
go test ./... -coverprofile cover.out -v

.PHONY: lint
lint: tidy goimports fix-imports vet verify-no-changes ## Run linters etc.

.PHONY: check
check: fmt vet goimports verify-no-changes ## Dockerized version of make test with additional verifications
$(DOCKER_GO) "make test"
check: ## Dockerized version of make test with additional verifications
$(DOCKER_GO) "make lint test"

.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...
.PHONY: goimports
goimports: install-goimports ## Run go fmt against code.
$(GOIMPORTS) -w ./pkg

.PHONY: vet
vet: ## Run go vet against code.
Expand All @@ -49,17 +56,10 @@ vet: ## Run go vet against code.
verify-no-changes: ## verify there are no un-staged changes
./hack/verify-diff.sh

.PHONY:vendor
vendor: ## Runs go mod vendor
go mod vendor

.PHONY: tidy
tidy: ## Runs go mod tidy
go mod tidy

.PHONY:verify-vendor
verify-vendor:tidy vendor verify-no-changes ##Verifies vendor and tidy didn't cause changes

SORT_IMPORTS = $(shell pwd)/bin/sort-imports
.PHONY: sort-imports
sort-imports: ## Download sort-imports locally if necessary.
Expand All @@ -71,9 +71,9 @@ test-imports: sort-imports ## Check for sorted imports

.PHONY: fix-imports
fix-imports: sort-imports ## Sort imports
$(SORT_IMPORTS) . -w
$(SORT_IMPORTS) -w .

GOIMPORTS = $(shell pwd)/bin/goimports
goimports: ## updates goimports.
.PHONY: install-goimports
install-goimports: ## updates goimports.
$(call go-install-tool,$(GOIMPORTS),golang.org/x/tools/cmd/goimports@$(GOIMPORTS_VERSION))
$(GOIMPORTS) -w ./pkg
6 changes: 6 additions & 0 deletions pkg/annotations/annotations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package annotations

const (
// NhcTimeOut is the annotation set by NHC to signal the operator that it surpassed its timeout and shall stop its remediation
NhcTimedOut = "remediation.medik8s.io/nhc-timed-out"
)
13 changes: 13 additions & 0 deletions pkg/conditions/conditions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package conditions

const (

// These are condition types used on remediation CRs

// ProcessingType is the condition type used to signal the remediation has started and it is in progress, or has finished
ProcessingType = "Processing"
// SucceededType is the condition type used to signal whether the remediation was successful or not
SucceededType = "Succeeded"
// PermanentNodeDeletionExpectedType is the condition type used to signal that the unhealthy node will be permanently deleted.
PermanentNodeDeletionExpectedType = "PermanentNodeDeletionExpected"
)
2 changes: 1 addition & 1 deletion pkg/lease/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (l *manager) requestLease(ctx context.Context, obj client.Object, leaseDura
if lease.Spec.HolderIdentity != nil {
identity = *lease.Spec.HolderIdentity
}
return &AlreadyHeldError{holderIdentity: identity}
return AlreadyHeldError{holderIdentity: identity}
}
needUpdateLease = true

Expand Down
20 changes: 0 additions & 20 deletions vendor/github.com/beorn7/perks/LICENSE

This file was deleted.

Loading

0 comments on commit 6f1d9de

Please sign in to comment.