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 }}"
162 changes: 128 additions & 34 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,61 +20,114 @@ permissions:
contents: read

jobs:
changes:
runs-on: ubuntu-latest
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- 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:
- 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@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
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
with:
path: ${{ env.GOPATH }}/src/k8s.io/kops
- 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: Set up go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod'
- 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@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod'

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

build-windows-amd64:
runs-on: windows-2022
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
path: ${{ env.GOPATH }}/src/k8s.io/kops
- name: Upload kops MacOS binary (arm64)
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
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@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod'
# Build and upload amd64
- name: Make kops examples test (amd64)
working-directory: ${{ env.GOPATH }}/src/k8s.io/kops
run: |
GOARCH=amd64 make kops

- name: make kops examples test
working-directory: ${{ env.GOPATH }}/src/k8s.io/kops
run: |
make kops examples test-windows
- 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:
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 @@ -76,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-20.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 @@ -89,6 +89,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 @@ -371,6 +374,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 @@ -106,7 +106,7 @@ spec:
version: 9.99.0
- id: k8s-1.25
manifest: networking.projectcalico.org/k8s-1.25.yaml
manifestHash: 2ba3f766420e62e454cdf6462f3cf1e01c0be716ec3309c441ab2c9249413f87
manifestHash: 133a8bebf944e9b5ae97274fe4104c74963ef5ca3f398aef956830e0ee512308
name: networking.projectcalico.org
prune:
kinds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4945,6 +4945,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 @@ -49,7 +49,7 @@ data:
"mtu": __CNI_MTU__,
"ipam": {
"assign_ipv4": "{{ not IsIPv6Only }}",
"assign_ipv6": "{{ IsIPv6Only }}",
"assign_ipv6": "{{ CalicoUseIPv6 }}",
{{- if IsIPv6Only }}
"type": "host-local",
"ranges": [[{ "subnet": "usePodCidrIPv6" }]]
Expand Down Expand Up @@ -4633,7 +4633,7 @@ spec:
- name: IP
value: "{{- if not IsIPv6Only -}}autodetect{{- else -}}none{{- end -}}"
- name: IP6
value: "{{- if IsIPv6Only -}}autodetect{{- else -}}none{{- end -}}"
value: "{{- if CalicoUseIPv6 -}}autodetect{{- else -}}none{{- end -}}"
{{- if IsIPv6Only }}
- name: IP_AUTODETECTION_METHOD
value: "{{- or .Networking.Calico.IPv4AutoDetectionMethod "none" }}"
Expand Down Expand Up @@ -4680,6 +4680,8 @@ spec:
{{- else }}
- name: CALICO_IPV4POOL_CIDR
value: "{{ .KubeControllerManager.ClusterCIDR }}"
- name: CALICO_IPV6POOL_NAT_OUTGOING
value: "{{- CalicoUseIPv6 }}"
{{- end }}
# Disable file logging so `kubectl logs` works.
- name: CALICO_DISABLE_FILE_LOGGING
Expand All @@ -4689,7 +4691,7 @@ spec:
value: "ACCEPT"
# Set IPv6 on Kubernetes.
- name: FELIX_IPV6SUPPORT
value: "{{ IsIPv6Only }}"
value: "{{ CalicoUseIPv6 }}"
- name: FELIX_HEALTHENABLED
value: "true"

Expand Down
Loading
Loading