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

Upgrade dependencies #120

Merged
merged 6 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
go: ["1.20", "1.21"]
go: ["1.21"]
steps:
- name: Install Go
uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-alpine3.18 AS builder
FROM golang:1.21.13-alpine3.20 AS builder

ARG HAWTIO_ONLINE_VERSION=latest
ARG HAWTIO_ONLINE_IMAGE_NAME=quay.io/hawtio/online
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ NAMESPACE ?= hawtio
PROJECT = operator
DEFAULT_IMAGE := quay.io/${ORG}/${PROJECT}
IMAGE ?= $(DEFAULT_IMAGE)
VERSION ?= 1.1.1
HAWTIO_ONLINE_VERSION ?= 2.1.0
VERSION ?= 1.2.0
HAWTIO_ONLINE_VERSION ?= 2.2.0
HAWTIO_ONLINE_IMAGE_NAME ?= quay.io/${ORG}/online
HAWTIO_ONLINE_GATEWAY_IMAGE_NAME ?= quay.io/${ORG}/online-gateway
DEBUG ?= false
LAST_RELEASED_IMAGE_NAME := hawtio-operator
LAST_RELEASED_VERSION ?= 1.1.0
LAST_RELEASED_VERSION ?= 1.1.1
BUNDLE_IMAGE_NAME ?= $(IMAGE)-bundle

# Is this build part of an automated CI pipeline
Expand All @@ -25,7 +25,7 @@ VERSION := $(subst -SNAPSHOT,-$(DATETIMESTAMP),$(VERSION))
#
# Versions of tools and binaries
#
CONTROLLER_GEN_VERSION := v0.6.1
CONTROLLER_GEN_VERSION := v0.6.2
KUSTOMIZE_VERSION := v4.5.4
OPERATOR_SDK_VERSION := v1.28.0
OPM_VERSION := v1.24.0
Expand Down
8 changes: 4 additions & 4 deletions bundle/bases/hawtio-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
categories: Integration & Delivery
certified: "false"
description: Hawtio eases the discovery and management of Java applications deployed on OpenShift.
containerImage: quay.io/hawtio/operator:1.1.1
containerImage: quay.io/hawtio/operator:1.2.0
repository: https://github.com/hawtio/hawtio-operator
support: Red Hat
labels:
Expand All @@ -16,16 +16,16 @@ metadata:
operatorframework.io/arch.amd64: supported
operatorframework.io/os.linux: supported
operatorframework.io/os.zos: supported
name: hawtio-operator.v1.1.1
name: hawtio-operator.v1.2.0
spec:
displayName: Hawtio Operator
maintainers:
- email: [email protected]
name: The Hawtio team
provider:
name: Red Hat
version: 1.1.1
replaces: hawtio-operator.v1.1.0
version: 1.2.0
replaces: hawtio-operator.v1.1.1
maturity: alpha
minKubeVersion: 1.11.0
description: |
Expand Down
12 changes: 6 additions & 6 deletions bundle/manifests/hawtio-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ metadata:
capabilities: Seamless Upgrades
categories: Integration & Delivery
certified: "false"
containerImage: quay.io/hawtio/operator:1.1.1
createdAt: "2024-06-19T14:35:16Z"
containerImage: quay.io/hawtio/operator:1.2.0
createdAt: "2024-10-21T15:26:24Z"
description: Hawtio eases the discovery and management of Java applications deployed
on OpenShift.
olm.skipRange: '>=1.0.0 <1.0.2'
Expand All @@ -75,7 +75,7 @@ metadata:
operatorframework.io/arch.s390x: supported
operatorframework.io/os.linux: supported
operatorframework.io/os.zos: supported
name: hawtio-operator.v1.1.1
name: hawtio-operator.v1.2.0
spec:
apiservicedefinitions: {}
customresourcedefinitions:
Expand Down Expand Up @@ -175,7 +175,7 @@ spec:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: hawtio-operator
image: quay.io/hawtio/operator:1.1.1
image: quay.io/hawtio/operator:1.2.0
imagePullPolicy: Always
name: hawtio-operator
ports:
Expand Down Expand Up @@ -304,5 +304,5 @@ spec:
minKubeVersion: 1.11.0
provider:
name: Red Hat
replaces: hawtio-operator.v1.1.0
version: 1.1.1
replaces: hawtio-operator.v1.1.1
version: 1.2.0
15 changes: 14 additions & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
logf "sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -123,7 +124,19 @@ func operatorRun(namespace string, cfg *rest.Config) error {
}

