Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check PR
on:
pull_request:
types:
- opened
- edited
- labeled
- unlabeled
- reopened
- synchronize
branches:
- 'master*'
- 'release*'

jobs:
check-pr:
name: Check PR
runs-on: ubuntu-latest
steps:
- name: Check commit messages for WIP
uses: gsactions/commit-message-checker@v1
with:
pattern: '^(?!WIP)'
flags: 'gmi'
error: Work in progress
checkAllCommitMessages: true
accessToken: ${{ secrets.GITHUB_TOKEN }}

- name: Check PR labels
uses: jesusvasquez333/verify-pr-label-action@v1.4.0
with:
valid-labels: 'merge'
invalid-labels: 'do-not-merge, wip, wait-before-merge'
disable-reviews: true
github-token: '${{ secrets.GITHUB_TOKEN }}'

- name: Enable auto merge
uses: alexwilson/enable-github-automerge-action@main
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
172 changes: 123 additions & 49 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
name: CI

"on":
- push
- pull_request
on:
push:
tags:
- "*"
branches:
- "master*"
- "release*"
pull_request:
branches:
- "master*"
- "release*"

env:
GOPROXY: https://proxy.golang.org
Expand All @@ -13,81 +20,114 @@ permissions:
contents: read

jobs:
build-linux:
strategy:
matrix:
os:
- name: Linux-amd64
runs-on: ubuntu-24.04
arch: amd64
- name: Linux-arm64
runs-on: ubuntu-24.04-arm
arch: arm64
name: build-linux-${{ matrix.os.arch }}
runs-on: ${{ matrix.os.runs-on }}
changes:
runs-on: ubuntu-24.04
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- name: Detect changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- '!.github/**'

build-linux-amd64:
needs: changes
if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-24.04
steps:
- name: Checkout full
if: startsWith(github.ref, 'refs/tags/')
run: |
git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops

- name: Checkout shallow
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
if: startsWith(github.ref, 'refs/tags/') == false
with:
path: ${{ env.GOPATH }}/src/k8s.io/kops

- name: Set up go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version-file: "${{ env.GOPATH }}/src/k8s.io/kops/go.mod"

- name: make all examples test
- name: Make all examples test
working-directory: ${{ env.GOPATH }}/src/k8s.io/kops
run: |
make all examples test

