From f002c635480cd8c31c7dd23f877c03ad6262abdd Mon Sep 17 00:00:00 2001 From: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> Date: Tue, 9 Apr 2024 09:01:50 +0200 Subject: [PATCH] chore: remove personal information (#134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Related to https://github.com/open-component-model/ocm-project/issues/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 - Related Issue # (issue) - Closes # (issue) - Fixes # (issue) > Remove if not applicable ## 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 --- README.md | 2 +- pkg/ocm/ocm_test.go | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index db592bc..735bef7 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/pkg/ocm/ocm_test.go b/pkg/ocm/ocm_test.go index d9910b3..f188e9e 100644 --- a/pkg/ocm/ocm_test.go +++ b/pkg/ocm/ocm_test.go @@ -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=" } } }`), @@ -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...)) @@ -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", @@ -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=" } } }`), @@ -216,7 +218,7 @@ 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) @@ -224,7 +226,7 @@ func TestClient_CreateAuthenticatedOCMContext(t *testing.T) { 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"]) } @@ -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) @@ -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() @@ -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() @@ -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()