Skip to content

Commit e2f2c5b

Browse files
committed
Bump k8s dependencies to 1.23 to align with o-f/api
- logr updated from v0.4.0 to v1.2.0 (cascading implications) - Bumped to go 1.17 in Dockerfile - Amended the github action for unit tests: - the envtest binaries were very very old (K8 1.16) - the distribution of kubebuilder binaries and envtest changed in the meantime - kubebuilder is not really needed for the tests and not part of the envtest installation -> check disabled in Makefile - Used `kubectl create` instead of `kubectl apply` to avoid too long annotations for CRDs Signed-off-by: Frederic Giloux <[email protected]>
1 parent a07e3cc commit e2f2c5b

File tree

1,396 files changed

+124013
-29231
lines changed

Some content is hidden

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

1,396 files changed

+124013
-29231
lines changed

.github/workflows/unit.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ jobs:
1717
run: |
1818
os=$(go env GOOS)
1919
arch=$(go env GOARCH)
20-
curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_${os}_${arch}.tar.gz | tar -xz -C /tmp/
21-
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder
20+
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
21+
setup-envtest use --use-env -p path 1.19.x!
22+
sudo mkdir -p /usr/local/kubebuilder/bin
23+
sudo cp /home/runner/.local/share/kubebuilder-envtest/k8s/1.19.2-linux-amd64/* /usr/local/kubebuilder/bin/
2224
- name: Run unit tests
2325
run: make unit

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ WORKDIR /build
55
# install dependencies and go 1.16
66

77
# copy just enough of the git repo to parse HEAD, used to record version in OLM binaries
8-
RUN dnf update -y && dnf install -y bash make git mercurial jq wget golang && dnf upgrade -y
8+
RUN dnf update -y && dnf install -y bash make git mercurial jq wget && dnf upgrade -y
9+
RUN curl -sSL https://go.dev/dl/go1.17.6.linux-amd64.tar.gz | tar -xzf - -C /usr/local
10+
ENV PATH=/usr/local/go/bin:$PATH
911
COPY .git/HEAD .git/HEAD
1012
COPY .git/refs/heads/. .git/refs/heads
1113
RUN mkdir -p .git/objects

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ unit: kubebuilder
4949
# Ensure kubebuilder is installed before continuing
5050
KUBEBUILDER_ASSETS_ERR := not detected in $(KUBEBUILDER_ASSETS), to override the assets path set the KUBEBUILDER_ASSETS environment variable, for install instructions see https://book.kubebuilder.io/quick-start.html
5151
kubebuilder:
52-
ifeq (, $(wildcard $(KUBEBUILDER_ASSETS)/kubebuilder))
53-
$(error kubebuilder $(KUBEBUILDER_ASSETS_ERR))
54-
endif
52+
# not needed for envtest
53+
# ifeq (, $(wildcard $(KUBEBUILDER_ASSETS)/kubebuilder))
54+
# $(error kubebuilder $(KUBEBUILDER_ASSETS_ERR))
55+
# endif
5556
ifeq (, $(wildcard $(KUBEBUILDER_ASSETS)/etcd))
5657
$(error etcd $(KUBEBUILDER_ASSETS_ERR))
5758
endif

cmd/package-server/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
log "github.com/sirupsen/logrus"
88
"k8s.io/component-base/logs"
9+
"k8s.io/klog"
910

1011
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/signals"
1112
"github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/server"
@@ -19,6 +20,11 @@ func main() {
1920
options := server.NewPackageServerOptions(os.Stdout, os.Stderr)
2021
cmd := server.NewCommandStartPackageServer(ctx, options)
2122
cmd.Flags().AddGoFlagSet(flag.CommandLine)
23+
// klog flags used by dependencies need to be explicitly initialized now
24+
klogFlags := flag.NewFlagSet("klog", flag.ExitOnError)
25+
klog.InitFlags(klogFlags)
26+
cmd.Flags().AddGoFlagSet(klogFlags)
27+
2228
if err := cmd.Flags().Parse(flag.Args()); err != nil {
2329
log.Fatal(err)
2430
}

deploy/chart/crds/0000_50_olm_00-catalogsources.crd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
44
annotations:
5-
controller-gen.kubebuilder.io/version: v0.6.2
5+
controller-gen.kubebuilder.io/version: v0.8.0
66
creationTimestamp: null
77
name: catalogsources.operators.coreos.com
88
spec:
@@ -145,7 +145,7 @@ spec:
145145
description: Represents the state of a CatalogSource. Note that Message and Reason represent the original status information, which may be migrated to be conditions based in the future. Any new features introduced will use conditions.
146146
type: array
147147
items:
148-
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
148+
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
149149
type: object
150150
required:
151151
- lastTransitionTime

0 commit comments

Comments
 (0)