Skip to content
Merged
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
73 changes: 73 additions & 0 deletions .github/workflows/create_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
on:
push:
tags:
- "v*"

name: Upload Release Asset

jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: build image
shell: bash
env:
QUAY_TOKEN: ${{secrets.QUAY_TOKEN}}
REGISTRY: "quay.io/capk"
TAG: ${{ github.ref_name }}
run: |
echo $QUAY_TOKEN | docker login -u="capk+capk_robot" quay.io --password-stdin
make docker-build
make docker-push
build:
name: Upload Release Asset
needs: build-and-push-image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Install kustomize
run: curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
- name: Create infrastructure components
env:
REGISTRY: "quay.io/capk"
IMAGE_NAME: "capk-manager-amd64"
TAG: ${{ github.ref_name }}
run: |
make create-infrastructure-components
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload infrastructure-components.yaml
id: upload-infrastructure-components
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./infrastructure-components.yaml
asset_name: infrastructure-components.yaml
asset_content_type: text/plain
- name: Upload metadata.yaml
id: upload-metadata
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./metadata.yaml
asset_name: metadata.yaml
asset_content_type: text/plain
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ cluster-up/
hack/tools/bin/
bin/
.idea/
infrastructure-components.yaml
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# If you update this file, please follow:
# https://suva.sh/posts/well-documented-makefiles/

ROOT = $$GOPATH/pkg/mod/sigs.k8s.io/cluster-api@v0.3.11-0.20210525210043-6c7878e7b4a9
ROOT = $$(go env GOPATH)/pkg/mod/sigs.k8s.io/cluster-api@v0.3.11-0.20210525210043-6c7878e7b4a9

.DEFAULT_GOAL:=help
TARGET ?= target
Expand Down Expand Up @@ -50,10 +50,8 @@ endif
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/controller-gen)
CONVERSION_GEN := $(abspath $(TOOLS_BIN_DIR)/conversion-gen)
GOTESTSUM := $(abspath $(TOOLS_BIN_DIR)/gotestsum)
KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR)/kustomize)

$(KUSTOMIZE): # Build kustomize from tools folder.
$(MAKE) -C $(ROOT) kustomize
KUSTOMIZE_IMAGE = k8s.gcr.io/kustomize/kustomize:v3.8.7
KUSTOMIZE ?= docker run $(KUSTOMIZE_IMAGE)

# Define Docker related variables. Releases should modify and double check these vars.
REGISTRY ?= 127.0.0.1:5000
Expand Down Expand Up @@ -244,6 +242,18 @@ else
sed -i -e 's@imagePullPolicy: .*@imagePullPolicy: '"$(PULL_POLICY)"'@' ./config/default/manager_pull_policy.yaml
endif

## --------------------------------------
## Deployment
## --------------------------------------
##> infrastructure-components.yaml
set_controller_image:
echo setting controller image to be ${CONTROLLER_IMG}:${TAG}
cd config/default && kustomize edit set image controller=${CONTROLLER_IMG}:${TAG}

create-infrastructure-components: generate-manifests set_controller_image
kustomize build config/default > infrastructure-components.yaml


## --------------------------------------
## Cleanup / Verification
## --------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion clusterctl-settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "infrastructure-kubevirt",
"name": "kubevirt",
"config": {
"componentsFile": "infrastructure-components.yaml",
"nextVersion": "v0.1.0"
Expand Down
5 changes: 5 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
commonLabels:
cluster.x-k8s.io/provider: kubevirt
cluster.x-k8s.io/v1alpha1: v1alpha1
cluster.x-k8s.io/v1alpha2: v1alpha1
cluster.x-k8s.io/v1alpha3: v1alpha1
cluster.x-k8s.io/v1alpha4: v1alpha1
cluster.x-k8s.io/v1beta1: v1alpha1

# This kustomization.yaml is not intended to be run by itself,
Expand Down
7 changes: 6 additions & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ namespace: capk-system
namePrefix: capk-

commonLabels:
cluster.x-k8s.io/provider: "infrastructure-kubevirt"
cluster.x-k8s.io/provider: "kubevirt"
cluster.x-k8s.io/v1alpha1: v1alpha1
cluster.x-k8s.io/v1alpha2: v1alpha1
cluster.x-k8s.io/v1alpha3: v1alpha1
cluster.x-k8s.io/v1alpha4: v1alpha1
cluster.x-k8s.io/v1beta1: v1alpha1

resources:
- namespace.yaml
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
spec:
containers:
# Change the value of image field below to your controller image URL
- image: gcr.io/k8s-staging-cluster-api/capk-manager:dev
- image: controller
name: manager
7 changes: 6 additions & 1 deletion config/kubevirtci/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ namespace: capk-system
namePrefix: capk-

commonLabels:
cluster.x-k8s.io/provider: "infrastructure-kubevirt"
cluster.x-k8s.io/provider: "kubevirt"
cluster.x-k8s.io/v1alpha1: v1alpha1
cluster.x-k8s.io/v1alpha2: v1alpha1
cluster.x-k8s.io/v1alpha3: v1alpha1
cluster.x-k8s.io/v1alpha4: v1alpha1
cluster.x-k8s.io/v1beta1: v1alpha1

resources:
- namespace.yaml
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
resources:
- manager.yaml
- manager.yaml
2 changes: 0 additions & 2 deletions controllers/kubevirtcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ func (r *KubevirtClusterReconciler) Reconcile(goctx gocontext.Context, req ctrl.
return ctrl.Result{}, nil
}

log = log.WithValues("cluster", cluster.Name)
Comment thread
isaacdorfman marked this conversation as resolved.

// Create the cluster context for this request.
clusterContext := &context.ClusterContext{
Context: goctx,
Expand Down
2 changes: 1 addition & 1 deletion e2e/create-cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ var _ = Describe("CreateCluster", func() {
}

return nil
}, 10*time.Minute, 5*time.Second).Should(Succeed(), "cluster should have control plane initialized")
}, 20*time.Minute, 5*time.Second).Should(Succeed(), "cluster should have control plane initialized")

By("Waiting on cluster's control plane to be ready")
Eventually(func() error {
Expand Down
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
kind: Metadata
releaseSeries:
- major: 0
- major: 1
minor: 1
contract: v1beta1