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
12 changes: 12 additions & 0 deletions config/crds/hive_v1alpha1_clusterdeployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@ metadata:
controller-tools.k8s.io: "1.0"
name: clusterdeployments.hive.openshift.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.baseDomain
name: BaseDomain
type: string
- JSONPath: .status.installed
name: Installed
type: boolean
- JSONPath: .metadata.creationTimestamp
name: Age
type: date
group: hive.openshift.io
names:
kind: ClusterDeployment
plural: clusterdeployments
shortNames:
- cd
scope: Namespaced
subresources:
status: {}
Expand Down
30 changes: 30 additions & 0 deletions hack/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,36 @@ if [ $i -ge ${max_tries} ] ; then
exit 10
fi

# Sanity check the cluster deployment printer
i=1
while [ $i -le ${max_tries} ]; do
if [ $i -gt 1 ]; then
# Don't sleep on first loop
echo "sleeping ${sleep_between_tries} seconds"
sleep ${sleep_between_tries}
fi

echo "Getting ClusterDeployment ${CLUSTER_NAME}. Try #${i}/${max_tries}:"

GET_BY_SHORT_NAME=$(oc get cd)

if echo "${GET_BY_SHORT_NAME}" | grep 'BASEDOMAIN' ; then
echo "Success"
break
else
echo -n "Failed, "
fi

i=$((i + 1))
done

if [ $i -ge ${max_tries} ] ; then
# Failed the maximum amount of times.
echo "exiting"
exit 10
fi


# Wait for the cluster deployment to be installed
SRC_ROOT=$(git rev-parse --show-toplevel)

Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/hive/v1alpha1/clusterdeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ type ClusterDeploymentStatus struct {
// ClusterDeployment is the Schema for the clusterdeployments API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="BaseDomain",type="string",JSONPath=".spec.baseDomain"
// +kubebuilder:printcolumn:name="Installed",type="boolean",JSONPath=".status.installed"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:resource:path=clusterdeployments,shortName=cd
type ClusterDeployment struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down