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

First version of etcd-wrapper #3

Merged
merged 99 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
53303db
Replicate etcd bootstrap script
aaronfern Jan 26, 2023
42b2c13
misc changes during code review
unmarshall Mar 22, 2023
fa1b3d9
refactoring and general fixes
aaronfern Mar 22, 2023
4dfe60a
code reordering and doc strings
aaronfern Mar 22, 2023
f3ee554
minor code refactoring
aaronfern Mar 23, 2023
f77e90d
added logic to wait for StopNotify, Err and ReadNotify channels, othe…
unmarshall Mar 23, 2023
e9dc275
passed parent context to brclient methods
aaronfern Mar 23, 2023
6561537
Added timeout for etcd to get ready
aaronfern Mar 23, 2023
b4bd0a3
added gomega dep, added unit test for sidecarconfig, minor refactorin…
unmarshall Mar 24, 2023
df7803c
added logo and updated README
unmarshall Mar 24, 2023
6f18dd8
added dockerignore, created hack/build.sh, makefile and .ci/build cha…
unmarshall Mar 24, 2023
161e8e6
Removed hardcoded file paths
aaronfern Mar 24, 2023
1db2882
passing cancelFn to cancel context when exiting, reviewed readycheck …
unmarshall Mar 27, 2023
23e0606
Added cache for ready check and added unit test cases to all packages
aaronfern Mar 29, 2023
6d5c34b
minor refactoring, tests adjusted, added testdata
unmarshall Mar 30, 2023
9da2937
added missing license headers
unmarshall Mar 30, 2023
ea7748d
refactored tests and other small changes
unmarshall Mar 31, 2023
ed2763c
fixed tests
unmarshall Mar 31, 2023
2d6aa58
added test for signal.go
unmarshall Apr 1, 2023
771cc11
Updated a few unit tests
aaronfern Apr 3, 2023
1818d2e
initial docs
unmarshall Apr 3, 2023
2cb4876
removed background from logo
unmarshall Apr 3, 2023
3ece6d8
fixed sharpness of logo
unmarshall Apr 3, 2023
4af5bf2
again fixed sharpness and size
unmarshall Apr 3, 2023
2cc8ae8
minor changes in README.md
unmarshall Apr 3, 2023
8f9b98b
removed pki test resources, these are now generated before tests and …
unmarshall Apr 11, 2023
929df85
Apply suggestions from code review
unmarshall Apr 13, 2023
fdbdb98
addressed review comments from Sesha
unmarshall Apr 13, 2023
ac82992
Apply suggestions from code review
unmarshall Apr 13, 2023
28e2d84
addressed review comments from Sesha
unmarshall Apr 14, 2023
36d1418
Updated docs
aaronfern Apr 14, 2023
9ea3177
Added test case for CaptureExitCode()
aaronfern Apr 14, 2023
0332d98
created example folder and moved etcd-sts yaml there, small change to…
unmarshall Apr 14, 2023
daf564b
addressed review comment from sesha
unmarshall Apr 14, 2023
5c51438
Updated documentation
aaronfern Apr 14, 2023
811cf80
Added doc for bootstrap
aaronfern Apr 19, 2023
28f4d94
added bootstrap image, changed yaml files, adjusted setup guide and b…
unmarshall Apr 20, 2023
dcc348a
Update bootstrap.md
unmarshall Apr 20, 2023
5ca7dfc
Update bootstrap.md
unmarshall Apr 20, 2023
8cdcf50
Update bootstrap.md
unmarshall Apr 20, 2023
1a9c3fb
Update README.md
unmarshall Apr 20, 2023
bc29f53
Update setup doc to add TLS to the app
aaronfern Apr 20, 2023
c8e87ac
Added doc for ops
aaronfern Apr 20, 2023
71e0304
Apply suggestions from code review
unmarshall Apr 20, 2023
df21548
minor changes to ops.md
unmarshall Apr 21, 2023
0352815
added license
unmarshall Apr 21, 2023
ccf65f2
added go reportcard status to readme
unmarshall Apr 21, 2023
1a7c007
addressed review comments
unmarshall Apr 21, 2023
e1915b8
addressed review comments
unmarshall Apr 21, 2023
7774cbf
Address review comments
aaronfern Apr 21, 2023
875cf41
Restructured some functions to make them more readable
aaronfern Apr 24, 2023
673125a
Moved etcdReady into the app struct
aaronfern Apr 24, 2023
ef9b54c
Test commit to fix pipeline tests
aaronfern Apr 26, 2023
a1cce75
added skaffold support, fixed brclient, modified examples
unmarshall May 2, 2023
145a708
minor fix to docs
unmarshall May 2, 2023
beec414
Fixed CI script common.sh
seshachalam-yv May 3, 2023
8c12dfc
Fixed CI script common.sh and Test file
seshachalam-yv May 3, 2023
ee0df27
add debug logs
seshachalam-yv May 3, 2023
0c0ed2f
Debug make build
seshachalam-yv May 3, 2023
83cb58b
Debug make check
seshachalam-yv May 3, 2023
e822b12
Debug make check
seshachalam-yv May 3, 2023
859908e
minor changes to scripts
unmarshall May 8, 2023
84f74c7
added license badge
unmarshall May 8, 2023
53dc33f
added KO to build images for local deployments
unmarshall May 8, 2023
989dee3
addressed review comments - first batch
unmarshall May 8, 2023
ca3e2b1
removed WIP which was pushed accidentally
unmarshall May 8, 2023
9c24b70
Apply suggestions from code review
unmarshall May 8, 2023
3de29d5
addressed review comments
unmarshall May 8, 2023
2195ce4
fixed compilation issues as a result of accepting review suggestions
unmarshall May 8, 2023
b711ec4
Rename files to make them more intuitive
aaronfern May 12, 2023
6d957c9
Adressed review feedback
aaronfern May 12, 2023
87f4dd5
addressed review comments
unmarshall May 17, 2023
4bf9e86
addressed review comments and corrected discrepancies in etcd command…
unmarshall May 22, 2023
09d9bf8
corrected cmd line parameters in example yaml. Also enabled auto-dele…
unmarshall May 22, 2023
bb09859
removed pki_gen script, fixed TLS bugs, now generating all test resou…
unmarshall Jun 2, 2023
78e944f
removed skaffold yaml as now it is auto-generated
unmarshall Jun 2, 2023
d63a762
Editted docker file and scripts
aaronfern Jun 14, 2023
84592a8
added dry-run option for etcd-up, updated usage doc
unmarshall Jun 14, 2023
c31a1f0
added a section to upload docker image to ops.md
unmarshall Jun 14, 2023
19ef9c3
adapted to change in etcdbr command args format and also edited the c…
unmarshall Jun 16, 2023
a9f69c5
Updated manifest files and gitignore
aaronfern Jun 19, 2023
f0017dd
Vendor etcd v3.4.26
aaronfern Jun 27, 2023
ea39aaa
addressed review comments
unmarshall Jul 3, 2023
a840477
removed test security artifacts and enhanced gitignore
unmarshall Jul 3, 2023
5bbf90c
addressed review comments
unmarshall Jul 5, 2023
861f7b3
addressed review comment
unmarshall Jul 5, 2023
e17d057
Updated etcd version used in ops pod to v3.4.26
aaronfern Jul 5, 2023
acfbf7b
added pre-requisites section in local-setup
unmarshall Jul 6, 2023
d59bdbd
added validation preventing wrapper tag to be specified
unmarshall Jul 6, 2023
fc64bdb
changed the order of cleaup in local-setup doc
unmarshall Jul 6, 2023
ed6d569
added check before cleanup of resources
unmarshall Jul 6, 2023
4472a31
addressed review comment
unmarshall Jul 6, 2023
1769761
moved cleanup section to the end of local-dev-setup md
unmarshall Jul 6, 2023
c0d1037
made cleanup choice multi-line and more readable
unmarshall Jul 6, 2023
88bba26
Removed ready check log
aaronfern Jul 10, 2023
e4e50dd
added script to print PKI resource paths for ops dockerfile, udpated …
unmarshall Jul 10, 2023
0423304
added ignore rules for PKI resources
unmarshall Jul 11, 2023
fa4d3d0
added additional resources to gitignore
unmarshall Jul 11, 2023
6b8eb89
removed testutil prefixes from unit test table tests
unmarshall Jul 11, 2023
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
  •  
  •  
  •  
