Skip to content
This repository has been archived by the owner on Feb 20, 2025. It is now read-only.

Commit

Permalink
chore: remove personal information (#134)
Browse files Browse the repository at this point in the history
## Description

Related to open-component-model/ocm-project#43


## What type of PR is this? (check all applicable)

- [ ] πŸ• Feature
- [ ] πŸ› Bug Fix
- [ ] πŸ“ Documentation Update
- [ ] 🎨 Style
- [ ] πŸ§‘β€πŸ’» Code Refactor
- [ ] πŸ”₯ Performance Improvements
- [ ] βœ… Test
- [ ] πŸ€– Build
- [ ] πŸ” CI
- [ ] πŸ“¦ Chore (Release)
- [ ] ⏩ Revert

## Related Tickets & Documents

<!-- 
Please use this format link issue numbers: Fixes #123

https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
- Related Issue # (issue)
- Closes # (issue)
- Fixes # (issue)
> Remove if not applicable

## Screenshots

<!-- Visual changes require screenshots -->


## Added tests?

- [ ] πŸ‘ yes
- [ ] πŸ™… no, because they aren't needed
- [ ] πŸ™‹ no, because I need help
- [ ] Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration


## Added to documentation?

- [ ] πŸ“œ README.md
- [ ] πŸ™… no documentation needed

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
  • Loading branch information
Skarlso authored Apr 9, 2024
1 parent 810d99c commit f002c63
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
component: github.com/weaveworks/podify
semver: "=>v1.0.0"
source:
url: ghcr.io/phoban01
url: ghcr.io/open-component-model
secretRef:
name: creds
destination:
Expand Down
26 changes: 14 additions & 12 deletions pkg/ocm/ocm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@ func TestClient_GetComponentVersion(t *testing.T) {
Name: "test-name-secret",
Namespace: "default",
},
// b3Blbi1jb21wb25lbnQtbW9kZWw6cGFzc3dvcmQ= -> open-component-model:password
Data: map[string][]byte{
".dockerconfigjson": []byte(`{
"auths": {
"ghcr.io": {
"username": "skarlso",
"username": "open-component-model",
"password": "password",
"auth": "c2thcmxzbzpwYXNzd29yZAo="
"auth": "b3Blbi1jb21wb25lbnQtbW9kZWw6cGFzc3dvcmQ="
}
}
}`),
Expand All @@ -142,7 +143,7 @@ func TestClient_GetComponentVersion(t *testing.T) {
t.Helper()

objs := make([]client.Object, 0)
component := "github.com/skarlso/ocm-demo-index"
component := "github.com/open-component-model/ocm-demo-index"
cs := tt.subscription(component, &objs)
fakeKubeClient := env.FakeKubeClient(WithObjects(objs...))

Expand All @@ -169,7 +170,7 @@ func TestClient_CreateAuthenticatedOCMContext(t *testing.T) {
Namespace: "default",
},
Spec: v1alpha1.ComponentSubscriptionSpec{
Component: "github.com/skarlso/ocm-demo-index",
Component: "github.com/open-component-model/ocm-demo-index",
Semver: ">v0.0.1",
Source: v1alpha1.OCMRepository{
URL: "localhost",
Expand All @@ -193,13 +194,14 @@ func TestClient_CreateAuthenticatedOCMContext(t *testing.T) {
Name: "test-name-secret",
Namespace: "default",
},
// b3Blbi1jb21wb25lbnQtbW9kZWw6cGFzc3dvcmQ= -> open-component-model:password
Data: map[string][]byte{
".dockerconfigjson": []byte(`{
"auths": {
"ghcr.io": {
"username": "skarlso",
"username": "open-component-model",
"password": "password",
"auth": "c2thcmxzbzpwYXNzd29yZAo="
"auth": "b3Blbi1jb21wb25lbnQtbW9kZWw6cGFzc3dvcmQ="
}
}
}`),
Expand All @@ -216,15 +218,15 @@ func TestClient_CreateAuthenticatedOCMContext(t *testing.T) {
id := cpi.ConsumerIdentity{
cpi.ID_TYPE: identity.CONSUMER_TYPE,
identity.ID_HOSTNAME: "ghcr.io",
identity.ID_PATHPREFIX: "skarlso",
identity.ID_PATHPREFIX: "open-component-model",
}
creds, err := octx.CredentialsContext().GetCredentialsForConsumer(id)
require.NoError(t, err)
consumer, err := creds.Credentials(nil)
require.NoError(t, err)

assert.Equal(t, "password", consumer.Properties()["password"])
assert.Equal(t, "skarlso", consumer.Properties()["username"])
assert.Equal(t, "open-component-model", consumer.Properties()["username"])
assert.Equal(t, "ghcr.io", consumer.Properties()["serverAddress"])
}

Expand Down Expand Up @@ -390,7 +392,7 @@ func TestClient_GetLatestValidComponentVersion(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
fakeKubeClient := env.FakeKubeClient()
ocmClient := NewClient(fakeKubeClient)
component := "github.com/skarlso/ocm-demo-index"
component := "github.com/open-component-model/ocm-demo-index"

octx := ocmcontext.NewFakeOCMContext()
err := tt.setupComponents(component, octx)
Expand Down Expand Up @@ -422,7 +424,7 @@ func TestClient_VerifyComponent(t *testing.T) {
}
fakeKubeClient := env.FakeKubeClient(WithObjects(secret))
ocmClient := NewClient(fakeKubeClient)
component := "github.com/skarlso/ocm-demo-index"
component := "github.com/open-component-model/ocm-demo-index"

octx := ocmcontext.NewFakeOCMContext()

Expand Down Expand Up @@ -469,7 +471,7 @@ func TestClient_VerifyComponent(t *testing.T) {
func TestClient_SignComponent(t *testing.T) {
fakeKubeClient := env.FakeKubeClient()
ocmClient := NewClient(fakeKubeClient)
component := "github.com/skarlso/ocm-demo-index"
component := "github.com/open-component-model/ocm-demo-index"

octx := ocmcontext.NewFakeOCMContext()

Expand Down Expand Up @@ -526,7 +528,7 @@ func TestClient_VerifyComponentDifferentPublicKey(t *testing.T) {
}
fakeKubeClient := env.FakeKubeClient(WithObjects(secret))
ocmClient := NewClient(fakeKubeClient)
component := "github.com/skarlso/ocm-demo-index"
component := "github.com/open-component-model/ocm-demo-index"

octx := ocmcontext.NewFakeOCMContext()

Expand Down

0 comments on commit f002c63

Please sign in to comment.