Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Druid Refactor to Address Multiple Controller Conflicts #777

Merged
merged 235 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
8e72758
Introduced internal packaged, added resource which now replaces Compo…
unmarshall Nov 18, 2023
82f40a8
Adapt custodian controller to a recovery-controller
shreyas-s-rao Nov 19, 2023
1d0e8a8
Add missing JSON tags to fields in types_etcd.go
seshachalam-yv Nov 20, 2023
052a1cb
Fixed error by Updating Method Name to GetConfigMapName
seshachalam-yv Nov 20, 2023
63cd1ba
added missing annotation constants
unmarshall Nov 20, 2023
268defe
Refactor resource pkg to resolve Cyclic Imports
seshachalam-yv Nov 20, 2023
a41bcd4
Fixed lint error
seshachalam-yv Nov 20, 2023
c7509e6
renamed resource package to operator
unmarshall Nov 20, 2023
f977da0
fixed import error
seshachalam-yv Nov 23, 2023
ccf9ed1
Add `DataVolumesReady` condition, update imports for internal/health …
shreyas-s-rao Nov 23, 2023
dbfe87f
Refactor memberlease Sync() to use OperatorTask for concurrency
seshachalam-yv Nov 24, 2023
9bb9cce
Refactor: Remove unused etcd field from _resource struct in serviceac…
seshachalam-yv Nov 27, 2023
3ac2244
Fix: Correct client URL port assignment in createEtcdConfig
seshachalam-yv Nov 27, 2023
1900d34
Initial support for statefulset
seshachalam-yv Nov 27, 2023
315862c
Refactor to support statefulset
seshachalam-yv Nov 27, 2023
cc61061
Run etcd-druid locally with new controllers
seshachalam-yv Nov 27, 2023
4f31295
added godocs
unmarshall Nov 28, 2023
7a61670
refactored operator registry and adopted the changes in etcd reconciler
unmarshall Nov 29, 2023
0bb5268
removed methods from registry
unmarshall Nov 29, 2023
c9c5772
cleaned up unused types
unmarshall Nov 29, 2023
4b34115
Include 'internal' directory in Docker build context
seshachalam-yv Nov 29, 2023
c910d1a
Refactor statefulSet operator
seshachalam-yv Nov 30, 2023
7419b88
WIP commit - refactored sts resource operator
unmarshall Dec 4, 2023
32641f5
Fix incorrect scheme used in ListenClientUrls for etcd config
seshachalam-yv Dec 6, 2023
467183a
Update MemberLease labels to include etcd name-specific labels
seshachalam-yv Dec 6, 2023
a040560
added godoc for errors.go
unmarshall Dec 7, 2023
1c3d158
added missing exported field godoc
unmarshall Dec 7, 2023
7a94aaa
WIP commit - refactored sts resource operator
seshachalam-yv Dec 26, 2023
c78e56e
Removed unused function
seshachalam-yv Dec 26, 2023
b9930b8
Add unit test for peerservice
seshachalam-yv Dec 26, 2023
63b8aaa
Add unit test for clientservice
seshachalam-yv Dec 26, 2023
a204e03
Add StatefulSet nil check in dataVolumesReady condition
seshachalam-yv Dec 26, 2023
f7ccfa6
Implement RetryOnConflict in etcd Status Updates for LastOperation
seshachalam-yv Dec 26, 2023
7da0ce5
WIP: Refactor Reconcile function
seshachalam-yv Jan 1, 2024
403e8ee
WIP: Refactor custodian controller
seshachalam-yv Jan 1, 2024
c01f31a
misc fixes
unmarshall Jan 1, 2024
5881a66
Optimize StatefulSet retrieval in GetStatefulSet instead of using list
seshachalam-yv Jan 2, 2024
6064098
misc fixes
seshachalam-yv Jan 2, 2024
eaebc2f
Remove custodian controller; status updates now handled by etcd contr…
seshachalam-yv Jan 2, 2024
f7f91e5
Replaced update operations with patch for enhanced efficiency and red…
seshachalam-yv Jan 3, 2024
71fabca
Added etcdReconcilePredicate for enhanced event filtering in etcd con…
seshachalam-yv Jan 3, 2024
54d8621
added code to set ObservedGeneration and refactored predicates for et…
unmarshall Jan 3, 2024
575f0bb
added sample package, refactored test for client-svc operator, introd…
unmarshall Jan 3, 2024
84d361d
removed logger from New functions
unmarshall Jan 3, 2024
b5a225a
Added the ObservedGeneration check to E2E test
seshachalam-yv Jan 4, 2024
452c62a
Add delete error handling in FakeClientBuilder
seshachalam-yv Jan 5, 2024
d62db5e
Refactor clientservice tests
seshachalam-yv Jan 5, 2024
aa9f484
Extend EtcdBuilder with new configuration methods
seshachalam-yv Jan 5, 2024
772203e
EtcdBuilder moved to test/sample from test/utils
seshachalam-yv Jan 5, 2024
bda2cda
Removed unused file
seshachalam-yv Jan 5, 2024
1eb4d23
minor improvement in test utility fn and removal of dead code
unmarshall Jan 5, 2024
30fdfa8
adapted sample package
unmarshall Jan 5, 2024
0fd816b
Reorder imports
seshachalam-yv Jan 5, 2024
9890f25
Fix lint errors
seshachalam-yv Jan 5, 2024
a18ecf1
changed the error code constants, added sample for role
unmarshall Jan 5, 2024
45c31e1
Removed duplicate import
seshachalam-yv Jan 5, 2024
6d4a60d
Enhance peer service operatior with error handling and logging, and u…
seshachalam-yv Jan 5, 2024
450a946
Standardize naming conventions for error codes in peer service.
seshachalam-yv Jan 5, 2024
d431b54
Rebased with PR#737
seshachalam-yv Jan 5, 2024
f87b9bd
added unit test for role operator and added functions to fake client
unmarshall Jan 5, 2024
08b02d1
added rolebinding tests
unmarshall Jan 6, 2024
744f47b
add sample for rolebinding and memberlease, added tests for rolebindi…
unmarshall Jan 7, 2024
9ca1e12
corrected tests, get also now returns druiderr
unmarshall Jan 8, 2024
f685648
fixed peer service tests
unmarshall Jan 8, 2024
df7e75b
fixed tests, added error handling to member lease
unmarshall Jan 8, 2024
8266dce
added member lease test and minor corrections to clientservice test
unmarshall Jan 9, 2024
28e825e
added service account test
unmarshall Jan 9, 2024
8ab20b4
added pdb operator unit test
unmarshall Jan 10, 2024
60da4a9
added test for snapshot lease and fixed an issue in member lease
unmarshall Jan 11, 2024
39eb878
Fix assertion in all operator tests to correctly compare names
seshachalam-yv Jan 12, 2024
bb2f833
introduced utility for custom gomega matcher and adapted client and p…
unmarshall Jan 14, 2024
47aa8d4
removed role and rolebinding sample and adjusted unit tests
unmarshall Jan 15, 2024
ad96460
removed sample pdb and adjusted tests
unmarshall Jan 15, 2024
5e1e476
removed sample sa and adjusted tests
unmarshall Jan 15, 2024
a78fa68
removed sample for leases and adapted tests
unmarshall Jan 16, 2024
967f39d
moved etcd builder back to test utils and adapted tests
unmarshall Jan 16, 2024
a66fbfa
harmonized labels on resources managed by druid
unmarshall Jan 18, 2024
ff10a01
moved the component names to constants and adpated code
unmarshall Jan 19, 2024
e2bfea3
Add resource-protection webhook, aka "sentinel" webhook
shreyas-s-rao Jan 19, 2024
1c41cea
added golang unit tests for utils and other misc changes
unmarshall Jan 22, 2024
f38d570
fixed unit test for utils sts
unmarshall Jan 22, 2024
5fe8cd0
misc refactoring
unmarshall Jan 29, 2024
428ac72
fixed make check errors
unmarshall Jan 29, 2024
4075ced
added 2 revised IT tests, misc refactorings all over the place
unmarshall Feb 6, 2024
c65c5ea
removed fakeclient and introduced test client, adapted unit tests, wr…
unmarshall Feb 8, 2024
17da300
Changes to sentinel webhook
shreyas-s-rao Feb 9, 2024
2200194
Add etcd helper functions, along with unit tests
shreyas-s-rao Feb 13, 2024
db13018
Add exemptServiceAccounts config for sentinel webhook
shreyas-s-rao Feb 14, 2024
35c515a
Clean up api/v1alpha1 unit tests
shreyas-s-rao Feb 14, 2024
693902e
added IT tests for etcd reconciler
unmarshall Feb 15, 2024
1a8da59
changed the test name and description
unmarshall Feb 15, 2024
c3bee7d
Changes to api/v1alpha1 helper functions
shreyas-s-rao Feb 16, 2024
c5ac2f0
Sentinel to freely allow updates on lease resources
shreyas-s-rao Feb 16, 2024
0635876
changed register for etcd controller and adapted unit tests
unmarshall Feb 21, 2024
63d5d07
moved to golang version 1.22
unmarshall Mar 4, 2024
96d728a
renamed LastError.LastUpdateTime to ObservedAt, introduced constants …
unmarshall Mar 14, 2024
76a0fe1
Fix and run `make generate`
shreyas-s-rao Mar 14, 2024
8c5ccae
Pull changes from ce2f556bf73d0e1e483527586cf267dc1437b1f0
shreyas-s-rao Mar 14, 2024
6d3c9f0
Pull changes from 5cd5b1bd8e63a8cd5abd9c93b8b1021c6ce47853
shreyas-s-rao Mar 14, 2024
2385d0f
Pull changes from 9c5f8254e3aeb24c1e3e88d17d8d1de336ce981b
shreyas-s-rao Mar 14, 2024
f5b2f7c
removed controller and pkg folders, adapted packages
unmarshall Mar 14, 2024
ea474be
Run `make revendor`
shreyas-s-rao Mar 15, 2024
93f6422
fixed etcdcopybackupstasktest and minor refactoring
unmarshall Mar 15, 2024
3c02f3a
Run `make fmt`
shreyas-s-rao Mar 15, 2024
b8fd186
Fix `make check`; fix and run `make generate`
shreyas-s-rao Mar 15, 2024
2ec2afa
Add unit tests for DataVolumesReady condition checker
shreyas-s-rao Mar 15, 2024
062c50b
fixed unit tests, introduced constants and adapted Makefile
unmarshall Mar 19, 2024
9e59dba
small fix in handlePeerTLSChanges and added etcd IT tests to Makefile
unmarshall Mar 19, 2024
31d12ea
Fix statefulset etcd.conf.yaml volumemount name
shreyas-s-rao Mar 21, 2024
422a6a8
Fix DataVolumesReady condition sts nil check
shreyas-s-rao Mar 21, 2024
79d3f17
Improve sentinel webhook resource decoder logic
shreyas-s-rao Mar 21, 2024
f885f64
Add unit tests for FetchPVCWarningMessagesForStatefulSet util func
shreyas-s-rao Mar 22, 2024
69a8b09
Fix unit test for FetchPVCWarningMessagesForStatefulSet util func
shreyas-s-rao Mar 24, 2024
9fe7957
Fix errors from `make check`
shreyas-s-rao Mar 24, 2024
fe41c67
Add unit tests for sentinel webhook
shreyas-s-rao Mar 25, 2024
f426672
Fix unit test for statefulset matcher
shreyas-s-rao Mar 25, 2024
d8622c1
Clean up unit tests for sentinel webhook
shreyas-s-rao Mar 25, 2024
0d3df8e
minor change for handling create/connect operation
unmarshall Mar 27, 2024
7a34ba2
Streamline sentinel webhook unit tests
shreyas-s-rao Mar 27, 2024
b49ebe1
Set mounted files DefaultMode to 640
shreyas-s-rao Mar 27, 2024
a011612
Fix integration tests
shreyas-s-rao Mar 28, 2024
d413244
refactored sentinel webhook unit test
unmarshall Mar 31, 2024
b4c0b05
removed an unnecessary unit test
unmarshall Mar 31, 2024
da7a514
Fix volume mount paths, and other minor fixes
shreyas-s-rao Apr 2, 2024
5bd2f1b
fixed unit test for init container mount
unmarshall Apr 2, 2024
b41558a
Run `make revendor`
shreyas-s-rao Apr 2, 2024
1930260
Sentinel webhook uses mounted serviceaccount token for `ReconcilerSer…
shreyas-s-rao Apr 2, 2024
e55978b
Resolve few TODOs, fix errors from `make check`
shreyas-s-rao Apr 2, 2024
049a57a
upgraded golang version to 1.22.1
unmarshall Apr 3, 2024
81c0dce
Streamline the running of tests
shreyas-s-rao Apr 3, 2024
c11d7e6
Fix e2e tests
shreyas-s-rao Apr 5, 2024
c3ca407
Move common constants /internal/common/constants.go
shreyas-s-rao Apr 5, 2024
b40fa15
moved back to go 1.21 and fixed unit test for etcdcopybackup controller
unmarshall Apr 17, 2024
0a28a1e
changed version of go to 1.21.4 in dockerfile and pipeline_definition
unmarshall Apr 17, 2024
1f99b23
rebased with upstream master, resolved compilation issues, fixed make…
unmarshall Apr 18, 2024
c715007
make tidy which removed gomock
unmarshall Apr 18, 2024
bd56d16
Run `make generate`, set ctrl logger in `it` test suite
shreyas-s-rao Apr 18, 2024
85d40cb
Add tool github.com/rakyll/gotest to colorize go test output for bett…
shreyas-s-rao Apr 18, 2024
21b226c
Fix webhook config in manager; Add generic-garbage-collector to senti…
shreyas-s-rao Apr 20, 2024
071bb53
Don't swallow infra job apt command output
shreyas-s-rao Apr 20, 2024
cb7afa1
Fix e2e tests
shreyas-s-rao Apr 20, 2024
9b38eb9
fixed golangci lint errors, now use gotestfmt, refactored etcd it tests
unmarshall Apr 22, 2024
dddba45
corrected test-integration target dependencies
unmarshall Apr 22, 2024
492fc95
removed reference to gotest from test-go.sh
unmarshall Apr 22, 2024
c6d6a5f
changed the version of kustomize to 5.3.0
unmarshall Apr 22, 2024
440ff65
Export kind cluster logs to prow job artifacts for enhanced debugging
seshachalam-yv Apr 22, 2024
22cc70e
debug
seshachalam-yv Apr 22, 2024
926f78a
corrected the kustomize version
unmarshall Apr 22, 2024
83bac3f
Ignore not found debug pods in e2e tests during cleanup
shreyas-s-rao Apr 22, 2024
cfb6fec
Update etcd-custom-image to v3.4.26-7
shreyas-s-rao Apr 22, 2024
6c99c2f
Add documentation for updated controller design, sentinel webhook, CL…
shreyas-s-rao Apr 22, 2024
4ba67b9
fix for issue #759
unmarshall Apr 23, 2024
6eaf7ee
Address review comments by @renormalize; Make all CLI flags configura…
shreyas-s-rao May 3, 2024
8e8d589
Update docs, fix formatting in quorum loss recovery doc
shreyas-s-rao May 4, 2024
2acca08
addressed review comments
unmarshall May 6, 2024
d486f67
disable-resource-protection annotation will no longer have a value
unmarshall May 7, 2024
7687563
Run `make generate`
shreyas-s-rao May 7, 2024
42b2765
Address review comments by @ashwani2k
shreyas-s-rao May 7, 2024
f790610
Address review comments by @renormalize: use constant for volume mode…
shreyas-s-rao May 7, 2024
cd15650
addressed review comment to remove explicit types from generic MergeM…
unmarshall May 9, 2024
109fe5c
addressed review comments to streamline constants
unmarshall May 9, 2024
7c1c8fd
Address review comments by @renormalize: stylistic changes to bring e…
shreyas-s-rao May 9, 2024
0105b2d
Rename all common constants to <general-intent><specific-usage> format
shreyas-s-rao May 9, 2024
09431d8
Address review comments by @renormalize: sentinel webhook disabled by…
shreyas-s-rao May 9, 2024
b9066f3
Address review comments by @renormalize: Don't specify explicit type …
shreyas-s-rao May 9, 2024
31e3a01
Address review comments by @ishan16696
shreyas-s-rao May 9, 2024
c0895d2
moved manager to its own package, addressed minor review comments
unmarshall May 13, 2024
c1ea02b
removed new label from match labels as that will cause failure to do …
unmarshall May 13, 2024
ae5877e
Minor changes to component names
shreyas-s-rao May 13, 2024
694cb65
Address review comments by @anveshreddy18
shreyas-s-rao May 13, 2024
2102a45
added support for ko, updated skaffold, added new makefile targets fo…
unmarshall May 14, 2024
3415a9d
fixed unit test for sentil webhook
unmarshall May 14, 2024
46b2c56
aligned messages in sentil to use Etcd instead of etcd
unmarshall May 14, 2024
1eb40ad
corrected the creation of image vector for IT tests
unmarshall May 14, 2024
dda7846
Fix integration tests, leaked envtest instances
shreyas-s-rao May 15, 2024
6bb461f
Disable sentinel webhook when deploying druid via skaffold; to be ena…
shreyas-s-rao May 15, 2024
78b9f8e
Minor cosmetic corrections
shreyas-s-rao May 15, 2024
b9e9cef
Address review comments by @anveshreddy18
shreyas-s-rao May 15, 2024
edb735a
Address review comments by @seshachalam-yv; restructured Makefile
shreyas-s-rao May 15, 2024
f75c718
Address review comments by @seshachalam-yv; Sentinel webhook now also…
shreyas-s-rao May 15, 2024
318326d
Enable sentinel webhook for CI e2e tests, run via `make ci-e2e-kind`
shreyas-s-rao May 15, 2024
7b23d25
Address review comments by @seshachalam-yv; update documentation for …
shreyas-s-rao May 16, 2024
e3f5429
Helm will create validating webhook config resource only if atleast o…
shreyas-s-rao May 16, 2024
53d5fef
Address review comments by @ishan16696: update docstrings, flag descr…
shreyas-s-rao May 17, 2024
b9978b4
Address review comments by @seshachalam-yv; sentinel webhook allows l…
shreyas-s-rao May 17, 2024
d41abe1
Address review comments by @anveshreddy18: add package-level comment …
shreyas-s-rao May 17, 2024
e66045f
Fix and enhance sentinel webhook unit tests
shreyas-s-rao May 17, 2024
0440243
package renaming, healthz and readyz endpoint addition, partialObjMet…
unmarshall May 21, 2024
f44e11b
removed unused method from api
unmarshall May 22, 2024
7857c8a
Address review comments by @seshachalam-yv; restructure sentinel webh…
shreyas-s-rao May 22, 2024
6d87c3e
Address review comments by @ashwani2k and @renormalize: abstract out …
shreyas-s-rao May 22, 2024
48ccfb4
component.Operator changed to use metav1.ObjectMeta, removed ginkgo f…
unmarshall May 24, 2024
befaada
Makefile debug auto-reload is changed to manual
unmarshall May 24, 2024
6ea3d89
corrected makefile deploy-dev target and added doc string to explain …
unmarshall May 24, 2024
609bcdb
resolved merge conflicts and adapted to use helper functions
unmarshall May 24, 2024
d8d472b
removed empty methods
unmarshall May 24, 2024
d7ba9db
fixed unit test
unmarshall May 24, 2024
4b81cb4
re-generated zz_generated.deepcopy.go
unmarshall May 24, 2024
5ae9d94
fixed compilation issues in it tests, adapted recent changes to helpe…
unmarshall May 24, 2024
a13614e
Address review comments by @ashwani2k: move provider-specific code to…
shreyas-s-rao May 24, 2024
d342ffc
Update gardener/gardener to v1.86.4
shreyas-s-rao May 24, 2024
f78a88e
Add missing finalizer to Etcd resource, fix it tests, fix generated CRDs
shreyas-s-rao May 24, 2024
5a9ecf9
Address review comments by @ashwani2k and @ishan16696
shreyas-s-rao May 24, 2024
7dfac67
addressed @ashwani2k comment, removed predicate package and moved the…
unmarshall May 26, 2024
e3c8627
Add missing license headers
shreyas-s-rao May 27, 2024
ad6a118
Move g/g hack script generate-crds.sh to druid
shreyas-s-rao May 29, 2024
eda8e18
added a comment explaining the order of lastOp update and op annotati…
unmarshall May 29, 2024
080454f
changed the comment
unmarshall May 29, 2024
30a5ed5
added unit test for concurrent.go utility
unmarshall May 29, 2024
616d7be
Remove 10- prefix from CRD names
shreyas-s-rao May 29, 2024
16ea743
Add missing vgopath setup to generate-crds script
shreyas-s-rao May 29, 2024
3f84ea2
Address review comments by @aaronfern, add missing license headers
shreyas-s-rao May 29, 2024
41fb009
Address review comment by @ishan16696
shreyas-s-rao May 30, 2024
9ca05f2
Address review comment by @aaronfern
shreyas-s-rao May 30, 2024
cdaa494
Introduce `PreSync` for components to fix upgrade of etcds that were …
shreyas-s-rao May 31, 2024
0d96252
Add tests for internal/errors package, add license headers
shreyas-s-rao May 31, 2024
6cb5488
fixed IT tests after introduction of presync
unmarshall Jun 3, 2024
413e77a
addressed review comments from @ishan16696
unmarshall Jun 3, 2024
0cd42b7
removed unused code in it tests
unmarshall Jun 3, 2024
68b5d1a
added log for failed status updates
unmarshall Jun 4, 2024
f6af511
addressed review comment from @ishan16696 regarding doc string for re…
unmarshall Jun 4, 2024
ff88140
changed client.List to client.Get in GetStatefulSet
unmarshall Jun 4, 2024
e9bee1b
refactored sentinel webhook, includes protection for PVC deletion and…
unmarshall Jun 7, 2024
ac9264e
fixed sentinel webhook issues
unmarshall Jun 9, 2024
78411ae
refactored decoder utility for webhook and added a utility method to …
unmarshall Jun 10, 2024
2406a6e
renamed sentinel webhook to etcdcompents and adapted cli, env vars an…
unmarshall Jun 11, 2024
553736a
Add log line for statefulset component PreSync
shreyas-s-rao Jun 4, 2024
4c6cf00
Statefulset PreSync now checks sts status instead of pod metadata, to…
shreyas-s-rao Jun 11, 2024
5cc2aa7
Fix it tests by simulating sts status changes upon spec changes
shreyas-s-rao Jun 11, 2024
4aa2d36
Fix e2e tests
shreyas-s-rao Jun 11, 2024
63cfadd
Map `stackit` infra provider to S3
maboehm Jun 12, 2024
aa41f39
Fix status member checks
shreyas-s-rao Jun 14, 2024
006e470
addressed review comments, added logchecker to golangci
unmarshall Jun 17, 2024
4843c75
Minor fixes
shreyas-s-rao Jun 23, 2024
1411202
Remove scale subresource label selector; fix compaction e2e test
shreyas-s-rao Jun 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 3 additions & 13 deletions .ci/hack/doc.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
// Copyright 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
//
// 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.
// SPDX-License-Identifier: Apache-2.0

// This package imports CI related scripts - it is to force `go mod` to see them as dependencies.
// Package ci imports CI related scripts - it is to force `go mod` to see them as dependencies.
package ci
15 changes: 2 additions & 13 deletions .ci/hack/prepare_release
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
#!/usr/bin/env sh
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
#
# Copyright 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# 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.
# SPDX-License-Identifier: Apache-2.0

set -e

Expand Down
15 changes: 2 additions & 13 deletions .ci/hack/set_dependency_version
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
#
# Copyright 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# 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.
# SPDX-License-Identifier: Apache-2.0

import json
import pathlib
Expand Down
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
!controllers/
!pkg/
!test/
!internal/
!vendor/
!.golangci.yaml
!go.mod
!go.sum
Expand Down
14 changes: 2 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# Copyright 2023 SAP SE or an SAP affiliate company
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
#
# 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.
# SPDX-License-Identifier: Apache-2.0

# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
Expand Down
23 changes: 19 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
run:
concurrency: 4
deadline: 10m

skip-files:
- "zz_generated\\..*\\.go$"
timeout: 10m

linters:
disable:
- unused
enable:
- revive
- loggercheck

issues:
exclude-use-default: false
Expand All @@ -32,3 +30,20 @@ issues:
- linters:
- staticcheck
text: "SA1019:" # Excludes messages where deprecated variables are used

exclude-files:
- "zz_generated\\..*\\.go$"

linters-settings:
revive:
rules:
- name: duplicated-imports
- name: unused-parameter
- name: unreachable-code
- name: context-as-argument
- name: early-return
- name: exported
loggercheck:
no-printf-like: true
logr: true
zap: true
171 changes: 101 additions & 70 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,93 +22,76 @@ IMG ?= ${IMAGE_REPOSITORY}:${IMAGE_BUILD_TAG}
#########################################

TOOLS_DIR := $(HACK_DIR)/tools
include $(HACK_DIR)/tools.mk
include $(GARDENER_HACK_DIR)/tools.mk
include $(HACK_DIR)/tools.mk

#####################################################################
# Rules for verification, formatting, linting, testing and cleaning #
#####################################################################

.PHONY: tidy
tidy:
@env GO111MODULE=on go mod tidy
@GARDENER_HACK_DIR=$(GARDENER_HACK_DIR) bash $(HACK_DIR)/update-github-templates.sh
@cp $(GARDENER_HACK_DIR)/cherry-pick-pull.sh $(HACK_DIR)/cherry-pick-pull.sh && chmod +xw $(HACK_DIR)/cherry-pick-pull.sh

kind-up kind-down ci-e2e-kind deploy-localstack test-e2e: export KUBECONFIG = $(KUBECONFIG_PATH)

all: druid

# Build manager binary
.PHONY: druid
druid: fmt check
@env GO111MODULE=on go build -o bin/druid main.go

# Run against the configured Kubernetes cluster in ~/.kube/config
.PHONY: run
run: fmt check
go run ./main.go

# Install CRDs into a cluster
.PHONY: install
install: manifests
kubectl apply -f config/crd/bases

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
.PHONY: deploy-via-kustomize
deploy-via-kustomize: manifests $(KUSTOMIZE)
kubectl apply -f config/crd/bases
kustomize build config/default | kubectl apply -f -
.PHONY: clean
clean:
@bash $(GARDENER_HACK_DIR)/clean.sh ./api/... ./internal/...

# Deploy controller to the Kubernetes cluster specified in the environment variable KUBECONFIG
# Modify the Helm template located at charts/druid/templates if any changes are required
.PHONY: deploy
deploy: $(SKAFFOLD) $(HELM)
$(SKAFFOLD) run -m etcd-druid --kubeconfig=$(KUBECONFIG_PATH)
.PHONY: update-dependencies
update-dependencies:
@env GO111MODULE=on go get -u
@make tidy

# Generate manifests e.g. CRD, RBAC etc.
.PHONY: manifests
manifests: $(VGOPATH) $(CONTROLLER_GEN)
@GARDENER_HACK_DIR=$(GARDENER_HACK_DIR) VGOPATH=$(VGOPATH) go generate ./config/crd/bases
@find "$(REPO_ROOT)/config/crd/bases" -name "*.yaml" -exec cp '{}' "$(REPO_ROOT)/charts/druid/charts/crds/templates/" \;
@controller-gen rbac:roleName=manager-role paths="./controllers/..."
.PHONY: add-license-headers
add-license-headers: $(GO_ADD_LICENSE)
@bash $(HACK_DIR)/addlicenseheaders.sh ${YEAR}

# Run go fmt against code
.PHONY: fmt
fmt:
@env GO111MODULE=on go fmt ./...

.PHONY: clean
clean:
@bash $(GARDENER_HACK_DIR)/clean.sh ./api/... ./controllers/... ./pkg/...

# Check packages
.PHONY: check
check: $(GOLANGCI_LINT) $(GOIMPORTS) fmt manifests
@REPO_ROOT=$(REPO_ROOT) bash $(GARDENER_HACK_DIR)/check.sh --golangci-lint-config=./.golangci.yaml ./api/... ./pkg/... ./controllers/...
@REPO_ROOT=$(REPO_ROOT) bash $(GARDENER_HACK_DIR)/check.sh --golangci-lint-config=./.golangci.yaml ./api/... ./internal/...

.PHONY: check-generate
check-generate:
@bash $(GARDENER_HACK_DIR)/check-generate.sh "$(REPO_ROOT)"

# Generate manifests e.g. CRD, RBAC etc.
.PHONY: manifests
manifests: $(VGOPATH) $(CONTROLLER_GEN)
@HACK_DIR=$(HACK_DIR) VGOPATH=$(VGOPATH) go generate ./config/crd/bases
@find "$(REPO_ROOT)/config/crd/bases" -name "*.yaml" -exec cp '{}' "$(REPO_ROOT)/charts/druid/charts/crds/templates/" \;
@controller-gen rbac:roleName=manager-role paths="./internal/controller/..."

# Generate code
.PHONY: generate
generate: manifests $(CONTROLLER_GEN) $(GOIMPORTS) $(MOCKGEN)
@go generate "$(REPO_ROOT)/pkg/..."
@bash $(HACK_DIR)/update-codegen.sh

# Build the docker image
.PHONY: docker-build
docker-build:
docker build . -t ${IMG} --rm
@echo "updating kustomize image patch file for manager resource"
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml

# Push the docker image
.PHONY: docker-push
docker-push:
docker push ${IMG}
@go generate "$(REPO_ROOT)/internal/..."
@"$(HACK_DIR)/update-codegen.sh"

# Run tests
.PHONY: test
test: $(GINKGO) $(SETUP_ENVTEST)
@bash $(HACK_DIR)/test.sh ./api/... ./controllers/... ./pkg/...
test: $(GINKGO) $(GOTESTFMT)
# run ginkgo unit tests. These will be ported to golang native tests over a period of time.
@"$(HACK_DIR)/test.sh" ./internal/controller/etcdcopybackupstask/... \
./internal/controller/predicate/... \
./internal/controller/secret/... \
./internal/controller/utils/... \
./internal/mapper/... \
./internal/metrics/...
# run the golang native unit tests.
@TEST_COV="true" "$(HACK_DIR)/test-go.sh" ./api/... ./internal/controller/etcd/... ./internal/controller/compaction/... ./internal/component/... ./internal/utils/... ./internal/webhook/...

.PHONY: test-integration
test-integration: $(GINKGO) $(SETUP_ENVTEST) $(GOTESTFMT)
@SETUP_ENVTEST="true" "$(HACK_DIR)/test.sh" ./test/integration/...
@SETUP_ENVTEST="true" "$(HACK_DIR)/test-go.sh" ./test/it/...

.PHONY: test-cov
test-cov: $(GINKGO) $(SETUP_ENVTEST)
Expand All @@ -118,22 +101,32 @@ test-cov: $(GINKGO) $(SETUP_ENVTEST)
test-cov-clean:
@bash $(GARDENER_HACK_DIR)/test-cover-clean.sh

.PHONY: test-e2e
test-e2e: $(KUBECTL) $(HELM) $(SKAFFOLD) $(KUSTOMIZE)
@bash $(HACK_DIR)/e2e-test/run-e2e-test.sh $(PROVIDERS)
#################################################################
# Rules related to binary build, Docker image build and release #
#################################################################

.PHONY: test-integration
test-integration: $(GINKGO) $(SETUP_ENVTEST)
@bash $(HACK_DIR)/test.sh ./test/integration/...
# Build manager binary
.PHONY: druid
druid: fmt check
@env GO111MODULE=on go build -o bin/druid main.go

.PHONY: update-dependencies
update-dependencies:
@env GO111MODULE=on go get -u
@make tidy
# Build the docker image
.PHONY: docker-build
docker-build:
docker build . -t ${IMG} --rm
@echo "updating kustomize image patch file for manager resource"
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml

.PHONY: add-license-headers
add-license-headers: $(GO_ADD_LICENSE)
@bash $(HACK_DIR)/addlicenseheaders.sh ${YEAR}
# Push the docker image
.PHONY: docker-push
docker-push:
docker push ${IMG}

#####################################################################
# Rules for local environment #
#####################################################################

kind-up kind-down ci-e2e-kind deploy-localstack test-e2e deploy deploy-dev deploy-debug undeploy: export KUBECONFIG = $(KUBECONFIG_PATH)

.PHONY: kind-up
kind-up: $(KIND)
Expand All @@ -144,10 +137,48 @@ kind-up: $(KIND)
kind-down: $(KIND)
$(KIND) delete cluster --name etcd-druid-e2e

# Install CRDs into a cluster
.PHONY: install
install: manifests
kubectl apply -f config/crd/bases

# Run against the configured Kubernetes cluster in ~/.kube/config or specified by environment variable KUBECONFIG
.PHONY: run
run:
go run ./main.go

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
.PHONY: deploy-via-kustomize
deploy-via-kustomize: manifests $(KUSTOMIZE)
kubectl apply -f config/crd/bases
kustomize build config/default | kubectl apply -f -

# Deploy controller to the Kubernetes cluster specified in the environment variable KUBECONFIG
# Modify the Helm template located at charts/druid/templates if any changes are required
.PHONY: deploy
deploy: $(SKAFFOLD) $(HELM)
$(SKAFFOLD) run -m etcd-druid

.PHONY: deploy-dev
deploy-dev: $(SKAFFOLD) $(HELM)
$(SKAFFOLD) dev --cleanup=false -m etcd-druid --trigger='manual'

unmarshall marked this conversation as resolved.
Show resolved Hide resolved
.PHONY: deploy-debug
deploy-debug: $(SKAFFOLD) $(HELM)
$(SKAFFOLD) debug --cleanup=false -m etcd-druid

.PHONY: undeploy
undeploy: $(SKAFFOLD) $(HELM)
$(SKAFFOLD) delete -m etcd-druid

.PHONY: deploy-localstack
deploy-localstack: $(KUBECTL)
@bash $(HACK_DIR)/deploy-localstack.sh

.PHONY: test-e2e
test-e2e: $(KUBECTL) $(HELM) $(SKAFFOLD) $(KUSTOMIZE)
@bash $(HACK_DIR)/e2e-test/run-e2e-test.sh $(PROVIDERS)

.PHONY: ci-e2e-kind
ci-e2e-kind:
@BUCKET_NAME=$(BUCKET_NAME) bash $(HACK_DIR)/ci-e2e-kind.sh
24 changes: 2 additions & 22 deletions api/v1alpha1/types_common.go → api/v1alpha1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,10 @@
package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// StorageProvider defines the type of object store provider for storing backups.
type StorageProvider string

// StoreSpec defines parameters related to ObjectStore persisting backups
type StoreSpec struct {
// Container is the name of the container the backup is stored at.
// +optional
Container *string `json:"container,omitempty"`
// Prefix is the prefix used for the store.
// +required
Prefix string `json:"prefix"`
// Provider is the name of the backup provider.
// +optional
Provider *StorageProvider `json:"provider,omitempty"`
// SecretRef is the reference to the secret which used to connect to the backup store.
// +optional
SecretRef *corev1.SecretReference `json:"secretRef,omitempty"`
}

// ConditionType is the type of a condition.
// ConditionType is the type of condition.
type ConditionType string

// ConditionStatus is the status of a condition.
Expand Down Expand Up @@ -60,6 +40,6 @@ type Condition struct {
LastUpdateTime metav1.Time `json:"lastUpdateTime"`
// The reason for the condition's last transition.
Reason string `json:"reason"`
// A human readable message indicating details about the transition.
// A human-readable message indicating details about the transition.
Message string `json:"message"`
}
Loading