Skip to content

Commit

Permalink
feat: update base Talos to 1.1.1
Browse files Browse the repository at this point in the history
This fixes a problem with loading config which contains new 1.1.x
fields.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
(cherry picked from commit 08cac99)
  • Loading branch information
smira committed Jul 22, 2022
1 parent fd6497f commit 0008b0d
Show file tree
Hide file tree
Showing 25 changed files with 280 additions and 1,388 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ linters:
- tagliatelle
- varnamelen
- gomoddirectives
- exhaustruct
- nosnakecase
- nonamedreturns
# abandoned linters for which golangci shows the warning that the repo is archived by the owner
- interfacer
- maligned
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ ARG CGO_ENABLED
ENV CGO_ENABLED ${CGO_ENABLED}
ENV GOCACHE /.cache/go-build
ENV GOMODCACHE /.cache/mod
RUN --mount=type=cache,target=/.cache go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0
RUN --mount=type=cache,target=/.cache go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.2
RUN --mount=type=cache,target=/.cache go install k8s.io/code-generator/cmd/conversion-gen@v0.23.1
RUN --mount=type=cache,target=/.cache go install mvdan.cc/gofumpt/gofumports@v0.1.1
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.43.0/install.sh | bash -s -- -b /toolchain/bin v1.43.0
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.47.2/install.sh | bash -s -- -b /toolchain/bin v1.47.2
WORKDIR /src
COPY ./go.mod ./
COPY ./go.sum ./
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ MODULE := $(shell head -1 go.mod | cut -d' ' -f2)

ARTIFACTS := _out
TEST_PKGS ?= ./...
TALOS_RELEASE ?= v1.0.4
TALOS_RELEASE ?= v1.1.1
PREVIOUS_TALOS_RELEASE ?= v0.13.4
DEFAULT_K8S_VERSION ?= v1.22.3
DEFAULT_K8S_VERSION ?= v1.24.2

TOOLS ?= ghcr.io/siderolabs/tools:v1.0.0-1-g4c77d96
TOOLS ?= ghcr.io/siderolabs/tools:v1.1.0-2-g9edfc1f
PKGS ?= v1.1.0-alpha.0-17-g4dace49

SFYRA_CLUSTERCTL_CONFIG ?= $(HOME)/.cluster-api/clusterctl.sfyra.yaml
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@ This provider's versions are compatible with the following versions of Cluster A

This provider's versions are able to install and manage the following versions of Kubernetes:

| | v1.16 | v 1.17 | v1.18 | v1.19 | v1.20 | v1.21 | v1.22 |
| ---------------------------- | ----- | ------ | ----- | ----- | ----- | ----- | ----- |
| Sidero Provider v1alpha3 (v0.3) ||||||| |
| Sidero Provider v1alpha3 (v0.4) | | | |||||
| | v1.16 | v 1.17 | v1.18 | v1.19 | v1.20 | v1.21 | v1.22 | v1.23 | v1.24 |
| ---------------------- | ----- | ------ | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| Sidero Provider (v0.3) ||||||| | | |
| Sidero Provider (v0.4) | | | |||||| |
| Sidero Provider (v0.5) | | | |||||||

This provider's versions are compatible with the following versions of Talos:

| | v0.11 | v0.12 | v0.13 | v0.14 | v1.0 |
| ---------------------- | ----- | ------ | ----- | ----- | ----- |
| Sidero Provider (v0.3) ||| | | |
| Sidero Provider (v0.4) ||||| |
| Sidero Provider (v0.5) | | ✓ (+) | ✓ (+) |||
| | v0.11 | v0.12 | v0.13 | v0.14 | v1.0 | v1.1 |
| ---------------------- | ----- | ------ | ----- | ----- | ----- | ----- |
| Sidero Provider (v0.3) ||| | | | |
| Sidero Provider (v0.4) ||||| | |
| Sidero Provider (v0.5) | | ✓ (+) | ✓ (+) ||||

