diff --git a/.golangci.yml b/.golangci.yml index f784813b..9cb3be00 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -71,6 +71,9 @@ linters-settings: main: deny: - { pkg: io/ioutil, desc: https://go.dev/doc/go1.16#ioutil } + govet: + enable: + - nilness # find tautologies / impossible conditions issues: exclude: diff --git a/.prow/verify.yaml b/.prow/verify.yaml index f084bdbc..c01faf73 100644 --- a/.prow/verify.yaml +++ b/.prow/verify.yaml @@ -21,7 +21,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: quay.io/kubermatic-labs/boilerplate:v0.2.0 + - image: quay.io/kubermatic/build:go-1.22-node-18-5 command: - make args: @@ -36,7 +36,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: golang:1.22.1 + - image: quay.io/kubermatic/build:go-1.22-node-18-5 command: - make args: @@ -58,7 +58,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: quay.io/kubermatic/build:go-1.22-node-18-0 + - image: quay.io/kubermatic/build:go-1.22-node-18-5 command: - make args: @@ -79,7 +79,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: quay.io/kubermatic/build:go-1.22-node-18-kind-0.22-5 + - image: quay.io/kubermatic/build:go-1.22-node-18-5 command: - ./hack/verify-licenses.sh resources: @@ -95,7 +95,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: golangci/golangci-lint:v1.56.0 + - image: quay.io/kubermatic/build:go-1.22-node-18-5 command: - make args: @@ -115,7 +115,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: quay.io/kubermatic/build:go-1.22-node-18-kind-0.22-5 + - image: quay.io/kubermatic/build:go-1.22-node-18-5 command: - make args: @@ -130,9 +130,9 @@ presubmits: clone_uri: "ssh://git@github.com/kubermatic/operating-system-manager.git" spec: containers: - - image: docker.io/mvdan/shfmt:v3.5.1 + - image: quay.io/kubermatic/build:go-1.22-node-18-5 command: - - "/bin/shfmt" + - shfmt args: # -l list files whose formatting differs from shfmt's # -d error with a diff when the formatting differs @@ -161,7 +161,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: golang:1.22.1 + - image: quay.io/kubermatic/build:go-1.22-node-18-5 command: - make args: diff --git a/deploy/cloud-init-settings.yaml b/deploy/cloud-init-settings.yaml index 9826c2c0..b2b59680 100644 --- a/deploy/cloud-init-settings.yaml +++ b/deploy/cloud-init-settings.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# cloud-init-settings is a dedicated namespace for storing provisioing configurations for machines. That are later consumed by machine-controller +# cloud-init-settings is a dedicated namespace for storing provisioning configurations for machines. That are later consumed by machine-controller # The dedicated and restricted service-account, cloud-init-getter is then used in order to reach, authenticate and be autorized by the API server to fetch those # provisioning configurations for the machines diff --git a/deploy/crd/operatingsystemmanager.k8c.io_operatingsystemconfigs.yaml b/deploy/crd/operatingsystemmanager.k8c.io_operatingsystemconfigs.yaml index 16a17b73..8f2d8ad4 100644 --- a/deploy/crd/operatingsystemmanager.k8c.io_operatingsystemconfigs.yaml +++ b/deploy/crd/operatingsystemmanager.k8c.io_operatingsystemconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.13.0 + controller-gen.kubebuilder.io/version: v0.14.0 name: operatingsystemconfigs.operatingsystemmanager.k8c.io spec: group: operatingsystemmanager.k8c.io @@ -22,14 +22,19 @@ spec: description: OperatingSystemConfig is the object that represents the OperatingSystemConfig 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 @@ -46,9 +51,9 @@ spec: description: Files is a list of files that should exist in the instance items: - description: File is a file that should get written to the host's - file system. The content can either be inlined or referenced - from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -74,9 +79,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions - the file should get written to the file system. Should - be in decimal base and without any leading zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: @@ -225,9 +230,9 @@ spec: description: Files is a list of files that should exist in the instance items: - description: File is a file that should get written to the host's - file system. The content can either be inlined or referenced - from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -253,9 +258,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions - the file should get written to the file system. Should - be in decimal base and without any leading zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: diff --git a/deploy/crd/operatingsystemmanager.k8c.io_operatingsystemprofiles.yaml b/deploy/crd/operatingsystemmanager.k8c.io_operatingsystemprofiles.yaml index fb4641e2..2cc52c09 100644 --- a/deploy/crd/operatingsystemmanager.k8c.io_operatingsystemprofiles.yaml +++ b/deploy/crd/operatingsystemmanager.k8c.io_operatingsystemprofiles.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.13.0 + controller-gen.kubebuilder.io/version: v0.14.0 name: operatingsystemprofiles.operatingsystemmanager.k8c.io spec: group: operatingsystemmanager.k8c.io @@ -22,14 +22,19 @@ spec: description: OperatingSystemProfile is the object that represents the OperatingSystemProfile 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 @@ -46,9 +51,9 @@ spec: description: Files is a list of files that should exist in the instance items: - description: File is a file that should get written to the host's - file system. The content can either be inlined or referenced - from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -74,9 +79,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions - the file should get written to the file system. Should - be in decimal base and without any leading zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: @@ -121,9 +126,9 @@ spec: type: object type: object supportedContainerRuntimes: - description: SupportedContainerRuntimes represents the container - runtimes supported by the given OS. Docker has been deprecated - and is no-op. + description: |- + SupportedContainerRuntimes represents the container runtimes supported by the given OS. + Docker has been deprecated and is no-op. items: description: ContainerRuntimeSpec aggregates information about a specific container runtime @@ -132,9 +137,9 @@ spec: description: Files to add to the main files list when the containerRuntime is selected items: - description: File is a file that should get written to - the host's file system. The content can either be inlined - or referenced from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -160,10 +165,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions - the file should get written to the file system. - Should be in decimal base and without any leading - zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: @@ -257,9 +261,9 @@ spec: description: Files is a list of files that should exist in the instance items: - description: File is a file that should get written to the host's - file system. The content can either be inlined or referenced - from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -285,9 +289,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions - the file should get written to the file system. Should - be in decimal base and without any leading zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: @@ -332,9 +336,9 @@ spec: type: object type: object supportedContainerRuntimes: - description: SupportedContainerRuntimes represents the container - runtimes supported by the given OS. Docker has been deprecated - and is no-op. + description: |- + SupportedContainerRuntimes represents the container runtimes supported by the given OS. + Docker has been deprecated and is no-op. items: description: ContainerRuntimeSpec aggregates information about a specific container runtime @@ -343,9 +347,9 @@ spec: description: Files to add to the main files list when the containerRuntime is selected items: - description: File is a file that should get written to - the host's file system. The content can either be inlined - or referenced from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -371,10 +375,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions - the file should get written to the file system. - Should be in decimal base and without any leading - zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: diff --git a/go.mod b/go.mod index 81a5c631..50e8ba0c 100644 --- a/go.mod +++ b/go.mod @@ -9,21 +9,21 @@ require ( github.com/flatcar/container-linux-config-transpiler v0.9.4 github.com/go-logr/zapr v1.3.0 github.com/go-test/deep v1.1.0 - github.com/kubermatic/machine-controller v1.58.1 - github.com/onsi/ginkgo/v2 v2.15.0 + github.com/kubermatic/machine-controller v1.59.0 + github.com/onsi/ginkgo/v2 v2.16.0 github.com/pmezard/go-difflib v1.0.0 github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 gopkg.in/yaml.v3 v3.0.1 k8c.io/reconciler v0.5.0 - k8s.io/api v0.29.1 - k8s.io/apimachinery v0.29.1 - k8s.io/client-go v0.29.1 - k8s.io/code-generator v0.29.1 + k8s.io/api v0.29.3 + k8s.io/apimachinery v0.29.3 + k8s.io/client-go v0.29.3 + k8s.io/code-generator v0.29.3 k8s.io/klog/v2 v2.120.1 - k8s.io/utils v0.0.0-20240102154912-e7106e64919e - sigs.k8s.io/controller-runtime v0.16.3 - sigs.k8s.io/controller-tools v0.13.0 + k8s.io/utils v0.0.0-20240310230437-4693a0247e57 + sigs.k8s.io/controller-runtime v0.17.2 + sigs.k8s.io/controller-tools v0.14.0 sigs.k8s.io/yaml v1.4.0 ) @@ -38,9 +38,9 @@ require ( github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.2 // indirect - github.com/evanphx/json-patch v5.6.0+incompatible // indirect + github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect - github.com/fatih/color v1.15.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/flatcar/ignition v0.36.2 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect @@ -51,7 +51,7 @@ require ( github.com/gobuffalo/flect v1.0.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.1-0.20210504230335-f78f29fc09ea // indirect @@ -64,7 +64,7 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect diff --git a/go.sum b/go.sum index 0fa457a3..09eadc64 100644 --- a/go.sum +++ b/go.sum @@ -58,12 +58,12 @@ github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+ github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= +github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/flatcar/container-linux-config-transpiler v0.9.4 h1:yXQ0NB8PeNrKJPrZvbv5/DV63PNhTqt8vaf8YxmX/RA= github.com/flatcar/container-linux-config-transpiler v0.9.4/go.mod h1:LxanhPvXkWgHG9PrkT4rX/p7YhUPdDGGsUdkNpV3L5U= github.com/flatcar/ignition v0.36.2 h1:xGHgScUe0P4Fkprjqv7L2CE58emiQgP833OCCn9z2v4= @@ -113,8 +113,8 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -173,15 +173,15 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubermatic/machine-controller v1.58.1 h1:vOUcA6DaY71iNdO5L5ltuGddeIlzj8JehLgfqavZ/7U= -github.com/kubermatic/machine-controller v1.58.1/go.mod h1:7a/9ZIi5a92UfR5GyOGjfIeB0HvY6z5GHBWuVLpTXVs= +github.com/kubermatic/machine-controller v1.59.0 h1:hE2DG4i1Hpig+lqyFKffffJE7+exHlfBHrs41J/mRe0= +github.com/kubermatic/machine-controller v1.59.0/go.mod h1:HYulildntbPjGd+iCngysmUdOXC3vAxmcoyJV2oZiaw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -199,8 +199,8 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= +github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= @@ -219,8 +219,8 @@ github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1B github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI= @@ -265,12 +265,12 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= go4.org v0.0.0-20160314031811-03efcb870d84/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= go4.org v0.0.0-20201209231011-d4a079459e60/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc= @@ -377,6 +377,7 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -506,16 +507,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8c.io/reconciler v0.5.0 h1:BHpelg1UfI/7oBFctqOq8sX6qzflXpl3SlvHe7e8wak= k8c.io/reconciler v0.5.0/go.mod h1:pT1+SVcVXJQeBJhpJBXQ5XW64QnKKeYTnVlQf0dGE0k= -k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw= -k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ= +k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= +k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= k8s.io/apiextensions-apiserver v0.29.1 h1:S9xOtyk9M3Sk1tIpQMu9wXHm5O2MX6Y1kIpPMimZBZw= k8s.io/apiextensions-apiserver v0.29.1/go.mod h1:zZECpujY5yTW58co8V2EQR4BD6A9pktVgHhvc0uLfeU= -k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc= -k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= -k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A= -k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks= -k8s.io/code-generator v0.29.1 h1:8ba8BdtSmAVHgAMpzThb/fuyQeTRtN7NtN7VjMcDLew= -k8s.io/code-generator v0.29.1/go.mod h1:FwFi3C9jCrmbPjekhaCYcYG1n07CYiW1+PAPCockaos= +k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= +k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= +k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= +k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= +k8s.io/code-generator v0.29.3 h1:m7E25/t9R9NvejspO2zBdyu+/Gl0Z5m7dCRc680KS14= +k8s.io/code-generator v0.29.3/go.mod h1:x47ofBhN4gxYFcxeKA1PYXeaPreAGaDN85Y/lNUsPoM= k8s.io/component-base v0.29.1 h1:MUimqJPCRnnHsskTTjKD+IC1EHBbRCVyi37IoFBrkYw= k8s.io/component-base v0.29.1/go.mod h1:fP9GFjxYrLERq1GcWWZAE3bqbNcDKDytn2srWuHTtKc= k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= @@ -529,15 +530,15 @@ k8s.io/kube-openapi v0.0.0-20240126223410-2919ad4fcfec h1:iGTel2aR8vCZdxJDgmbeY0 k8s.io/kube-openapi v0.0.0-20240126223410-2919ad4fcfec/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw= k8s.io/kubelet v0.29.1 h1:cso8Dk8dymkj8q+EvW/aCbIYU2aOkH27gho48tYza/8= k8s.io/kubelet v0.29.1/go.mod h1:hTl/naFcCVG1Ku17fMgj/krbheBwBkf3gnFhaboMx7E= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= -sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= -sigs.k8s.io/controller-tools v0.13.0 h1:NfrvuZ4bxyolhDBt/rCZhDnx3M2hzlhgo5n3Iv2RykI= -sigs.k8s.io/controller-tools v0.13.0/go.mod h1:5vw3En2NazbejQGCeWKRrE7q4P+CW8/klfVqP8QZkgA= +sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0= +sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= +sigs.k8s.io/controller-tools v0.14.0 h1:rnNoCC5wSXlrNoBKKzL70LNJKIQKEzT6lloG6/LF73A= +sigs.k8s.io/controller-tools v0.14.0/go.mod h1:TV7uOtNNnnR72SpzhStvPkoS/U5ir0nMudrkrC4M9Sc= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/hack/kkp/operatingsystemmanager.k8c.io_customoperatingsystemprofiles.yaml b/hack/kkp/operatingsystemmanager.k8c.io_customoperatingsystemprofiles.yaml index 0c43e268..55468ae1 100644 --- a/hack/kkp/operatingsystemmanager.k8c.io_customoperatingsystemprofiles.yaml +++ b/hack/kkp/operatingsystemmanager.k8c.io_customoperatingsystemprofiles.yaml @@ -37,10 +37,19 @@ spec: description: OperatingSystemProfile is the object that represents the OperatingSystemProfile 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 @@ -53,7 +62,9 @@ spec: files: description: Files is a list of files that should exist in the instance items: - description: File is a file that should get written to the host's file system. The content can either be inlined or referenced from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -76,7 +87,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions the file should get written to the file system. Should be in decimal base and without any leading zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: @@ -114,14 +127,18 @@ spec: type: object type: object supportedContainerRuntimes: - description: SupportedContainerRuntimes represents the container runtimes supported by the given OS. Docker has been deprecated and is no-op. + description: |- + SupportedContainerRuntimes represents the container runtimes supported by the given OS. + Docker has been deprecated and is no-op. items: description: ContainerRuntimeSpec aggregates information about a specific container runtime properties: files: description: Files to add to the main files list when the containerRuntime is selected items: - description: File is a file that should get written to the host's file system. The content can either be inlined or referenced from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -144,7 +161,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions the file should get written to the file system. Should be in decimal base and without any leading zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: @@ -230,7 +249,9 @@ spec: files: description: Files is a list of files that should exist in the instance items: - description: File is a file that should get written to the host's file system. The content can either be inlined or referenced from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -253,7 +274,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions the file should get written to the file system. Should be in decimal base and without any leading zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: @@ -291,14 +314,18 @@ spec: type: object type: object supportedContainerRuntimes: - description: SupportedContainerRuntimes represents the container runtimes supported by the given OS. Docker has been deprecated and is no-op. + description: |- + SupportedContainerRuntimes represents the container runtimes supported by the given OS. + Docker has been deprecated and is no-op. items: description: ContainerRuntimeSpec aggregates information about a specific container runtime properties: files: description: Files to add to the main files list when the containerRuntime is selected items: - description: File is a file that should get written to the host's file system. The content can either be inlined or referenced from a secret in the same namespace. + description: |- + File is a file that should get written to the host's file system. The content can either be inlined or + referenced from a secret in the same namespace. properties: content: description: Content describe the file's content. @@ -321,7 +348,9 @@ spec: type: string permissions: default: 644 - description: Permissions describes with which permissions the file should get written to the file system. Should be in decimal base and without any leading zeroes. + description: |- + Permissions describes with which permissions the file should get written to the file system. + Should be in decimal base and without any leading zeroes. format: int32 type: integer required: diff --git a/hack/lib.sh b/hack/lib.sh index d7c10862..647d51fd 100755 --- a/hack/lib.sh +++ b/hack/lib.sh @@ -123,12 +123,13 @@ containerize() { mkdir -p "$gomodcache" exec docker run \ - -v "$PWD":/go/src/k8c.io/kubermatic \ + -v "$PWD":/go/src/k8c.io/operating-system-manager \ -v "$gocache":"$gocache" \ -v "$gomodcache":"$gomodcache" \ - -w /go/src/k8c.io/kubermatic \ + -w /go/src/k8c.io/operating-system-manager \ -e "GOCACHE=$gocache" \ -e "GOMODCACHE=$gomodcache" \ + -e "CONTAINERIZED=1" \ -u "$(id -u):$(id -g)" \ --entrypoint="$cmd" \ --rm \ diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index a06b0bca..fecfece5 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -19,7 +19,7 @@ set -euo pipefail cd $(dirname $0)/.. source hack/lib.sh -CONTAINERIZE_IMAGE=golang:1.22.1 containerize ./hack/update-codegen.sh +CONTAINERIZE_IMAGE=quay.io/kubermatic/build:go-1.22-node-18-5 containerize ./hack/update-codegen.sh SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") sed="sed" diff --git a/hack/update-crds-openapi.sh b/hack/update-crds-openapi.sh index 358f164c..ae7639a2 100755 --- a/hack/update-crds-openapi.sh +++ b/hack/update-crds-openapi.sh @@ -19,7 +19,7 @@ set -euo pipefail cd $(dirname $0)/.. source hack/lib.sh -CONTAINERIZE_IMAGE=golang:1.22.1 containerize ./hack/update-crds-openapi.sh +CONTAINERIZE_IMAGE=quay.io/kubermatic/build:go-1.22-node-18-5 containerize ./hack/update-crds-openapi.sh SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") echodate "Creating vendor directory" diff --git a/hack/verify-licenses.sh b/hack/verify-licenses.sh index 7d8091aa..73d43bdd 100755 --- a/hack/verify-licenses.sh +++ b/hack/verify-licenses.sh @@ -19,7 +19,7 @@ set -euo pipefail cd $(dirname $0)/.. source hack/lib.sh -CONTAINERIZE_IMAGE=quay.io/kubermatic/build:go-1.22-node-18-kind-0.22-5 containerize ./hack/verify-licenses.sh +CONTAINERIZE_IMAGE=quay.io/kubermatic/build:go-1.22-node-18-5 containerize ./hack/verify-licenses.sh go mod vendor diff --git a/pkg/bootstrap/kubeconfig.go b/pkg/bootstrap/kubeconfig.go index bdb5276c..dbfbd97a 100644 --- a/pkg/bootstrap/kubeconfig.go +++ b/pkg/bootstrap/kubeconfig.go @@ -219,7 +219,7 @@ func (b *Bootstrap) createBootstrapToken(ctx context.Context, name string) (stri if existingSecret != nil { token, err := b.updateSecretExpirationAndGetToken(ctx, existingSecret) if err != nil { - return "", false, fmt.Errorf("failed to updte bootstrap token: %w", err) + return "", false, fmt.Errorf("failed to update bootstrap token: %w", err) } return token, true, nil diff --git a/pkg/bootstrap/kubeconfig_test.go b/pkg/bootstrap/kubeconfig_test.go index 0ce68f61..c35fcbc4 100644 --- a/pkg/bootstrap/kubeconfig_test.go +++ b/pkg/bootstrap/kubeconfig_test.go @@ -31,20 +31,20 @@ import ( func TestUpdateSecretExpirationAndGetToken(t *testing.T) { tests := []struct { - initialExperirationTime time.Time - shouldRenew bool + initialExpirationTime time.Time + shouldRenew bool }{ { - initialExperirationTime: time.Now().Add(1 * time.Hour), - shouldRenew: false, + initialExpirationTime: time.Now().Add(1 * time.Hour), + shouldRenew: false, }, { - initialExperirationTime: time.Now().Add(25 * time.Minute), - shouldRenew: true, + initialExpirationTime: time.Now().Add(25 * time.Minute), + shouldRenew: true, }, { - initialExperirationTime: time.Now().Add(-25 * time.Minute), - shouldRenew: true, + initialExpirationTime: time.Now().Add(-25 * time.Minute), + shouldRenew: true, }, } @@ -58,7 +58,7 @@ func TestUpdateSecretExpirationAndGetToken(t *testing.T) { data := map[string][]byte{} data[tokenSecretKey] = []byte("tokenSecret") data[tokenIDKey] = []byte("tokenID") - data[expirationKey] = []byte(testCase.initialExperirationTime.Format(time.RFC3339)) + data[expirationKey] = []byte(testCase.initialExpirationTime.Format(time.RFC3339)) secret.Data = data b.client = ctrlruntimefake. NewClientBuilder(). @@ -79,12 +79,12 @@ func TestUpdateSecretExpirationAndGetToken(t *testing.T) { } if testCase.shouldRenew && - bytes.Equal(updatedSecret.Data[expirationKey], []byte(testCase.initialExperirationTime.Format(time.RFC3339))) { + bytes.Equal(updatedSecret.Data[expirationKey], []byte(testCase.initialExpirationTime.Format(time.RFC3339))) { t.Errorf("Error, token secret did not update but was expected to!") } if !testCase.shouldRenew && - !bytes.Equal(updatedSecret.Data[expirationKey], []byte(testCase.initialExperirationTime.Format(time.RFC3339))) { + !bytes.Equal(updatedSecret.Data[expirationKey], []byte(testCase.initialExpirationTime.Format(time.RFC3339))) { t.Errorf("Error, token secret was expected to get updated, but did not happen!") } diff --git a/pkg/controllers/osc/osc_reconciler_test.go b/pkg/controllers/osc/osc_reconciler_test.go index e26374fd..e4470999 100644 --- a/pkg/controllers/osc/osc_reconciler_test.go +++ b/pkg/controllers/osc/osc_reconciler_test.go @@ -360,6 +360,11 @@ func TestReconciler_Reconcile(t *testing.T) { t.Fatalf("failed to get osc: %v", err) } + osc.TypeMeta = metav1.TypeMeta{ + Kind: "OperatingSystemConfig", + APIVersion: osmv1alpha1.SchemeGroupVersion.String(), + } + buff, err := yaml.Marshal(osc) if err != nil { t.Fatalf(err.Error()) @@ -380,6 +385,11 @@ func TestReconciler_Reconcile(t *testing.T) { t.Fatalf("failed loading bootstrap secret %s from testdata: %v", testCase.bootstrapSecretFile, err) } + secret.TypeMeta = metav1.TypeMeta{ + Kind: "Secret", + APIVersion: "v1", + } + buff, err = yaml.Marshal(secret) if err != nil { t.Fatalf(err.Error()) @@ -395,7 +405,11 @@ func TestReconciler_Reconcile(t *testing.T) { t.Fatalf("failed to get provisioning secret: %v", err) } - testSecret = &corev1.Secret{} + secret.TypeMeta = metav1.TypeMeta{ + Kind: "Secret", + APIVersion: "v1", + } + if err := loadFile(testSecret, testCase.provisioningSecretFile); err != nil { t.Fatalf("failed loading secret %s from testdata: %v", testCase.provisioningSecretFile, err) } diff --git a/pkg/controllers/osc/resources/operating_system_config.go b/pkg/controllers/osc/resources/operating_system_config.go index 39da9c59..705bac50 100644 --- a/pkg/controllers/osc/resources/operating_system_config.go +++ b/pkg/controllers/osc/resources/operating_system_config.go @@ -500,10 +500,10 @@ func getKubeletConfigs(annotations map[string]string) (kubeletConfig, error) { return cfg, nil } -func getKeyValueMap(value string, kvDelimeter string) *map[string]string { +func getKeyValueMap(value string, kvDelimiter string) *map[string]string { res := make(map[string]string) for _, pair := range strings.Split(value, ",") { - kvPair := strings.SplitN(pair, kvDelimeter, 2) + kvPair := strings.SplitN(pair, kvDelimiter, 2) if len(kvPair) != 2 { continue }