mirror of https://github.com/helm/helm
Merge 8872b1d5cf into 8a9993eff0
commit
434c14c9b2
@ -0,0 +1,98 @@
|
||||
//go:build ignore
|
||||
|
||||
/*
|
||||
Copyright The Helm Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This program regenerates zz_generated_known_versions.go, the built-in
|
||||
// Kubernetes API group/versions that seed the default capability version set.
|
||||
//
|
||||
// It enumerates client-go's runtime scheme plus the apiextensions groups —
|
||||
// exactly as pkg/chart/common used to do at runtime — and writes the result as
|
||||
// a static slice. Doing this at generate time keeps client-go, k8s.io/api and
|
||||
// apiextensions-apiserver out of the runtime dependency graph of every binary
|
||||
// that links Helm's chart packages.
|
||||
//
|
||||
// Run via `go generate ./pkg/chart/common/...`.
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"go/format"
|
||||
"os"
|
||||
|
||||
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
)
|
||||
|
||||
const target = "zz_generated_known_versions.go"
|
||||
|
||||
func main() {
|
||||
// Register the built-in extension APIs as well so CRDs are supported in the
|
||||
// default version set. This has caused problems with `helm template` in the
|
||||
// past, so let's be safe.
|
||||
if err := apiextensionsv1beta1.AddToScheme(scheme.Scheme); err != nil {
|
||||
fatal(err)
|
||||
}
|
||||
if err := apiextensionsv1.AddToScheme(scheme.Scheme); err != nil {
|
||||
fatal(err)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
buf.WriteString(`/*
|
||||
Copyright The Helm Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by gen_known_versions.go; DO NOT EDIT.
|
||||
|
||||
package common
|
||||
|
||||
// defaultKnownVersions is the set of built-in Kubernetes API group/versions
|
||||
// used to seed the default capability version set. Regenerate with
|
||||
// go generate ./pkg/chart/common/... after a client-go bump.
|
||||
var defaultKnownVersions = VersionSet{
|
||||
`)
|
||||
for _, gv := range scheme.Scheme.PrioritizedVersionsAllGroups() {
|
||||
fmt.Fprintf(&buf, "\t%q,\n", gv.String())
|
||||
}
|
||||
buf.WriteString("}\n")
|
||||
|
||||
out, err := format.Source(buf.Bytes())
|
||||
if err != nil {
|
||||
fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(target, out, 0o644); err != nil {
|
||||
fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func fatal(err error) {
|
||||
fmt.Fprintln(os.Stderr, "gen_known_versions:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
/*
|
||||
Copyright The Helm Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by gen_known_versions.go; DO NOT EDIT.
|
||||
|
||||
package common
|
||||
|
||||
// defaultKnownVersions is the set of built-in Kubernetes API group/versions
|
||||
// used to seed the default capability version set. Regenerate with
|
||||
// go generate ./pkg/chart/common/... after a client-go bump.
|
||||
var defaultKnownVersions = VersionSet{
|
||||
"v1",
|
||||
"admissionregistration.k8s.io/v1",
|
||||
"admissionregistration.k8s.io/v1alpha1",
|
||||
"admissionregistration.k8s.io/v1beta1",
|
||||
"internal.apiserver.k8s.io/v1alpha1",
|
||||
"apps/v1",
|
||||
"apps/v1beta1",
|
||||
"apps/v1beta2",
|
||||
"authentication.k8s.io/v1",
|
||||
"authentication.k8s.io/v1alpha1",
|
||||
"authentication.k8s.io/v1beta1",
|
||||
"authorization.k8s.io/v1",
|
||||
"authorization.k8s.io/v1beta1",
|
||||
"autoscaling/v1",
|
||||
"autoscaling/v2",
|
||||
"batch/v1",
|
||||
"batch/v1beta1",
|
||||
"certificates.k8s.io/v1",
|
||||
"certificates.k8s.io/v1beta1",
|
||||
"certificates.k8s.io/v1alpha1",
|
||||
"coordination.k8s.io/v1alpha2",
|
||||
"coordination.k8s.io/v1beta1",
|
||||
"coordination.k8s.io/v1",
|
||||
"discovery.k8s.io/v1",
|
||||
"discovery.k8s.io/v1beta1",
|
||||
"events.k8s.io/v1",
|
||||
"events.k8s.io/v1beta1",
|
||||
"extensions/v1beta1",
|
||||
"flowcontrol.apiserver.k8s.io/v1",
|
||||
"flowcontrol.apiserver.k8s.io/v1beta1",
|
||||
"flowcontrol.apiserver.k8s.io/v1beta2",
|
||||
"flowcontrol.apiserver.k8s.io/v1beta3",
|
||||
"lifecycle.k8s.io/v1alpha1",
|
||||
"networking.k8s.io/v1",
|
||||
"networking.k8s.io/v1beta1",
|
||||
"node.k8s.io/v1",
|
||||
"node.k8s.io/v1alpha1",
|
||||
"node.k8s.io/v1beta1",
|
||||
"policy/v1",
|
||||
"policy/v1beta1",
|
||||
"rbac.authorization.k8s.io/v1",
|
||||
"rbac.authorization.k8s.io/v1beta1",
|
||||
"rbac.authorization.k8s.io/v1alpha1",
|
||||
"resource.k8s.io/v1",
|
||||
"resource.k8s.io/v1beta2",
|
||||
"resource.k8s.io/v1beta1",
|
||||
"resource.k8s.io/v1alpha3",
|
||||
"scheduling.k8s.io/v1alpha3",
|
||||
"scheduling.k8s.io/v1beta1",
|
||||
"scheduling.k8s.io/v1",
|
||||
"storage.k8s.io/v1beta1",
|
||||
"storage.k8s.io/v1",
|
||||
"storage.k8s.io/v1alpha1",
|
||||
"storagemigration.k8s.io/v1",
|
||||
"storagemigration.k8s.io/v1beta1",
|
||||
"apiextensions.k8s.io/v1beta1",
|
||||
"apiextensions.k8s.io/v1",
|
||||
}
|
||||
Loading…
Reference in new issue