Skip to content

Commit

Permalink
Append autogenerated CRDS to manifests
Browse files Browse the repository at this point in the history
Signed-off-by: David Vossel <[email protected]>
  • Loading branch information
davidvossel committed Apr 4, 2018
1 parent 563cc20 commit 65c0757
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 142 deletions.
27 changes: 26 additions & 1 deletion hack/build-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,33 @@ for arg in $args; do
final_out_dir=$(dirname ${MANIFESTS_OUT_DIR}/${arg})
mkdir -p ${final_out_dir}
manifest=$(basename -s .in ${arg})
outfile=${final_out_dir}/${manifest}
sed -e "s#{{ docker_tag }}#${docker_tag}#g" \
-e "s#{{ docker_prefix }}#${manifest_docker_prefix}#g" \
-e "s#{{ namespace }}#${namespace}#g" \
${KUBEVIRT_DIR}/manifests/$arg >${final_out_dir}/${manifest}
${KUBEVIRT_DIR}/manifests/$arg >${outfile}

set +e
grep -q '^.*APPEND_AUTOGENERATED_VM_CRD$' $outfile
append_vm_crd=$?
grep -q '^.*APPEND_AUTOGENERATED_VMRS_CRD$' $outfile
append_vmrs_crd=$?
grep -q '^.*APPEND_AUTOGENERATED_VMPRESET_CRD$' $outfile
append_vmpreset_crd=$?
grep -q '^.*APPEND_AUTOGENERATED_OVM_CRD$' $outfile
append_ovm_crd=$?
set -e

if [ "$append_vm_crd" -eq 0 ]; then
cat ${KUBEVIRT_DIR}/manifests/generated/vm-resource.yaml >>$outfile
fi
if [ "$append_vmrs_crd" -eq 0 ]; then
cat ${KUBEVIRT_DIR}/manifests/generated/vmrs-resource.yaml >>$outfile
fi
if [ "$append_vmpreset_crd" -eq 0 ]; then
cat ${KUBEVIRT_DIR}/manifests/generated/vmpreset-resource.yaml >>$outfile
fi
if [ "$append_ovm_crd" -eq 0 ]; then
cat ${KUBEVIRT_DIR}/manifests/generated/ovm-resource.yaml >>$outfile
fi
done
18 changes: 1 addition & 17 deletions manifests/dev/offline-vm.yaml.in
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: offlinevirtualmachines.kubevirt.io
label:
kubevirt.io: ""
spec:
scope: Namespaced
group: kubevirt.io
version: v1alpha1
names:
kind: OfflineVirtualMachine
plural: offlinevirtualmachines
singular: offlinevirtualmachine
shortNames:
- ovm
- ovms
# APPEND_AUTOGENERATED_OVM_CRD
18 changes: 1 addition & 17 deletions manifests/dev/replicase-resource.yaml.in
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: virtualmachinereplicasets.kubevirt.io
labels:
kubevirt.io: ""
spec:
scope: Namespaced
group: kubevirt.io
version: v1alpha1
names:
kind: VirtualMachineReplicaSet
plural: virtualmachinereplicasets
singular: virtualmachinereplicaset
shortNames:
- vmrs
- vmrss
# APPEND_AUTOGENERATED_VMRS_CRD
18 changes: 1 addition & 17 deletions manifests/dev/vm-resource.yaml.in
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: virtualmachines.kubevirt.io
labels:
kubevirt.io: ""
spec:
group: kubevirt.io
version: v1alpha1
scope: Namespaced
names:
plural: virtualmachines
singular: virtualmachine
kind: VirtualMachine
shortNames:
- vm
- vms
# APPEND_AUTOGENERATED_VM_CRD
18 changes: 1 addition & 17 deletions manifests/dev/vmpreset-resource.yaml.in
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: virtualmachinepresets.kubevirt.io
labels:
kubevirt.io: ""
spec:
group: kubevirt.io
version: v1alpha1
scope: Namespaced
names:
plural: virtualmachinepresets
singular: virtualmachinepreset
kind: VirtualMachinePreset
shortNames:
- vmpreset
- vmpresets
# APPEND_AUTOGENERATED_VMPRESET_CRD
77 changes: 4 additions & 73 deletions manifests/release/kubevirt.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -225,43 +225,6 @@ subjects:
name: kubevirt-privileged
namespace: {{ namespace }}
---
# custom resource definitions
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: virtualmachines.kubevirt.io
labels:
kubevirt.io: ""
spec:
group: kubevirt.io
version: v1alpha1
scope: Namespaced
names:
plural: virtualmachines
singular: virtualmachine
kind: VirtualMachine
shortNames:
- vm
- vms
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: virtualmachinereplicasets.kubevirt.io
labels:
kubevirt.io: ""
spec:
scope: Namespaced
group: kubevirt.io
version: v1alpha1
names:
kind: VirtualMachineReplicaSet
plural: virtualmachinereplicasets
singular: virtualmachinereplicaset
shortNames:
- vmrs
- vmrss
---
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -413,39 +376,7 @@ spec:
- name: virt-private-dir
hostPath:
path: /var/run/kubevirt-private
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: virtualmachinepresets.kubevirt.io
labels:
kubevirt.io: ""
spec:
group: kubevirt.io
version: v1alpha1
scope: Namespaced
names:
plural: virtualmachinepresets
singular: virtualmachinepreset
kind: VirtualMachinePreset
shortNames:
- vmpreset
- vmpresets
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: offlinevirtualmachines.kubevirt.io
label:
kubevirt.io: ""
spec:
scope: Namespaced
group: kubevirt.io
version: v1alpha1
names:
kind: OfflineVirtualMachine
plural: offlinevirtualmachines
singular: offlinevirtualmachine
shortNames:
- ovm
- ovms
# APPEND_AUTOGENERATED_VM_CRD
# APPEND_AUTOGENERATED_VMRS_CRD
# APPEND_AUTOGENERATED_VMPRESET_CRD
# APPEND_AUTOGENERATED_OVM_CRD

0 comments on commit 65c0757

Please sign in to comment.