- name: Upload Linux binaries
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: kops-linux-amd64
path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/linux/amd64/*
if-no-files-found: error
retention-days: 1

build-macos-amd64:
needs: changes
if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }}
runs-on: macos-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Checkout full
if: startsWith(github.ref, 'refs/tags/')
run: |
git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops

- name: Checkout shallow
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
if: startsWith(github.ref, 'refs/tags/') == false
with:
path: ${{ env.GOPATH }}/src/k8s.io/kops

- name: Set up go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: "${{ env.GOPATH }}/src/k8s.io/kops/go.mod"
go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod'

- name: make kops examples test
# Build and upload arm64
- name: Make kops examples test (arm64)
working-directory: ${{ env.GOPATH }}/src/k8s.io/kops
run: |
make kops examples test
GOARCH=arm64 make kops examples test

build-windows-amd64:
runs-on: windows-2022
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Upload kops MacOS binary (arm64)
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
path: ${{ env.GOPATH }}/src/k8s.io/kops
name: kops-darwin-arm64
path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/darwin/arm64/kops
if-no-files-found: error
retention-days: 1

- name: Set up go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version-file: "${{ env.GOPATH }}/src/k8s.io/kops/go.mod"

- name: make kops examples test
# Build and upload amd64
- name: Make kops examples test (amd64)
working-directory: ${{ env.GOPATH }}/src/k8s.io/kops
run: |
make kops examples test-windows
GOARCH=amd64 make kops

- name: Upload kops MacOS binary (amd64)
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: kops-darwin-amd64
path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/darwin/amd64/kops
if-no-files-found: error
retention-days: 1

verify:
strategy:
matrix:
os:
- name: Linux-amd64
runs-on: ubuntu-24.04
arch: amd64
- name: Linux-arm64
runs-on: ubuntu-24.04-arm
arch: arm64
name: verify-${{ matrix.os.arch }}
runs-on: ${{ matrix.os.runs-on }}
needs: changes
if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
path: ${{ env.GOPATH }}/src/k8s.io/kops

Expand All @@ -96,7 +136,41 @@ jobs:
with:
go-version-file: "${{ env.GOPATH }}/src/k8s.io/kops/go.mod"

- name: make quick-ci
- name: Make quick-ci
working-directory: ${{ env.GOPATH }}/src/k8s.io/kops
run: |
make quick-ci

release:
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
needs:
- build-linux-amd64
- build-macos-amd64
- verify
steps:
- name: Download all binary artifacts
uses: actions/download-artifact@v4

- name: Rename kops binary artifacts
run: |
mv kops-darwin-amd64/kops kops-darwin-amd64/kops-darwin-amd64
mv kops-darwin-arm64/kops kops-darwin-arm64/kops-darwin-arm64
mv kops-linux-amd64/kops kops-linux-amd64/kops-linux-amd64
mv kops-linux-amd64/channels kops-linux-amd64/channels-linux-amd64
mv kops-linux-amd64/protokube kops-linux-amd64/protokube-linux-amd64
mv kops-linux-amd64/nodeup kops-linux-amd64/nodeup-linux-amd64

- name: Release
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
files: |
kops-darwin-amd64/kops-darwin-amd64
kops-darwin-arm64/kops-darwin-arm64
kops-linux-amd64/kops-linux-amd64
kops-linux-amd64/channels-linux-amd64
kops-linux-amd64/protokube-linux-amd64
kops-linux-amd64/nodeup-linux-amd64
7 changes: 5 additions & 2 deletions cmd/kops/get_assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ var (
kops get assets

# Copy assets to the local repositories configured in the cluster spec.
kops get assets --copy
kops get assets --copy
`))

getAssetsShort = i18n.T(`Display assets for cluster.`)
)

type GetAssetsOptions struct {
*GetOptions
Copy bool
Copy bool
IncludeIGAssets bool
}

type Image struct {
Expand Down Expand Up @@ -96,6 +97,7 @@ func NewCmdGetAssets(f *util.Factory, out io.Writer, getOptions *GetOptions) *co
}

cmd.Flags().BoolVar(&options.Copy, "copy", options.Copy, "copy assets to local repository")
cmd.Flags().BoolVar(&options.IncludeIGAssets, "include-ig-assets", options.IncludeIGAssets, "include assets of the instance groups")

return cmd
}
Expand All @@ -105,6 +107,7 @@ func RunGetAssets(ctx context.Context, f *util.Factory, out io.Writer, options *
CoreUpdateClusterOptions: CoreUpdateClusterOptions{
Target: cloudup.TargetDryRun,
GetAssets: true,
GetIGAssets: options.IncludeIGAssets,
ClusterName: options.ClusterName,
},
})
Expand Down
4 changes: 4 additions & 0 deletions cmd/kops/update_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ type CoreUpdateClusterOptions struct {
// GetAssets is whether this is invoked from the CmdGetAssets.
GetAssets bool

// GetIGAssets is whether this is called to obtain the IG assets as well
GetIGAssets bool

ClusterName string

// InstanceGroups is the list of instance groups to update;
Expand Down Expand Up @@ -374,6 +377,7 @@ func RunUpdateCluster(ctx context.Context, f *util.Factory, out io.Writer, c *Up
TargetName: targetName,
LifecycleOverrides: lifecycleOverrideMap,
GetAssets: c.GetAssets,
GetIGAssets: c.GetIGAssets,
DeletionProcessing: deletionProcessing,
ControlPlaneRunningVersion: minControlPlaneRunningVersion,
}
Expand Down
5 changes: 3 additions & 2 deletions docs/cli/kops_get_assets.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
version: 9.99.0
- id: k8s-1.25
manifest: networking.projectcalico.org/k8s-1.25.yaml
manifestHash: f16968ad43bb21350e5b985ef6137cda40767f6a06509ec9b05e6b1e80b60301
manifestHash: 7ac921f8b7527a44d91610a9a81160873f2246d8e474cd63cda0ad52e2c3b8a0
name: networking.projectcalico.org
prune:
kinds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6294,6 +6294,8 @@ spec:
name: calico-config
- name: CALICO_IPV4POOL_CIDR
value: 100.96.0.0/11
- name: CALICO_IPV6POOL_NAT_OUTGOING
value: "false"
- name: CALICO_DISABLE_FILE_LOGGING
value: "true"
- name: FELIX_DEFAULTENDPOINTTOHOSTACTION
Expand Down
1 change: 1 addition & 0 deletions tools/get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if [[ -n "${CI}" ]]; then
EXACT_TAG=$(git describe --tags --exact-match 2>/dev/null || true)
if [[ -n "${EXACT_TAG}" ]]; then
VERSION="${EXACT_TAG#v}" # Remove the v prefix from the git tag
VERSION="${VERSION//-bp*/}" # remove the bearingpoint version from the tag
if [[ "${VERSION}" != "${KOPS_RELEASE_VERSION}" ]]; then
echo "Build was tagged with ${VERSION}, but kops-version.go had version ${KOPS_RELEASE_VERSION}"
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4843,14 +4843,14 @@ spec:
operator: Exists
- key: kubernetes.io/os
operator: In
values:
values:
- linux
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
- key: kubernetes.io/os
operator: In
values:
values:
- linux
tolerations:
# Mark the pod as a critical add-on for rescheduling.
Expand Down
Loading
Loading