Skip to content

Commit

Permalink
Add harbor to bundles (aws#26)
Browse files Browse the repository at this point in the history
* Add harbor to bundles

* Fix tests for harbor

* Add harbor package example
  • Loading branch information
TerryHowe authored Mar 9, 2022
1 parent f293826 commit 58faceb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
7 changes: 7 additions & 0 deletions api/testdata/bundle_one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ spec:
versions:
- name: v0.23.0-0b585d5986a1cfcee67b7a956eeef687f00ae468-helm
digest: sha256:5fb61d0b650483851ce3892e30f1d2c4c1372aafd51be24f37bbb0056db04012
- name: Harbor
source:
registry: public.ecr.aws/y8n6a2y0
repository: harbor/harbor-helm
versions:
- name: v2.4.1-c47074c1d3d92a2359f6b379e6688c323338ec18-helm
digest: sha256:02d7873facdc2f4539b21dc81bec1c673a13383b4405858603918822f3c38d3a
8 changes: 7 additions & 1 deletion api/testdata/bundle_two.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ spec:
versions:
- name: v0.25.1-7fb396bd0be3769162a408aa4d22a48fd74a9db7-helm
digest: sha256:ab067969310f3f237c716d6f348dab9cfdce8cc2c188dfdd6b5cfa0e2cd63939

- name: Harbor
source:
registry: public.ecr.aws/y8n6a2y0
repository: harbor/harbor-helm
versions:
- name: v2.4.1-c47074c1d3d92a2359f6b379e6688c323338ec18-helm
digest: sha256:02d7873facdc2f4539b21dc81bec1c673a13383b4405858603918822f3c38d3a
7 changes: 7 additions & 0 deletions api/testdata/harbor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: packages.eks.amazonaws.com/v1alpha1
kind: Package
metadata:
name: my-harbor
spec:
packageName: Harbor
packageVersion: v2.4.1-c47074c1d3d92a2359f6b379e6688c323338ec18-helm
6 changes: 5 additions & 1 deletion pkg/bundle/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestLatestBundle(t *testing.T) {
t.Errorf("expected bundle to be non-nil")
}

if bundle != nil && len(bundle.Spec.Packages) != 2 {
if bundle != nil && len(bundle.Spec.Packages) != 3 {
t.Errorf("expected two packages to be defined, found %d",
len(bundle.Spec.Packages))
}
Expand All @@ -49,6 +49,10 @@ func TestLatestBundle(t *testing.T) {
t.Errorf("expected second package name to be \"Flux\", got: %q",
bundle.Spec.Packages[1].Name)
}
if bundle.Spec.Packages[2].Name != "Harbor" {
t.Errorf("expected second package name to be \"Harbor\", got: %q",
bundle.Spec.Packages[2].Name)
}
})

t.Run("handles pull errors", func(t *testing.T) {
Expand Down

0 comments on commit 58faceb

Please sign in to comment.