-
Notifications
You must be signed in to change notification settings - Fork 960
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
236 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
compatibilitymatrix() { | ||
go run hack/docs/version_compatibility.go hack/docs/compatibility-karpenter.yaml "$(git describe --exact-match --tags || echo "no tag")" | ||
go run hack/docs/compatibilitymetrix_gen_docs.go website/content/en/preview/upgrade-guide.md hack/docs/compatibility-karpenter.yaml | ||
} | ||
|
||
|
||
compatibilitymatrix | ||
go run hack/docs/metrics_gen_docs.go pkg/ $(KARPENTER_CORE_DIR)/pkg website/content/en/preview/concepts/metrics.md | ||
go run hack/docs/instancetypes_gen_docs.go website/content/en/preview/concepts/instance-types.md | ||
go run hack/docs/configuration_gen_docs.go website/content/en/preview/concepts/settings.md | ||
cd charts/karpenter && helm-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: "karpenter" | ||
compatibility: | ||
- appVersion: 0.21.x | ||
minK8sVersion: 1.21 | ||
maxK8sVersion: 1.24 | ||
- appVersion: 0.22.x | ||
minK8sVersion: 1.21 | ||
maxK8sVersion: 1.24 | ||
- appVersion: 0.23.x | ||
minK8sVersion: 1.21 | ||
maxK8sVersion: 1.24 | ||
- appVersion: 0.24.x | ||
minK8sVersion: 1.21 | ||
maxK8sVersion: 1.24 | ||
- appVersion: 0.25.x | ||
minK8sVersion: 1.21 | ||
maxK8sVersion: 1.25 | ||
- appVersion: 0.26.x | ||
minK8sVersion: 1.21 | ||
maxK8sVersion: 1.25 | ||
- appVersion: 0.27.x | ||
minK8sVersion: 1.21 | ||
maxK8sVersion: 1.25 | ||
- appVersion: 0.28.x | ||
minK8sVersion: 1.23 | ||
maxK8sVersion: 1.27 | ||
- appVersion: 0.29.x | ||
minK8sVersion: 1.23 | ||
maxK8sVersion: 1.27 | ||
- appVersion: 0.30.x | ||
minK8sVersion: 1.23 | ||
maxK8sVersion: 1.27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
"strings" | ||
|
||
"github.com/aws/karpenter/tools/kompat/pkg/kompat" | ||
) | ||
|
||
func main() { | ||
outputFileName := os.Args[1] | ||
mdFile, err := os.ReadFile(outputFileName) | ||
if err != nil { | ||
log.Printf("Can't read %s file: %v", os.Args[1], err) | ||
os.Exit(2) | ||
} | ||
|
||
genStart := "[comment]: <> (the content below is generated from hack/docs/compataiblitymetrix_gen_docs.go)" | ||
genEnd := "[comment]: <> (end docs generated content from hack/docs/compataiblitymetrix_gen_docs.go)" | ||
startDocSections := strings.Split(string(mdFile), genStart) | ||
if len(startDocSections) != 2 { | ||
log.Fatalf("expected one generated comment block start but got %d", len(startDocSections)-1) | ||
} | ||
endDocSections := strings.Split(string(mdFile), genEnd) | ||
if len(endDocSections) != 2 { | ||
log.Fatalf("expected one generated comment block end but got %d", len(endDocSections)-1) | ||
} | ||
topDoc := fmt.Sprintf("%s%s\n\n", startDocSections[0], genStart) | ||
bottomDoc := fmt.Sprintf("\n%s%s", genEnd, endDocSections[1]) | ||
|
||
baseText, err := kompat.Parse(os.Args[2]) | ||
if err != nil { | ||
log.Fatalf("unable to generate compatibility matrix") | ||
} | ||
|
||
log.Println("writing output to", outputFileName) | ||
f, err := os.Create(outputFileName) | ||
if err != nil { | ||
log.Fatalf("unable to open %s to write generated output: %v", outputFileName, err) | ||
} | ||
f.WriteString(topDoc + baseText.Markdown(kompat.Options{LastN: 5}) + bottomDoc) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"os" | ||
"sort" | ||
"strings" | ||
|
||
"github.com/aws/karpenter/tools/kompat/pkg/kompat" | ||
) | ||
|
||
func main() { | ||
if len(os.Args) != 3 { | ||
log.Fatalf("Usage: %s karpenter version", os.Args[0]) | ||
} | ||
if os.Args[2] == "no tag" { | ||
log.Printf("No version") | ||
os.Exit(0) | ||
} | ||
|
||
chart, err := kompat.Parse(os.Args[1]) | ||
if err != nil { | ||
log.Fatalf("unable to generate compatibility matrix") | ||
} | ||
|
||
sort.Slice(chart[0].Compatibility, func(i int, j int) bool { | ||
return chart[0].Compatibility[i].AppVersion < chart[0].Compatibility[j].AppVersion | ||
}) | ||
|
||
version := strings.TrimPrefix(os.Args[2], "v") | ||
appendVersion := fmt.Sprintf( | ||
` | ||
- appVersion: %s | ||
minK8sVersion: %s | ||
maxK8sVersion: %s`, | ||
version, | ||
chart[0].Compatibility[len(chart[0].Compatibility)-1].MinK8sVersion, | ||
chart[0].Compatibility[len(chart[0].Compatibility)-1].MaxK8sVersion) | ||
|
||
yamlFile, err := os.ReadFile(os.Args[1]) | ||
if err != nil { | ||
log.Printf("Can't read %s file: %v", os.Args[1], err) | ||
os.Exit(2) | ||
} | ||
|
||
log.Println("writing output to", os.Args[1]) | ||
f, err := os.Create(os.Args[1]) | ||
if err != nil { | ||
log.Fatalf("unable to open %s to write generated output: %v", os.Args[1], err) | ||
} | ||
f.WriteString(string(yamlFile) + appendVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters