Merge pull request #14903 from Jancis/master
Skip metallb PodSecurityPolicy object for kubernetes 1.25+pull/14951/head
commit
faed0ecefd
|
|
@ -4,7 +4,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
app: metallb
|
app: metallb
|
||||||
name: metallb-system
|
name: metallb-system
|
||||||
---
|
---{{ if .LegacyPodSecurityPolicy }}
|
||||||
apiVersion: policy/v1beta1
|
apiVersion: policy/v1beta1
|
||||||
kind: PodSecurityPolicy
|
kind: PodSecurityPolicy
|
||||||
metadata:
|
metadata:
|
||||||
|
|
@ -33,7 +33,7 @@ spec:
|
||||||
rule: RunAsAny
|
rule: RunAsAny
|
||||||
volumes:
|
volumes:
|
||||||
- '*'
|
- '*'
|
||||||
---
|
---{{ end }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
||||||
|
|
@ -856,7 +856,13 @@ func GenerateTemplateData(addon *Addon, cc *config.ClusterConfig, netInfo Networ
|
||||||
ea = "-" + runtime.GOARCH
|
ea = "-" + runtime.GOARCH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v, err := util.ParseKubernetesVersion(cfg.KubernetesVersion)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "parsing Kubernetes version")
|
||||||
|
}
|
||||||
|
|
||||||
opts := struct {
|
opts := struct {
|
||||||
|
KubernetesVersion map[string]uint64
|
||||||
PreOneTwentyKubernetes bool
|
PreOneTwentyKubernetes bool
|
||||||
Arch string
|
Arch string
|
||||||
ExoticArch string
|
ExoticArch string
|
||||||
|
|
@ -871,7 +877,9 @@ func GenerateTemplateData(addon *Addon, cc *config.ClusterConfig, netInfo Networ
|
||||||
Registries map[string]string
|
Registries map[string]string
|
||||||
CustomRegistries map[string]string
|
CustomRegistries map[string]string
|
||||||
NetworkInfo map[string]string
|
NetworkInfo map[string]string
|
||||||
|
LegacyPodSecurityPolicy bool
|
||||||
}{
|
}{
|
||||||
|
KubernetesVersion: make(map[string]uint64),
|
||||||
PreOneTwentyKubernetes: false,
|
PreOneTwentyKubernetes: false,
|
||||||
Arch: a,
|
Arch: a,
|
||||||
ExoticArch: ea,
|
ExoticArch: ea,
|
||||||
|
|
@ -886,6 +894,7 @@ func GenerateTemplateData(addon *Addon, cc *config.ClusterConfig, netInfo Networ
|
||||||
Registries: addon.Registries,
|
Registries: addon.Registries,
|
||||||
CustomRegistries: customRegistries,
|
CustomRegistries: customRegistries,
|
||||||
NetworkInfo: make(map[string]string),
|
NetworkInfo: make(map[string]string),
|
||||||
|
LegacyPodSecurityPolicy: v.LT(semver.Version{Major: 1, Minor: 25}),
|
||||||
}
|
}
|
||||||
if opts.ImageRepository != "" && !strings.HasSuffix(opts.ImageRepository, "/") {
|
if opts.ImageRepository != "" && !strings.HasSuffix(opts.ImageRepository, "/") {
|
||||||
opts.ImageRepository += "/"
|
opts.ImageRepository += "/"
|
||||||
|
|
@ -896,10 +905,6 @@ func GenerateTemplateData(addon *Addon, cc *config.ClusterConfig, netInfo Networ
|
||||||
|
|
||||||
// maintain backwards compatibility with k8s < v1.19
|
// maintain backwards compatibility with k8s < v1.19
|
||||||
// by using v1beta1 instead of v1 api version for ingress
|
// by using v1beta1 instead of v1 api version for ingress
|
||||||
v, err := util.ParseKubernetesVersion(cfg.KubernetesVersion)
|
|
||||||
if err != nil {
|
|
||||||
return errors.Wrap(err, "parsing Kubernetes version")
|
|
||||||
}
|
|
||||||
if semver.MustParseRange("<1.19.0")(v) {
|
if semver.MustParseRange("<1.19.0")(v) {
|
||||||
opts.IngressAPIVersion = "v1beta1"
|
opts.IngressAPIVersion = "v1beta1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue