Skip to content

Commit

Permalink
build(deps): bump Kubernetes to 1.30
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgb committed Apr 28, 2024
1 parent a823423 commit d5fa9d8
Show file tree
Hide file tree
Showing 14 changed files with 186 additions and 138 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
strategy:
matrix:
k8s-version:
- v1.27.10 # renovate: kindest/node
- v1.28.6 # renovate: kindest/node
- v1.29.1 # renovate: kindest/node
- v1.27.11 # renovate: kindest/node
- v1.28.7 # renovate: kindest/node
- v1.29.2 # renovate: kindest/node
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,17 @@ generate: setup generate-applyconfigurations ## Generate code containing DeepCop
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="{./api/...}"

GO_MODULE = $(shell go list -m)
API_DIRS = $(shell find api -mindepth 2 -type d | sed "s|^|$(shell go list -m)/|" | paste -sd ",")
API_DIRS = $(shell find api -mindepth 2 -type d | sed "s|^|$(shell go list -m)/|" | paste -sd " ")
AC_PKG = internal/applyconfigurations
.PHONY: generate-applyconfigurations
generate-applyconfigurations: setup ## Generate applyconfigurations to support typesafe SSA.
rm -rf $(AC_PKG)
@echo ">> generating $(AC_PKG)..."
applyconfiguration-gen \
--go-header-file hack/boilerplate.go.txt \
--input-dirs "$(API_DIRS)" \
--output-package "$(GO_MODULE)/$(AC_PKG)" \
--trim-path-prefix "$(GO_MODULE)" \
--output-base "."
--output-dir "$(AC_PKG)" \
--output-pkg "$(GO_MODULE)/$(AC_PKG)" \
$(API_DIRS)

.PHONY: apidoc
apidoc: setup $(wildcard api/*/*_types.go)
Expand Down
1 change: 0 additions & 1 deletion api/accurate/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/accurate/v2alpha1/zz_generated.deepcopy.go

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

6 changes: 3 additions & 3 deletions aqua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ registries:
type: local
path: registry.yaml
packages:
- name: kubernetes/kubectl@v1.29.1
- name: kubernetes/kubectl@v1.30.0
- name: kubernetes-sigs/kubebuilder@v3.11.0
- name: kubernetes-sigs/kustomize@kustomize/v5.1.0
- name: kubernetes-sigs/kind@v0.20.0
- name: rust-lang/mdBook@v0.4.31
- name: mikefarah/yq@v4.34.1
- name: clamoriniere/crd-to-markdown@v0.0.3
- name: kubernetes-sigs/controller-tools/controller-gen@v0.12.0
- name: kubernetes-sigs/controller-tools/controller-gen@v0.15.0
- name: helm/helm@v3.12.1
- name: bitnami-labs/sealed-secrets@v0.22.0
- name: goreleaser/goreleaser@v1.19.1
- name: kubernetes/code-generator/applyconfiguration-gen@v0.28.3
- name: kubernetes/code-generator/applyconfiguration-gen@v0.30.0
registry: local
51 changes: 41 additions & 10 deletions charts/accurate/templates/generated/crds.yaml

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

69 changes: 41 additions & 28 deletions config/crd/bases/accurate.cybozu.com_subnamespaces.yaml

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

26 changes: 14 additions & 12 deletions controllers/subnamespace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
metav1ac "k8s.io/client-go/applyconfigurations/meta/v1"
"k8s.io/client-go/util/workqueue"
"k8s.io/utils/ptr"
kstatus "sigs.k8s.io/cli-utils/pkg/kstatus/status"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -126,13 +128,13 @@ func (r *SubNamespaceReconciler) reconcileNS(ctx context.Context, sn *accuratev2
logger.Info("a conflicting namespace already exists")
ac.Status.WithConditions(
newStatusCondition(sn.Status.Conditions,
metav1.Condition{
Type: string(kstatus.ConditionStalled),
Status: metav1.ConditionTrue,
ObservedGeneration: sn.Generation,
Reason: accuratev2alpha1.SubNamespaceConflict,
Message: "Conflicting namespace already exists",
}),
metav1ac.Condition().
WithType(string(kstatus.ConditionStalled)).
WithStatus(metav1.ConditionTrue).
WithObservedGeneration(sn.Generation).
WithReason(accuratev2alpha1.SubNamespaceConflict).
WithMessage("Conflicting namespace already exists"),
),
)
}

Expand Down Expand Up @@ -174,14 +176,14 @@ func (r *SubNamespaceReconciler) SetupWithManager(mgr ctrl.Manager) error {
Complete(r)
}

func newStatusCondition(existingConditions []metav1.Condition, newCondition metav1.Condition) metav1.Condition {
existingCondition := meta.FindStatusCondition(existingConditions, newCondition.Type)
if existingCondition != nil && existingCondition.Status == newCondition.Status {
newCondition.LastTransitionTime = existingCondition.LastTransitionTime
func newStatusCondition(existingConditions []metav1.Condition, newCondition *metav1ac.ConditionApplyConfiguration) *metav1ac.ConditionApplyConfiguration {
existingCondition := meta.FindStatusCondition(existingConditions, *newCondition.Type)
if existingCondition != nil && existingCondition.Status == *newCondition.Status {
newCondition.LastTransitionTime = &existingCondition.LastTransitionTime
}

if newCondition.LastTransitionTime.IsZero() {
newCondition.LastTransitionTime = metav1.NewTime(time.Now())
newCondition.LastTransitionTime = ptr.To(metav1.NewTime(time.Now()))
}

return newCondition
Expand Down
2 changes: 1 addition & 1 deletion e2e/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KUBERNETES_VERSION = v1.29.1 # renovate: kindest/node
KUBERNETES_VERSION = v1.29.2 # renovate: kindest/node

KUBECTL_ACCURATE := $(dir $(shell pwd))/bin/kubectl-accurate
KUBECONFIG := $(shell pwd)/.kubeconfig
Expand Down
Loading

0 comments on commit d5fa9d8

Please sign in to comment.