Skip to content

Commit

Permalink
deps: Bump go to 1.22.4 (#1246)
Browse files Browse the repository at this point in the history
* deps: Bump go to 1.22.4

Signed-off-by: Enrique Llorente <[email protected]>

* deps: Bump controller-gen v0.15.0

Signed-off-by: Enrique Llorente <[email protected]>

---------

Signed-off-by: Enrique Llorente <[email protected]>
  • Loading branch information
qinqon authored Jun 10, 2024
1 parent df565dd commit e91f57a
Show file tree
Hide file tree
Showing 17 changed files with 1,862 additions and 1,991 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ KUBECTL ?= ./cluster/kubectl.sh
OPERATOR_SDK_VERSION ?= 1.21.0

GINKGO = GOFLAGS=-mod=mod go run github.com/onsi/ginkgo/v2/[email protected]
CONTROLLER_GEN = GOFLAGS=-mod=mod go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0
CONTROLLER_GEN = GOFLAGS=-mod=mod go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0
OPM = hack/opm.sh

LOCAL_REGISTRY ?= registry:5000
Expand Down Expand Up @@ -150,7 +150,7 @@ gen-crds:
cd api && $(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=../deploy/crds

gen-rbac:
$(CONTROLLER_GEN) crd rbac:roleName=nmstate-operator paths="./controllers/operator/nmstate_controller.go" output:rbac:artifacts:config=deploy/operator
$(CONTROLLER_GEN) crd rbac:roleName=nmstate-operator paths="./controllers/operator/..." output:rbac:artifacts:config=deploy/operator

check-gen: check-manifests check-bundle

Expand Down
1 change: 0 additions & 1 deletion api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
FROM registry.access.redhat.com/ubi9/ubi AS build
ARG GO_VERSION=1.18
FROM registry.access.redhat.com/ubi9/go-toolset:${GO_VERSION} AS build

COPY . .

RUN ./build/install-go.sh ${GO_VERSION}
ENV PATH=/usr/local/go/bin/:$PATH

RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=false go build -o manager ./cmd/handler

FROM quay.io/centos/centos:stream9

ARG NMSTATE_SOURCE=distro

COPY --from=build /opt/app-root/src/manager /usr/local/bin/manager
COPY --from=build /opt/app-root/src/build/install-nmstate.${NMSTATE_SOURCE}.sh install-nmstate.sh
COPY --from=build /manager /usr/local/bin/manager
COPY --from=build /build/install-nmstate.${NMSTATE_SOURCE}.sh install-nmstate.sh

RUN ./install-nmstate.sh && \
dnf install -b -y iproute iputils && \
Expand Down
8 changes: 6 additions & 2 deletions build/Dockerfile.operator
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM registry.access.redhat.com/ubi9/ubi AS build
ARG GO_VERSION=1.18
FROM registry.access.redhat.com/ubi9/go-toolset:${GO_VERSION} AS build

COPY . .

RUN ./build/install-go.sh ${GO_VERSION}
ENV PATH=/usr/local/go/bin/:$PATH


RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=false go build -o manager ./cmd/operator

FROM registry.access.redhat.com/ubi9/ubi-minimal

COPY --from=build /opt/app-root/src/manager /usr/local/bin/manager
COPY --from=build /manager /usr/local/bin/manager

COPY deploy/crds/nmstate.io_nodenetwork*.yaml /bindata/kubernetes-nmstate/crds/
COPY deploy/handler/namespace.yaml /bindata/kubernetes-nmstate/namespace/
Expand Down
19 changes: 19 additions & 0 deletions build/install-go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash -xe

version=$1
arch=""
os=linux

case $(uname -m) in
x86_64) arch="amd64";;
aarch64) arch="arm64" ;;
esac

if [ "$arch" == "" ]; then
echo "Unknown architecture $(uname -m)"
exit 1
fi

tarball_url="https://go.dev/dl/go${version}.${os}-${arch}.tar.gz"

curl --retry 10 -L $tarball_url | tar -C /usr/local -zxf -
1,682 changes: 785 additions & 897 deletions bundle/manifests/nmstate.io_nmstates.yaml

Large diffs are not rendered by default.

52 changes: 33 additions & 19 deletions bundle/manifests/nmstate.io_nodenetworkconfigurationenactments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.15.0
creationTimestamp: null
name: nodenetworkconfigurationenactments.nmstate.io
spec:
Expand Down Expand Up @@ -33,14 +33,19 @@ spec:
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -89,7 +94,8 @@ spec:
type: object
type: array
desiredState:
description: The desired state rendered for the enactment's node using
description: |-
The desired state rendered for the enactment's node using
the policy desiredState as template
type: object
x-kubernetes-preserve-unknown-fields: true
Expand All @@ -106,7 +112,8 @@ spec:
type: string
type: array
policyGeneration:
description: The generation from policy needed to check if an enactment
description: |-
The generation from policy needed to check if an enactment
condition status belongs to the same policy version
format: int64
type: integer
Expand Down Expand Up @@ -136,14 +143,19 @@ spec:
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -192,7 +204,8 @@ spec:
type: object
type: array
desiredState:
description: The desired state rendered for the enactment's node using
description: |-
The desired state rendered for the enactment's node using
the policy desiredState as template
type: object
x-kubernetes-preserve-unknown-fields: true
Expand All @@ -209,7 +222,8 @@ spec:
type: string
type: array
policyGeneration:
description: The generation from policy needed to check if an enactment
description: |-
The generation from policy needed to check if an enactment
condition status belongs to the same policy version
format: int64
type: integer
Expand All @@ -224,5 +238,5 @@ status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
conditions: null
storedVersions: null
Loading

0 comments on commit e91f57a

Please sign in to comment.