> (+): Some Sidero 0.5 features (SideroLink) are only available with Talos v0.14+.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: metalclusters.infrastructure.cluster.x-k8s.io
spec:
Expand Down Expand Up @@ -147,9 +147,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: metalmachines.infrastructure.cluster.x-k8s.io
spec:
Expand Down Expand Up @@ -99,6 +99,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
type: object
status:
description: MetalMachineStatus defines the observed state of MetalMachine.
Expand Down Expand Up @@ -249,6 +250,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
serverRef:
description: 'ObjectReference contains enough information to let you
inspect or modify the referred object. --- New uses of this type
Expand Down Expand Up @@ -307,6 +309,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
type: object
status:
description: MetalMachineStatus defines the observed state of MetalMachine.
Expand Down Expand Up @@ -412,9 +415,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: metalmachinetemplates.infrastructure.cluster.x-k8s.io
spec:
Expand Down Expand Up @@ -110,6 +110,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
type: object
required:
- spec
Expand Down Expand Up @@ -217,6 +218,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
serverRef:
description: 'ObjectReference contains enough information
to let you inspect or modify the referred object. --- New
Expand Down Expand Up @@ -279,6 +281,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
type: object
required:
- spec
Expand All @@ -293,9 +296,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: serverbindings.infrastructure.cluster.x-k8s.io
spec:
Expand Down Expand Up @@ -133,6 +133,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
serverClassRef:
description: 'ObjectReference contains enough information to let you
inspect or modify the referred object. --- New uses of this type
Expand Down Expand Up @@ -191,6 +192,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
siderolink:
description: SideroLink describes state of the SideroLink tunnel.
properties:
Expand Down Expand Up @@ -265,9 +267,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: environments.metal.sidero.dev
spec:
Expand Down Expand Up @@ -96,9 +96,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: serverclasses.metal.sidero.dev
spec:
Expand Down Expand Up @@ -106,6 +106,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
qualifiers:
description: "Qualifiers to match on the server spec. \n If qualifiers
are empty, they match all servers. Server should match both qualifiers
Expand Down Expand Up @@ -192,6 +193,7 @@ spec:
are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
type: object
status:
description: ServerClassStatus defines the observed state of ServerClass.
Expand All @@ -213,9 +215,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: servers.metal.sidero.dev
spec:
Expand Down Expand Up @@ -227,6 +227,7 @@ spec:
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
type: string
type: object
x-kubernetes-map-type: atomic
hostname:
type: string
managementApi:
Expand Down Expand Up @@ -342,9 +343,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type ServerReconciler struct {
// +kubebuilder:rbac:groups="",resources=events,verbs=create;patch
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;patch;delete

//nolint:maintidx
func (r *ServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := r.Log.WithValues("server", req.NamespacedName)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
jsonpatch "github.com/evanphx/json-patch"
"github.com/ghodss/yaml"
"github.com/talos-systems/talos/pkg/machinery/config/configloader"
"github.com/talos-systems/talos/pkg/machinery/config/types/v1alpha1"
talosv1alpha1 "github.com/talos-systems/talos/pkg/machinery/config/types/v1alpha1" //nolint:typecheck
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -284,7 +284,7 @@ func labelNodes(decodedData []byte, serverName string) ([]byte, errorWithCode) {

switch configProvider.Version() {
case "v1alpha1":
config, ok := configProvider.Raw().(*v1alpha1.Config)
config, ok := configProvider.Raw().(*talosv1alpha1.Config)
if !ok {
return nil, errorWithCode{http.StatusInternalServerError, fmt.Errorf("unable to case config")}
}
Expand Down
6 changes: 3 additions & 3 deletions app/sidero-controller-manager/internal/siderolink/annotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func (a *Annotator) Run(ctx context.Context) error {
informer := informerFactory.Informer()

informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(new interface{}) { a.notify(nil, new) }, //nolint:contextcheck
AddFunc: func(new interface{}) { a.notify(nil, new) },
UpdateFunc: a.notify,
DeleteFunc: func(old interface{}) { a.notify(old, nil) }, //nolint:contextcheck
DeleteFunc: func(old interface{}) { a.notify(old, nil) },
})

informer.Run(ctx.Done())
Expand Down Expand Up @@ -145,7 +145,7 @@ func (a *Annotator) notify(old, new interface{}) {
delete(a.nodes, oldServerBinding.Spec.SideroLink.NodeAddress)
}

annotation, err := a.buildAnnotation(newServerBinding) //nolint:contextcheck
annotation, err := a.buildAnnotation(newServerBinding)
if err != nil {
a.logger.Error("failure building annotation", zap.Error(err))
}
Expand Down
1 change: 1 addition & 0 deletions app/sidero-controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func init() {
// +kubebuilder:scaffold:scheme
}

//nolint:maintidx
func main() {
var (
metricsAddr string
Expand Down
2 changes: 2 additions & 0 deletions config/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ apiVersion: v1
kind: Namespace
metadata:
name: sidero-system
labels:
pod-security.kubernetes.io/enforce: privileged

0 comments on commit 0008b0d

Please sign in to comment.