Skip to content

Commit a75234b

Browse files
authored
Revendor g/g v1.119 (#24)
* Delete vendor dir * clean up hack dir * tooling updates/changes * Update to gardener v1.119.0 & machine-controller-manager v0.58.0 with various small improvements
1 parent 887931c commit a75234b

4,225 files changed

Lines changed: 1497 additions & 1391933 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/hack/component_descriptor

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
3+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
# Configuration Options:
8+
#
9+
# COMPONENT_PREFIXES: Set the image prefix that should be used to
10+
# determine if an image is defined by another component.
11+
# Defaults to "europe-docker.pkg.dev/gardener-project/releases/gardener"
12+
#
13+
# COMPONENT_CLI_ARGS: Set all component-cli arguments.
14+
# This should be used with care as all defaults are overwritten.
15+
#
16+
17+
set -e
18+
19+
repo_root_dir="$1"
20+
repo_name="${2:-github.com/gardener/gardener}"
21+
descriptor_out_file="${COMPONENT_DESCRIPTOR_PATH}"
22+
23+
resources_file="$repo_root_dir/.ci/resources.yaml"
24+
if [[ -f ${resources_file} ]]; then
25+
echo "Adding additional resources from ${resources_file}"
26+
27+
# component-cli expects a directory where the component descriptor file is named component-descriptor.yaml.
28+
# however the pre-rendered component descriptors of the pipeline have different filenames.
29+
# therefore create a tempdir and copy the pre-rendered component descriptor to it with the correct filename.
30+
tmp_dir="$(mktemp -d)"
31+
tmp_cd="${tmp_dir}/component-descriptor.yaml"
32+
cp "${BASE_DEFINITION_PATH}" "${tmp_cd}"
33+
echo "${tmp_cd}"
34+
35+
# read the component version.
36+
if [[ -z ${EFFECTIVE_VERSION} ]]; then
37+
echo "The env variable EFFECTIVE_VERSION must be set"
38+
exit 1
39+
fi
40+
41+
# adds all resources defined in the resources file to the component descriptor.
42+
component-cli component-archive resources add ${tmp_dir} ${resources_file} -v=3 -- COMPONENT_VERSION=${EFFECTIVE_VERSION}
43+
44+
# move modified component descriptor back to the original file.
45+
mv "${tmp_cd}" "${BASE_DEFINITION_PATH}"
46+
else
47+
echo "Resources file ${resources_file} not found. Skip adding additional resources."
48+
fi
49+
50+
echo "Enriching component descriptor from ${BASE_DEFINITION_PATH}"
51+
52+
image_vector_path=""
53+
if [[ -f "$repo_root_dir/charts/images.yaml" ]]; then
54+
image_vector_path="$repo_root_dir/charts/images.yaml"
55+
elif [[ -f "$repo_root_dir/imagevector/images.yaml" ]]; then
56+
image_vector_path="$repo_root_dir/imagevector/images.yaml"
57+
elif [[ -f "$repo_root_dir/imagevector/containers.yaml" ]]; then
58+
image_vector_path="$repo_root_dir/imagevector/containers.yaml"
59+
fi
60+
61+
if [[ ! -z "$image_vector_path" ]]; then
62+
# default environment variables
63+
if [[ -z "${COMPONENT_PREFIXES}" ]]; then
64+
COMPONENT_PREFIXES="europe-docker.pkg.dev/gardener-project/releases/gardener,europe-docker.pkg.dev/gardener-project/snapshots/gardener"
65+
fi
66+
67+
if [[ -z "${COMPONENT_CLI_ARGS}" ]]; then
68+
COMPONENT_CLI_ARGS="
69+
--comp-desc ${BASE_DEFINITION_PATH} \
70+
--image-vector "$image_vector_path" \
71+
--component-prefixes "${COMPONENT_PREFIXES}" \
72+
"
73+
fi
74+
75+
# translates all images defined the containers.yaml into component descriptor resources.
76+
# For detailed documentation see https://github.com/gardener/component-cli/blob/main/docs/reference/components-cli_image-vector_add.md
77+
component-cli image-vector add ${COMPONENT_CLI_ARGS}
78+
fi
79+
80+
cp "${BASE_DEFINITION_PATH}" "${descriptor_out_file}"

.ci/hack/doc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
// This package imports CI related scripts - it is to force `go mod` to see them as dependencies.
8+
package ci

.ci/hack/prepare_release

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/usr/bin/env sh
2+
#
3+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
set -e
8+
9+
repo_root_dir="$(realpath $1)"
10+
repo_base="$2"
11+
repo_name="$3"
12+
13+
apk update
14+
apk add --no-cache \
15+
ca-certificates \
16+
make \
17+
bash \
18+
git \
19+
curl \
20+
openssl \
21+
tar \
22+
gzip \
23+
sed \
24+
jq
25+
26+
# create virtual package with the dev tools
27+
echo "Installing dev tools in a virtual package"
28+
apk add --no-cache --virtual .build-deps \
29+
gcc \
30+
go \
31+
musl-dev
32+
33+
GOLANG_VERSION="$(sed -rn 's/FROM (eu\.gcr\.io\/gardener-project\/3rd\/golang|golang):([^ ]+).*/\2/p' < "$repo_root_dir/Dockerfile")"
34+
35+
# As we cannot expect alpine to provide and maintain all golang versions via apk, we need to find another way to install the required golang version.
36+
# Alpine is using musl-libc instead of glibc, therefore we cannot use the available pre-built binaries from golang, but have to build them ourselves from source.
37+
# refs:
38+
# - https://stackoverflow.com/a/45987284
39+
# - https://github.com/docker-library/golang/blob/f300e60ca19c3b98cfcf01ca112af2ac10104320/1.16/alpine3.14/Dockerfile
40+
echo "Downloading go src $GOLANG_VERSION"
41+
rm -rf /usr/local/go
42+
wget -q -O - "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz" | tar zx -C /usr/local
43+
44+
# Configure golang environment
45+
echo "Building and installing go $GOLANG_VERSION"
46+
export \
47+
PATH="/usr/local/go/bin":$PATH \
48+
GOARCH="$(go env GOARCH)" \
49+
GOOS="$(go env GOOS)" \
50+
GOROOT_BOOTSTRAP="$(go env GOROOT)"
51+
export GOHOSTOS="$GOOS" \
52+
GOHOSTARCH="$GOARCH"
53+
cd /usr/local/go/src
54+
echo "Executing make on go $GOLANG_VERSION"
55+
./make.bash
56+
57+
echo "Deleting the virtual package for go"
58+
apk del --no-network .build-deps
59+
60+
export GOROOT="/usr/local/go"
61+
export GOPATH="$(mktemp -d)"
62+
export GOBIN="$GOPATH/bin"
63+
export PATH="$GOBIN:$PATH"
64+
65+
REPO_BASE="$GOPATH/src/$repo_base"
66+
mkdir -p "$REPO_BASE"
67+
REPO_PATH="$REPO_BASE/$repo_name"
68+
cp -R "$repo_root_dir" "$REPO_PATH"
69+
70+
current_dir="$(pwd)"
71+
cd "$REPO_PATH"
72+
73+
if make -n install-requirements &>/dev/null; then
74+
make install-requirements
75+
else
76+
echo "skipping optional 'make install-requirements' as it is not present"
77+
fi
78+
79+
cd "$current_dir"
80+
81+
echo "$EFFECTIVE_VERSION" > "$REPO_PATH/VERSION"
82+
cur_dir="$(pwd)"
83+
cd "$REPO_PATH"
84+
if ! make generate; then
85+
cd "$cur_dir"
86+
exit 1
87+
fi
88+
cd "$cur_dir"
89+
cp -RT "$REPO_PATH/" "$repo_root_dir/"

.ci/hack/set_dependency_version

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#!/usr/bin/env python3
2+
#
3+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
import json
8+
import pathlib
9+
import sys
10+
11+
import ci.util
12+
13+
14+
dependency_type = ci.util.check_env('DEPENDENCY_TYPE')
15+
if not dependency_type == 'component':
16+
ci.util.fail(
17+
"don't know how to upgrade dependency type: "
18+
f'{dependency_type}'
19+
)
20+
21+
dependency_name = ci.util.check_env('DEPENDENCY_NAME')
22+
dependency_version = ci.util.check_env('DEPENDENCY_VERSION')
23+
24+
images_file = pathlib.Path(
25+
ci.util.check_env('REPO_DIR'),
26+
'imagevector',
27+
'images.yaml',
28+
)
29+
30+
31+
class ImagesParser(object):
32+
'''
33+
a naive YAML-parser crafted for the special case of processing
34+
gardener's images.yaml file; crafted that way to preserve
35+
comments/empty lines
36+
'''
37+
def __init__(
38+
self,
39+
images_file,
40+
names,
41+
target_version,
42+
):
43+
self.images_file = images_file
44+
self.lines = images_file.read_text().split('\n')
45+
self.names = names
46+
self.target_version = target_version
47+
self._line_idx = 0
48+
49+
def _line(self):
50+
return self.lines[self._line_idx]
51+
52+
def _next_line(self):
53+
self._line_idx += 1
54+
return self._line()
55+
56+
def _skip_to_next_entry(self, names):
57+
while not self._line().startswith('-'):
58+
self._next_line()
59+
name = self._line().strip().split(':')[-1].strip()
60+
61+
if name not in names:
62+
self._next_line()
63+
return self._skip_to_next_entry(names)
64+
65+
# found one of the entries:
66+
return name
67+
68+
def _skip_to_next_tag(self):
69+
self._next_line()
70+
while not self._line().startswith('-'):
71+
if self._line().strip().startswith('tag:'):
72+
return
73+
self._next_line()
74+
raise RuntimeError('did not find tag attribute')
75+
76+
def set_versions(self):
77+
while self.names:
78+
try:
79+
name = self._skip_to_next_entry(self.names)
80+
except IndexError:
81+
print(str(self.names))
82+
ci.util.fail('don\'t know how to update ' + str(self.names))
83+
self.names.remove(name)
84+
self._skip_to_next_tag()
85+
tag_line = self._line()
86+
indent = len(tag_line) - len(tag_line.lstrip())
87+
patched_line = ' ' * indent + 'tag: "{version}"'.format(
88+
version=self.target_version,
89+
)
90+
self.lines[self._line_idx] = patched_line
91+
92+
def write_updated_file(self):
93+
self.images_file.write_text(
94+
'\n'.join(self.lines)
95+
)
96+
97+
98+
# optionally load special cases from first argument given as JSON
99+
injectedSpecialCases = {}
100+
if len(sys.argv) == 2:
101+
injectedSpecialCases = json.loads(sys.argv[1])
102+
103+
# handle special cases
104+
name = dependency_name.split('/')[-1]
105+
if name in injectedSpecialCases:
106+
names = injectedSpecialCases[name]
107+
elif name == 'autoscaler':
108+
names = ['cluster-autoscaler']
109+
elif name == 'vpn2':
110+
names = ['vpn-server', 'vpn-client']
111+
elif name == 'external-dns-management':
112+
names = ['dns-controller-manager']
113+
elif name == 'logging':
114+
names = ['fluent-bit-plugin-installer', 'vali-curator', 'telegraf', 'event-logger', 'tune2fs']
115+
elif name == 'etcd-custom-image':
116+
names = ['etcd']
117+
elif name == 'egress-filter-refresher':
118+
names = ['egress-filter']
119+
elif name == 'apiserver-proxy':
120+
names = ['apiserver-proxy-sidecar']
121+
else:
122+
names = [name]
123+
124+
125+
parser = ImagesParser(
126+
images_file=images_file,
127+
names=names,
128+
target_version=dependency_version,
129+
)
130+
131+
parser.set_versions()
132+
parser.write_updated_file()

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug encountered while working with this Gardener extension
4+
5+
---
6+
7+
**How to categorize this issue?**
8+
<!--
9+
Please select area, kind, and priority for this issue. This helps the community categorizing it.
10+
Replace below TODOs or exchange the existing identifiers with those that fit best in your opinion.
11+
If multiple identifiers make sense you can also state the commands multiple times, e.g.
12+
/area control-plane
13+
/area auto-scaling
14+
...
15+
16+
"/area" identifiers: audit-logging|auto-scaling|backup|certification|control-plane-migration|control-plane|cost|delivery|dev-productivity|disaster-recovery|documentation|high-availability|logging|metering|monitoring|networking|open-source|ops-productivity|os|performance|quality|robustness|scalability|security|storage|testing|usability|user-management
17+
"/kind" identifiers: api-change|bug|cleanup|discussion|enhancement|epic|impediment|poc|post-mortem|question|regression|task|technical-debt|test
18+
-->
19+
/area TODO
20+
/kind bug
21+
/platform openstack
22+
23+
**What happened**:
24+
25+
**What you expected to happen**:
26+
27+
**How to reproduce it (as minimally and precisely as possible)**:
28+
29+
**Anything else we need to know?**:
30+
31+
**Environment**:
32+
33+
- Gardener version (if relevant):
34+
- Extension version:
35+
- Kubernetes version (use `kubectl version`):
36+
- Cloud provider or hardware configuration:
37+
- Others:

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Enhancement Request
3+
about: Suggest an enhancement for this extension
4+
5+
---
6+
7+
**How to categorize this issue?**
8+
<!--
9+
Please select area, kind, and priority for this issue. This helps the community categorizing it.
10+
Replace below TODOs or exchange the existing identifiers with those that fit best in your opinion.
11+
If multiple identifiers make sense you can also state the commands multiple times, e.g.
12+
/area control-plane
13+
/area auto-scaling
14+
...
15+
16+
"/area" identifiers: audit-logging|auto-scaling|backup|certification|control-plane-migration|control-plane|cost|delivery|dev-productivity|disaster-recovery|documentation|high-availability|logging|metering|monitoring|networking|open-source|ops-productivity|os|performance|quality|robustness|scalability|security|storage|testing|usability|user-management
17+
"/kind" identifiers: api-change|bug|cleanup|discussion|enhancement|epic|impediment|poc|post-mortem|question|regression|task|technical-debt|test
18+
-->
19+
/area TODO
20+
/kind enhancement
21+
/platform openstack
22+
23+
**What would you like to be added**:
24+
25+
**Why is this needed**:

0 commit comments

Comments
 (0)