Skip to content

Commit 5ca8ab1

Browse files
committed
chore: kube-apiserver authorization config file support
Kube Apiserver authorization config file support. Also rekres and bump deps. Signed-off-by: Noel Georgi <[email protected]>
1 parent 0f62a7e commit 5ca8ab1

File tree

10 files changed

+138
-74
lines changed

10 files changed

+138
-74
lines changed

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-07-08T16:37:28Z by kres 8c8b007.
3+
# Generated on 2024-11-25T17:17:21Z by kres 232fe63.
44

55
name: default
66
concurrency:
@@ -77,7 +77,7 @@ jobs:
7777
run: |
7878
make unit-tests-race
7979
- name: coverage
80-
uses: codecov/codecov-action@v4
80+
uses: codecov/codecov-action@v5
8181
with:
8282
files: _out/coverage-unit-tests.txt
8383
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/slack-notify.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-02-15T12:59:24Z by kres latest.
3+
# Generated on 2024-11-25T17:17:21Z by kres 232fe63.
44

55
name: slack-notify
66
"on":
@@ -24,11 +24,12 @@ jobs:
2424
run: |
2525
echo pull_request_number=$(gh pr view -R ${{ github.repository }} ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} --json number --jq .number) >> $GITHUB_OUTPUT
2626
- name: Slack Notify
27-
uses: slackapi/slack-github-action@v1
27+
uses: slackapi/slack-github-action@v2
2828
with:
29-
channel-id: proj-talos-maintainers
29+
method: chat.postMessage
3030
payload: |
3131
{
32+
"channel": "proj-talos-maintainers",
3233
"attachments": [
3334
{
3435
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}",
@@ -88,5 +89,4 @@ jobs:
8889
}
8990
]
9091
}
91-
env:
92-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
92+
token: ${{ secrets.SLACK_BOT_TOKEN }}

.golangci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-07-08T16:37:28Z by kres 8c8b007.
3+
# Generated on 2024-11-25T17:17:21Z by kres 232fe63.
44

55
# options for analysis running
66
run:
@@ -116,7 +116,6 @@ linters:
116116
- gochecknoglobals
117117
- gochecknoinits
118118
- godox
119-
- gomnd
120119
- gomoddirectives
121120
- gosec
122121
- inamedparam

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# syntax = docker/dockerfile-upstream:1.10.0-labs
1+
# syntax = docker/dockerfile-upstream:1.11.1-labs
22

33
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
44
#
5-
# Generated on 2024-10-30T14:25:32Z by kres 6d3cad4.
5+
# Generated on 2024-11-25T17:17:21Z by kres 232fe63.
66

77
ARG TOOLCHAIN
88

99
# cleaned up specs and compiled versions
1010
FROM scratch AS generate
1111

1212
# runs markdownlint
13-
FROM docker.io/oven/bun:1.1.32-alpine AS lint-markdown
13+
FROM docker.io/oven/bun:1.1.36-alpine AS lint-markdown
1414
WORKDIR /src
15-
RUN bun i markdownlint-cli@0.42.0 [email protected]
15+
RUN bun i markdownlint-cli@0.43.0 [email protected]
1616
COPY .markdownlint.json .
1717
COPY ./README.md ./README.md
1818
RUN bunx markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ignore '**/hack/chglog/**' --rules node_modules/sentences-per-line/index.js .

Makefile

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-10-30T14:25:32Z by kres 6d3cad4.
3+
# Generated on 2024-11-25T17:17:21Z by kres 232fe63.
44

55
# common variables
66

