Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InstallPlanReference in Subscription Status #359

Merged
merged 3 commits into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ generate-mock-client: $(counterfeiter)
make gen-all: gen-ci codegen generate-mock-client

# make ver=0.3.0 tectonic-release
make tectonic-release:
tectonic-release:
./scripts/package-release.sh $(ver) deploy/tectonic-alm-operator/manifests/$(ver) deploy/tectonic-alm-operator/values.yaml

# make ver=0.3.0 release
make release:
release:
./scripts/package-release.sh $(ver) deploy/upstream/manifests/$(ver) deploy/upstream/values.yaml

4 changes: 2 additions & 2 deletions pkg/controller/operators/catalog/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ func (o *Operator) syncSubscription(sub *v1alpha1.Subscription) (*v1alpha1.Subsc
sub.Status.Install = &v1alpha1.InstallPlanReference{
UID: res.GetUID(),
Name: res.GetName(),
APIVersion: res.APIVersion,
Kind: res.Kind,
APIVersion: ipv1alpha1.SchemeGroupVersion.String(),
Kind: ipv1alpha1.InstallPlanKind,
}
return sub, nil
}
Expand Down
40 changes: 30 additions & 10 deletions pkg/controller/operators/catalog/subscriptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ func TestSyncSubscription(t *testing.T) {
CurrentCSV: "latest-and-greatest",
LastUpdated: earliestTime,
State: v1alpha1.SubscriptionStateUpgradePending,
Install: &v1alpha1.InstallPlanReference{Name: "existing-install"},
Install: &v1alpha1.InstallPlanReference{
Kind: ipv1alpha1.InstallPlanKind,
APIVersion: ipv1alpha1.SchemeGroupVersion.String(),
Name: "existing-install",
},
},
}},
expected: expected{
Expand All @@ -168,7 +172,11 @@ func TestSyncSubscription(t *testing.T) {
CurrentCSV: "latest-and-greatest",
LastUpdated: earliestTime,
State: v1alpha1.SubscriptionStateUpgradePending,
Install: &v1alpha1.InstallPlanReference{Name: "existing-install"},
Install: &v1alpha1.InstallPlanReference{
Kind: ipv1alpha1.InstallPlanKind,
APIVersion: ipv1alpha1.SchemeGroupVersion.String(),
Name: "existing-install",
},
},
},
err: "",
Expand Down Expand Up @@ -333,7 +341,11 @@ func TestSyncSubscription(t *testing.T) {
},
Status: v1alpha1.SubscriptionStatus{
CurrentCSV: "pending",
Install: &v1alpha1.InstallPlanReference{Name: "existing-install"},
Install: &v1alpha1.InstallPlanReference{
Kind: ipv1alpha1.InstallPlanKind,
APIVersion: ipv1alpha1.SchemeGroupVersion.String(),
Name: "existing-install",
},
},
}},
expected: expected{
Expand Down Expand Up @@ -372,7 +384,9 @@ func TestSyncSubscription(t *testing.T) {
Status: v1alpha1.SubscriptionStatus{
CurrentCSV: "latest-and-greatest",
Install: &v1alpha1.InstallPlanReference{
Name: "dead-install",
Kind: ipv1alpha1.InstallPlanKind,
APIVersion: ipv1alpha1.SchemeGroupVersion.String(),
Name: "dead-install",
},
},
}},
Expand Down Expand Up @@ -413,8 +427,10 @@ func TestSyncSubscription(t *testing.T) {
Status: v1alpha1.SubscriptionStatus{
CurrentCSV: "latest-and-greatest",
Install: &v1alpha1.InstallPlanReference{
UID: types.UID("UID-OK"),
Name: "installplan-1",
Kind: ipv1alpha1.InstallPlanKind,
APIVersion: ipv1alpha1.SchemeGroupVersion.String(),
UID: types.UID("UID-OK"),
Name: "installplan-1",
},
State: v1alpha1.SubscriptionStateUpgradePending,
},
Expand Down Expand Up @@ -486,8 +502,10 @@ func TestSyncSubscription(t *testing.T) {
Status: v1alpha1.SubscriptionStatus{
CurrentCSV: "latest-and-greatest",
Install: &v1alpha1.InstallPlanReference{
UID: types.UID("UID-OK"),
Name: "installplan-1",
Kind: ipv1alpha1.InstallPlanKind,
APIVersion: ipv1alpha1.SchemeGroupVersion.String(),
UID: types.UID("UID-OK"),
Name: "installplan-1",
},
State: v1alpha1.SubscriptionStateUpgradePending,
},
Expand Down Expand Up @@ -563,8 +581,10 @@ func TestSyncSubscription(t *testing.T) {
Status: v1alpha1.SubscriptionStatus{
CurrentCSV: "latest-and-greatest",
Install: &v1alpha1.InstallPlanReference{
UID: types.UID("UID-OK"),
Name: "installplan-1",
Kind: ipv1alpha1.InstallPlanKind,
APIVersion: ipv1alpha1.SchemeGroupVersion.String(),
UID: types.UID("UID-OK"),
Name: "installplan-1",
},
State: v1alpha1.SubscriptionStateUpgradePending,
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_e2e_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo "namespace: ${namespace}" >> ${tmpdir}/e2e-values.yaml
echo "watchedNamespaces: ${namespace}" >> ${tmpdir}/e2e-values.yaml
echo "catalog_namespace: ${namespace}" >> ${tmpdir}/e2e-values.yaml

./scripts/package-release.sh ver=1.0.0-e2e test/e2e/resources ${tmpdir}/e2e-values.yaml
./scripts/package-release.sh 1.0.0-e2e test/e2e/resources ${tmpdir}/e2e-values.yaml

function cleanup {
kubectl delete namespace ${namespace}
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_e2e_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo "namespace: ${namespace}" >> ${tmpdir}/e2e-values.yaml
echo "watchedNamespaces: ${namespace}" >> ${tmpdir}/e2e-values.yaml
echo "catalog_namespace: ${namespace}" >> ${tmpdir}/e2e-values.yaml

./scripts/package-release.sh ver=1.0.0-e2e test/e2e/resources ${tmpdir}/e2e-values.yaml
./scripts/package-release.sh 1.0.0-e2e test/e2e/resources ${tmpdir}/e2e-values.yaml

function cleanup {
kubectl delete namespace ${namespace}
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/e2e-values-shift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ e2e:
ref: quay.io/coreos/olm-e2e:local

job_name: e2e


catalog_sources:
- tectonic-ocs
- tectonic-components
- upstream-components
5 changes: 5 additions & 0 deletions test/e2e/e2e-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ e2e:
ref: quay.io/coreos/olm-e2e:local

job_name: e2e

catalog_sources:
- tectonic-ocs
- tectonic-components
- upstream-components