// Create a new Cmd to provide shared dependencies and start components
mgr, err := manager.New(cfg, manager.Options{Namespace: namespace})

var namespaces map[string]cache.Config
if namespace != "" {
namespaces = map[string]cache.Config{
namespace: {},
}
}

mgr, err := manager.New(cfg, manager.Options{
Cache: cache.Options{
DefaultNamespaces: namespaces,
},
})
if err != nil {
log.Error(err, "")
return err
Expand Down
50 changes: 47 additions & 3 deletions deploy/crd/hawt.io_hawtios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: hawtios.hawt.io
spec:
Expand Down Expand Up @@ -239,6 +239,27 @@ spec:
resources:
description: The Hawtio console compute resources
properties:
claims:
description: "Claims lists the names of resources, defined in
spec.resourceClaims, that are used by this container. \n This
is an alpha field and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable. It can only be set
for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims
of the Pod where this field is used. It makes that resource
available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand All @@ -259,7 +280,8 @@ spec:
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
route:
Expand Down Expand Up @@ -568,6 +590,27 @@ spec:
resources:
description: The Hawtio console compute resources
properties:
claims:
description: "Claims lists the names of resources, defined in
spec.resourceClaims, that are used by this container. \n This
is an alpha field and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable. It can only be set
for containers."
items:
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
properties:
name:
description: Name must match the name of one entry in pod.spec.resourceClaims
of the Pod where this field is used. It makes that resource
available inside a container.
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
Expand All @@ -588,7 +631,8 @@ spec:
description: 'Requests describes the minimum amount of compute
resources required. If Requests is omitted for a container,
it defaults to Limits if that is explicitly specified, otherwise
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
to an implementation-defined value. Requests cannot exceed Limits.
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
route:
Expand Down
58 changes: 58 additions & 0 deletions go-get-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# TODO automate
GO_VERSION=1.21.13

FAIL_LOG="go-get-upgrade.fail.log"
if [ -f ${FAIL_LOG} ]; then
rm ${FAIL_LOG}
fi

while read dep
do
path=$(echo "${dep}" | jq -r .Path)
if [ -z "${path}" ]; then
echo " Error: Cannot process ${dep}"
echo
continue
fi

main=$(echo "${dep}" | jq -r .Main)
if [ "${main}" == "true" ]; then
# Do not update ourselves
echo
continue
fi

update=$(echo "${dep}" | jq -r '.Update | select( . != null )')
if [ -z "${update}" ]; then
continue
fi

deprecated=$(echo "${dep}" | jq -r '.Deprecated | select( . != null )')
if [ -n "${deprecated}" ]; then
echo "Error: ${path} is deprecated. Please upgrade manually."
echo "Deprecated ---> ${path}" >> ${FAIL_LOG}
echo
continue
fi

echo "Dependency to be updated: ${path}"
curr=$(echo "${dep}" | jq -r '.Version | select( . != null )')
new=$(echo "${dep}" | jq -r '.Update.Version | select( . != null )')

echo "Updating ${path}: ${curr} ---> ${new}"

# Stops the version of go installed from being automatically updated
export GOTOOLCHAIN=local
result=$(go get -t -u "${path}@${new}" 2>&1)
if [ "${?}" != "0" ]; then
echo "Error: ${path} failed to update. Please upgrade manually."
echo "Failed to update ---> ${path}" >> ${FAIL_LOG}
echo "${result}" >> ${FAIL_LOG}
echo >> ${FAIL_LOG}
fi

echo

done < <(cat gomod-list.json | jq -c '.[]')
Loading
Loading