@@ -17,15 +17,15 @@ WITH_RACE ?= false
1717
REGISTRY ?= ghcr.io
1818
USERNAME ?= siderolabs
1919
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
20-
PROTOBUF_GO_VERSION ?= 1.35.1
20+
PROTOBUF_GO_VERSION ?= 1.35.2
2121
GRPC_GO_VERSION ?= 1.5.1
22-
GRPC_GATEWAY_VERSION ?= 2.22.0
22+
GRPC_GATEWAY_VERSION ?= 2.24.0
2323
VTPROTOBUF_VERSION ?= 0.6.0
24-
GOIMPORTS_VERSION ?= 0.26.0
24+
GOIMPORTS_VERSION ?= 0.27.0
2525
DEEPCOPY_VERSION ?= v0.5.6
26-
GOLANGCILINT_VERSION ?= v1.61.0
26+
GOLANGCILINT_VERSION ?= v1.62.0
2727
GOFUMPT_VERSION ?= v0.7.0
28-
GO_VERSION ?= 1.23.2
28+
GO_VERSION ?= 1.23.3
2929
GO_BUILDFLAGS ?=
3030
GO_LDFLAGS ?=
3131
CGO_ENABLED ?= 0
@@ -41,11 +41,13 @@ PLATFORM ?= linux/amd64
4141
PROGRESS ?= auto
4242
PUSH ?= false
4343
CI_ARGS ?=
44+
BUILDKIT_MULTI_PLATFORM ?= 1
4445
COMMON_ARGS = --file=Dockerfile
4546
COMMON_ARGS += --provenance=false
4647
COMMON_ARGS += --progress=$(PROGRESS)
4748
COMMON_ARGS += --platform=$(PLATFORM)
4849
COMMON_ARGS += --push=$(PUSH)
50+
COMMON_ARGS += --build-arg=BUILDKIT_MULTI_PLATFORM=$(BUILDKIT_MULTI_PLATFORM)
4951
COMMON_ARGS += --build-arg=ARTIFACTS="$(ARTIFACTS)"
5052
COMMON_ARGS += --build-arg=SHA="$(SHA)"
5153
COMMON_ARGS += --build-arg=TAG="$(TAG)"
@@ -145,6 +147,15 @@ target-%: ## Builds the specified target defined in the Dockerfile. The build r
145147

146148
local-%: ## Builds the specified target defined in the Dockerfile using the local output type. The build result will be output to the specified local destination.
147149
@$(MAKE) target-$* TARGET_ARGS="--output=type=local,dest=$(DEST) $(TARGET_ARGS)"
150+
@PLATFORM=$(PLATFORM) DEST=$(DEST) bash -c '\
151+
for platform in $$(tr "," "\n" <<< "$$PLATFORM"); do \
152+
echo $$platform; \
153+
directory="$${platform//\//_}"; \
154+
if [[ -d "$$DEST/$$directory" ]]; then \
155+
mv "$$DEST/$$directory/"* $$DEST; \
156+
rmdir "$$DEST/$$directory/"; \
157+
fi; \
158+
done'
148159

149160
lint-golangci-lint: ## Runs golangci-lint linter.
150161
@$(MAKE) target-$@

go.mod

+9-8
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ go 1.23.2
44

55
require (
66
github.com/blang/semver/v4 v4.0.0
7-
github.com/cosi-project/runtime v0.6.4
7+
github.com/cosi-project/runtime v0.7.2
88
github.com/google/go-containerregistry v0.20.2
99
github.com/hexops/gotextdiff v1.0.3
10-
github.com/siderolabs/gen v0.6.1
10+
github.com/siderolabs/gen v0.7.0
1111
github.com/siderolabs/go-retry v0.3.3
12-
github.com/siderolabs/talos/pkg/machinery v1.8.2
13-
github.com/stretchr/testify v1.9.0
14-
golang.org/x/sys v0.26.0
15-
k8s.io/api v0.31.2
16-
k8s.io/apimachinery v0.31.2
17-
k8s.io/client-go v0.31.2
12+
github.com/siderolabs/talos/pkg/machinery v1.8.3
13+
github.com/stretchr/testify v1.10.0
14+
golang.org/x/sys v0.27.0
15+
k8s.io/api v0.31.3
16+
k8s.io/apimachinery v0.31.3
17+
k8s.io/client-go v0.31.3
1818
sigs.k8s.io/yaml v1.4.0
1919
)
2020

