Skip to content

Commit

Permalink
chore: refresh toolchain (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
tallaxes authored Jan 30, 2024
1 parent 8dd34d2 commit 7156404
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
9 changes: 7 additions & 2 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ runs:
go-version-file: go.mod
check-latest: true
cache-dependency-path: "**/go.sum"
# Root path permission workaround for caching https://github.com/actions/cache/issues/845#issuecomment-1252594999
- run: sudo chown "$USER" /usr/local
shell: bash
- uses: actions/cache@v3
id: cache-toolchain
with:
path: |
~/.kubebuilder/bin
/usr/local/kubebuilder/bin
~/go/bin
key: ${{ runner.os }}-${{ inputs.k8sVersion }}-toolchain-cache-${{ hashFiles('hack/toolchain.sh') }}
- if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
shell: bash
run: K8S_VERSION=${{ inputs.k8sVersion }} make toolchain
env:
K8S_VERSION: ${{ inputs.k8sVersion }}
run: make toolchain
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include Makefile-az.mk

export K8S_VERSION ?= 1.27.x
export KUBEBUILDER_ASSETS ?= ${HOME}/.kubebuilder/bin

# # CR for local builds of Karpenter
SYSTEM_NAMESPACE ?= karpenter
Expand Down
25 changes: 11 additions & 14 deletions hack/toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

K8S_VERSION="${K8S_VERSION:="1.27.x"}"
KUBEBUILDER_ASSETS="${KUBEBUILDER_ASSETS:="${HOME}/.kubebuilder/bin"}"
KUBEBUILDER_ASSETS="/usr/local/kubebuilder/bin"

main() {
tools
Expand All @@ -11,16 +11,16 @@ main() {

tools() {
go install github.com/google/[email protected]
go install github.com/golangci/golangci-lint/cmd/[email protected].1
go install github.com/google/[email protected].0
go install github.com/mikefarah/yq/v4@v4.35.2
go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.3
go install github.com/golangci/golangci-lint/cmd/[email protected].2
go install github.com/google/[email protected].1
go install github.com/mikefarah/yq/v4@v4.40.5
go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.12.0
go install sigs.k8s.io/controller-runtime/tools/[email protected]
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0
go install github.com/sigstore/cosign/cmd/cosign@v1.13.1
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0
go install github.com/sigstore/cosign/v2/cmd/cosign@v2.2.2
# go install -tags extended github.com/gohugoio/[email protected]
go install golang.org/x/vuln/cmd/[email protected].1
go install github.com/onsi/ginkgo/v2/ginkgo@v2.13.2
go install golang.org/x/vuln/cmd/[email protected].3
go install github.com/onsi/ginkgo/v2/ginkgo@v2.15.0
go install github.com/mattn/[email protected]

if ! echo "$PATH" | grep -q "${GOPATH:-undefined}/bin\|$HOME/go/bin"; then
Expand All @@ -29,12 +29,9 @@ tools() {
}

kubebuilder() {
mkdir -p "$KUBEBUILDER_ASSETS"
sudo mkdir -p "${KUBEBUILDER_ASSETS}"
sudo chown "${USER}" "${KUBEBUILDER_ASSETS}"
arch=$(go env GOARCH)
## Kubebuilder does not support darwin/arm64, so use amd64 through Rosetta instead
if [[ $(go env GOOS) == "darwin" ]] && [[ $(go env GOARCH) == "arm64" ]]; then
arch="amd64"
fi
ln -sf "$(setup-envtest use -p path "${K8S_VERSION}" --arch="${arch}" --bin-dir="${KUBEBUILDER_ASSETS}")"/* "${KUBEBUILDER_ASSETS}"
find "$KUBEBUILDER_ASSETS"
}
Expand Down
25 changes: 15 additions & 10 deletions pkg/apis/crds/karpenter.azure.com_aksnodeclasses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: aksnodeclasses.karpenter.azure.com
spec:
group: karpenter.azure.com
Expand All @@ -25,21 +25,26 @@ spec:
description: AKSNodeClass is the Schema for the AKSNodeClass API
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
spec:
description: AKSNodeClassSpec is the top level specification for the AKS
Karpenter Provider. This will contain configuration necessary to launch
instances in AKS.
description: |-
AKSNodeClassSpec is the top level specification for the AKS Karpenter Provider.
This will contain configuration necessary to launch instances in AKS.
properties:
imageFamily:
default: Ubuntu2204
Expand Down

0 comments on commit 7156404

Please sign in to comment.