29 changes: 20 additions & 9 deletions .ci/build
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#!/usr/bin/env bash
# Copyright 2023 SAP SE or an SAP affiliate company
#
# 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.

set -eo pipefail
set -o errexit
set -o nounset
set -o pipefail

# For all steps, concourse will set the following environment variables:
# SOURCE_PATH - path to component repository root directory.
Expand All @@ -19,15 +34,11 @@ else
BINARY_PATH="$(readlink -f "${BINARY_PATH}")/bin"
fi
export BINARY_PATH
echo ${BINARY_PATH}

# TODO: needed?
source "${SOURCE_PATH}/.ci/common.sh"

###############################################################################
#################################################################

CGO_ENABLED=0 GO111MODULE=on go build \
-mod vendor \
-v \
-o "${BINARY_PATH}"/etcd-wrapper \
main.go
echo "> Build..."
make build
echo "Build completed successfully"
11 changes: 10 additions & 1 deletion .ci/check
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ set -o errexit
set -o nounset
set -o pipefail

source "$(dirname "${0}")"/common.sh
# For all steps, concourse will set the following environment variables:
# SOURCE_PATH - path to component repository root directory.
if [[ -z "${SOURCE_PATH}" ]]; then
SOURCE_PATH="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")"
else
SOURCE_PATH="$(readlink -f "${SOURCE_PATH}")"
fi
export SOURCE_PATH

source "${SOURCE_PATH}/.ci/common.sh"

#################################################################

Expand Down
42 changes: 25 additions & 17 deletions .ci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# The `go <cmd>` commands requires to see the target repository to be part of a
# Go workspace. Thus, if we are not yet in a Go workspace, let's create one
# temporarily by using symbolic links.
set -eo pipefail

# For the test step concourse will set the following environment variables:
# SOURCE_PATH - path to component repository root directory.
if [[ $(uname) == 'Darwin' ]]; then
READLINK_BIN="greadlink"
else
READLINK_BIN="readlink"
fi

if [[ -z "${SOURCE_PATH}" ]]; then
export SOURCE_PATH="$(${READLINK_BIN} -f "$(dirname ${0})/..")"
else
export SOURCE_PATH="$(${READLINK_BIN} -f "${SOURCE_PATH}")"
if [[ -z "$SOURCE_PATH" ]]; then
echo "Environment variable SOURCE_PATH must be provided"
exit 1
fi

VCS="github.com"
ORGANIZATION="gardener"
PROJECT="etcd-wrapper"
REPOSITORY=${VCS}/${ORGANIZATION}/${PROJECT}

# The `go <cmd>` commands requires to see the target repository to be part of a
# Go workspace. Thus, if we are not yet in a Go workspace, let's create one
# temporarily by using symbolic links.
if [[ "${SOURCE_PATH}" != *"src/${REPOSITORY}" ]]; then
SOURCE_SYMLINK_PATH="${SOURCE_PATH}/tmp/src/${REPOSITORY}"
if [[ -d "${SOURCE_PATH}/tmp" ]]; then
Expand All @@ -48,5 +40,21 @@ if [[ "${SOURCE_PATH}" != *"src/${REPOSITORY}" ]]; then
export GOPATH="${SOURCE_PATH}/tmp"
export GOBIN="${SOURCE_PATH}/tmp/bin"
export PATH="${GOBIN}:${PATH}"
export GO111MODULE=on
fi
fi

# Turn colors in this script off by setting the NO_COLOR variable in your
# environment to any value:
#
# $ NO_COLOR=1 test.sh
NO_COLOR=${NO_COLOR:-""}
if [ -z "$NO_COLOR" ]; then
header=$'\e[1;33m'
reset=$'\e[0m'
else
header=''
reset=''
fi

function header_text {
echo "$header$*$reset"
}
12 changes: 11 additions & 1 deletion .ci/test
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#!/usr/bin/env bash

set -x
set -o errexit
set -o nounset
set -o pipefail

source "$(dirname "${0}")"/common.sh
# For all steps, concourse will set the following environment variables:
# SOURCE_PATH - path to component repository root directory.
if [[ -z "${SOURCE_PATH}" ]]; then
SOURCE_PATH="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")"
else
SOURCE_PATH="$(readlink -f "${SOURCE_PATH}")"
fi
export SOURCE_PATH

source "${SOURCE_PATH}/.ci/common.sh"

#################################################################

Expand Down
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Ignore everything
**

# Exclude folders relevant for build
!.git
!.dockerignore
!cmd/
!hack/
!ops/
!vendor/
!internal/
!bin/
!.golangci.yaml
!go.mod
!go.sum
!main.go
!Makefile
!VERSION
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,15 @@
.idea
.DS_Store

# Generated manifest files
hack/local-dev/manifests/common/*.yaml
hack/local-dev/manifests/singlenode/*.yaml
hack/local-dev/manifests/multinode/*.yaml
hack/local-dev/secrets/*.csr
hack/local-dev/secrets/*.pem
hack/local-dev/secrets/requests/*.json
hack/local-dev/config/etcd.conf.yaml
hack/local-dev/config/kind.config.yaml

# Go workspace file
go.work
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.20 as builder
WORKDIR /go/src/github.com/gardener/etcd-wrapper
COPY . .

# Build
RUN make build
#RUN mkdir -p /var/etcd/data

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static-debian11:nonroot AS wrapper
WORKDIR /
COPY --from=builder /go/src/github.com/gardener/etcd-wrapper/bin/etcd-wrapper /etcd-wrapper
ENTRYPOINT ["/etcd-wrapper"]
Loading