@@ -23,6 +23,7 @@ require (
2323
github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f // indirect
2424
github.com/ProtonMail/gopenpgp/v2 v2.7.5 // indirect
2525
github.com/adrg/xdg v0.5.0 // indirect
26+
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
2627
github.com/cloudflare/circl v1.3.9 // indirect
2728
github.com/containerd/go-cni v1.1.10 // indirect
2829
github.com/containernetworking/cni v1.2.3 // indirect

go.sum

+18-16
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y
1414
github.com/brianvoe/gofakeit/v6 v6.24.0 h1:74yq7RRz/noddscZHRS2T84oHZisW9muwbb8sRnU52A=
1515
github.com/brianvoe/gofakeit/v6 v6.24.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8=
1616
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
17+
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
18+
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
1719
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
1820
github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE=
1921
github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
2022
github.com/containerd/go-cni v1.1.10 h1:c2U73nld7spSWfiJwSh/8W9DK+/qQwYM2rngIhCyhyg=
2123
github.com/containerd/go-cni v1.1.10/go.mod h1:/Y/sL8yqYQn1ZG1om1OncJB1W4zN3YmjfP/ShCzG/OY=
2224
github.com/containernetworking/cni v1.2.3 h1:hhOcjNVUQTnzdRJ6alC5XF+wd9mfGIUaj8FuJbEslXM=
2325
github.com/containernetworking/cni v1.2.3/go.mod h1:DuLgF+aPd3DzcTQTtp/Nvl1Kim23oFKdm2okJzBQA5M=
24-
github.com/cosi-project/runtime v0.6.4 h1:roifc5e+Q1+72EI36BYSRT9aXyskU+coiKHeoBBWkMg=
25-
github.com/cosi-project/runtime v0.6.4/go.mod h1:EMLs8a55tJ6zA4UyDbRsTvXBd6UIlNwZfCVGvCyiXK8=
26+
github.com/cosi-project/runtime v0.7.2 h1:b8/v/YpP75LNYLyP5x0+EdqPWtNn6sfJggGGzkqZ0H4=
27+
github.com/cosi-project/runtime v0.7.2/go.mod h1:EMLs8a55tJ6zA4UyDbRsTvXBd6UIlNwZfCVGvCyiXK8=
2628
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
2729
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2830
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -133,8 +135,8 @@ github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkB
133135
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
134136
github.com/siderolabs/crypto v0.5.0 h1:+Sox0aYLCcD0PAH2cbEcx557zUrONLtuj1Ws+2MFXGc=
135137
github.com/siderolabs/crypto v0.5.0/go.mod h1:hsR3tJ3aaeuhCChsLF4dBd9vlJVPvmhg4vvx2ez4aD4=
136-
github.com/siderolabs/gen v0.6.1 h1:Mex6Q41Tlw3e+4cGvlju2x4UwULD5WMo/D82n7IxV0Y=
137-
github.com/siderolabs/gen v0.6.1/go.mod h1:an3a2Y53O7kUjnnK8Bfu3gewtvnIOu5RTU6HalFtXQQ=
138+
github.com/siderolabs/gen v0.7.0 h1:uHAt3WD0dof28NHFuguWBbDokaXQraR/HyVxCLw2QCU=
139+
github.com/siderolabs/gen v0.7.0/go.mod h1:an3a2Y53O7kUjnnK8Bfu3gewtvnIOu5RTU6HalFtXQQ=
138140
github.com/siderolabs/go-api-signature v0.3.6 h1:wDIsXbpl7Oa/FXvxB6uz4VL9INA9fmr3EbmjEZYFJrU=
139141
github.com/siderolabs/go-api-signature v0.3.6/go.mod h1:hoH13AfunHflxbXfh+NoploqV13ZTDfQ1mQJWNVSW9U=
140142
github.com/siderolabs/go-blockdevice v0.4.7 h1:2bk4WpEEflGxjrNwp57ye24Pr+cYgAiAeNMWiQOuWbQ=
@@ -149,8 +151,8 @@ github.com/siderolabs/net v0.4.0 h1:1bOgVay/ijPkJz4qct98nHsiB/ysLQU0KLoBC4qLm7I=
149151
github.com/siderolabs/net v0.4.0/go.mod h1:/ibG+Hm9HU27agp5r9Q3eZicEfjquzNzQNux5uEk0kM=
150152
github.com/siderolabs/protoenc v0.2.1 h1:BqxEmeWQeMpNP3R6WrPqDatX8sM/r4t97OP8mFmg6GA=
151153
github.com/siderolabs/protoenc v0.2.1/go.mod h1:StTHxjet1g11GpNAWiATgc8K0HMKiFSEVVFOa/H0otc=
152-
github.com/siderolabs/talos/pkg/machinery v1.8.2 h1:oBNBIPjOo6SNvVaUb4B4PHGefR6HYgYVl1/GPGppj98=
153-
github.com/siderolabs/talos/pkg/machinery v1.8.2/go.mod h1:cNR2TELu2T9AzYOHAoNr/7ZS3ZVDLzM/KnuOr4XW4s4=
154+
github.com/siderolabs/talos/pkg/machinery v1.8.3 h1:raK1oLzSMpwpy/AqkeFyBYkJS+QuOnlRMznVl/rZ25k=
155+
github.com/siderolabs/talos/pkg/machinery v1.8.3/go.mod h1:cNR2TELu2T9AzYOHAoNr/7ZS3ZVDLzM/KnuOr4XW4s4=
154156
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
155157
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
156158
github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
@@ -165,8 +167,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
165167
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
166168
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
167169
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
168-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
169-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
170+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
171+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
170172
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
171173
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
172174
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
@@ -226,8 +228,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
226228
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
227229
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
228230
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
229-
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
230-
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
231+
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
232+
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
231233
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
232234
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
233235
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
@@ -278,12 +280,12 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
278280
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
279281
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
280282
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
281-
k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0=
282-
k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk=
283-
k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw=
284-
k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
285-
k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc=
286-
k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs=
283+
k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8=
284+
k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE=
285+
k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4=
286+
k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
287+
k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4=
288+
k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs=
287289
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
288290
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
289291
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=

kubernetes/compatibility/features.go

+15
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,18 @@ func (v Version) KubeSchedulerHealthStartupEndpoint() string {
6666

6767
return kubeSchedulerPre131HealthzEndpoint
6868
}
69+
70+
// KubeAPIServerSupportsAuthorizationConfigFile returns true if kube-apiserver supports authorization config file.
71+
func (v Version) KubeAPIServerSupportsAuthorizationConfigFile() bool {
72+
// https://v1-29.docs.kubernetes.io/docs/reference/access-authn-authz/authorization/#configuring-the-api-server-using-an-authorization-config-file
73+
// v1.29 and above supports authorization config file
74+
return semver.Version(v).GTE(semver.Version{Major: 1, Minor: 29})
75+
}
76+
77+
// FeatureFlagStructuredAuthorizationConfigurationEnabledByDefault returns true if structured authorization configuration is enabled by default.
78+
func (v Version) FeatureFlagStructuredAuthorizationConfigurationEnabledByDefault() bool {
79+
// https://v1-29.docs.kubernetes.io/docs/reference/access-authn-authz/authorization/#configuring-the-api-server-using-an-authorization-config-file
80+
// https://v1-30.docs.kubernetes.io/docs/reference/access-authn-authz/authorization/#using-configuration-file-for-authorization
81+
// v1.30 and above enables structured authorization configuration by default
82+
return semver.Version(v).GTE(semver.Version{Major: 1, Minor: 30})
83+
}

0 commit comments

Comments
 (0)