diff --git a/Dockerfile.dev b/Dockerfile.dev index 978304f80fc44..0671aa635b133 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -7,6 +7,7 @@ COPY argocd /usr/local/bin/ USER root RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \ ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \ + ln -s /usr/local/bin/argocd /usr/local/bin/event-reporter-server && \ ln -s /usr/local/bin/argocd /usr/local/bin/argocd-application-controller && \ ln -s /usr/local/bin/argocd /usr/local/bin/argocd-dex && \ ln -s /usr/local/bin/argocd /usr/local/bin/argocd-notifications && \ diff --git a/Makefile b/Makefile index 6a6f6eff5fda5..2cbda2c4926c0 100644 --- a/Makefile +++ b/Makefile @@ -145,12 +145,12 @@ endef PATH:=$(PATH):$(PWD)/hack # docker image publishing options -DOCKER_PUSH?=false -IMAGE_NAMESPACE?=quay.io/codefresh +DOCKER_PUSH?=true +IMAGE_NAMESPACE?=quay.io/noam_codefresh # perform static compilation STATIC_BUILD?=true # build development images -DEV_IMAGE?=false +DEV_IMAGE?=true ARGOCD_GPG_ENABLED?=true ARGOCD_E2E_APISERVER_PORT?=8080 diff --git a/assets/swagger.json b/assets/swagger.json index 818488ca7383d..c4554474f3cd5 100644 --- a/assets/swagger.json +++ b/assets/swagger.json @@ -5238,28 +5238,6 @@ } } }, - "repositoryManifest": { - "type": "object", - "properties": { - "compiledManifest": { - "type": "string", - "title": "The processed manifest that needs to be applied to the cluster" - }, - "line": { - "type": "integer", - "format": "int32", - "title": "The line in the file where the object starts" - }, - "path": { - "type": "string", - "title": "The path of the raw manifest inside the repo" - }, - "rawManifest": { - "description": "The pre-processed manifest (for example the kustomization.yaml\nwhen using kustmize or the values.yaml when using helm).", - "type": "string" - } - } - }, "repositoryManifestResponse": { "type": "object", "properties": { @@ -5278,7 +5256,7 @@ "manifests": { "type": "array", "items": { - "$ref": "#/definitions/repositoryManifest" + "type": "string" } }, "namespace": { @@ -5296,7 +5274,7 @@ }, "sourcesManifestsStartingIdx": { "type": "array", - "title": "for multisourced apps will be [0,12,20], so this means that 0-11 - from first app source, 12-19 from second one, 20-x - third one", + "title": "for multisourced apps will be [0,12,20], so this means that 0-11 - from first app source, 12-19 from second one, 20-x - third one\nTODO: cf", "items": { "type": "integer", "format": "int32" diff --git a/controller/appcontroller_test.go b/controller/appcontroller_test.go index 0ce49fb83cfcb..8036ae6903fca 100644 --- a/controller/appcontroller_test.go +++ b/controller/appcontroller_test.go @@ -947,11 +947,7 @@ func TestFinalizeAppDeletion(t *testing.T) { app.Spec.Destination.Namespace = test.FakeArgoCDNamespace ctrl := newFakeController(&fakeData{ manifestResponses: []*apiclient.ManifestResponse{{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: fakePostDeleteHook, - }, - }, + Manifests: []string{fakePostDeleteHook}, }}, apps: []runtime.Object{app, &defaultProj}, managedLiveObjs: map[kube.ResourceKey]*unstructured.Unstructured{}, @@ -993,11 +989,7 @@ func TestFinalizeAppDeletion(t *testing.T) { require.NoError(t, unstructured.SetNestedField(liveHook.Object, conditions, "status", "conditions")) ctrl := newFakeController(&fakeData{ manifestResponses: []*apiclient.ManifestResponse{{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: fakePostDeleteHook, - }, - }, + Manifests: []string{fakePostDeleteHook}, }}, apps: []runtime.Object{app, &defaultProj}, managedLiveObjs: map[kube.ResourceKey]*unstructured.Unstructured{ @@ -1041,19 +1033,11 @@ func TestFinalizeAppDeletion(t *testing.T) { require.NoError(t, unstructured.SetNestedField(liveHook.Object, conditions, "status", "conditions")) ctrl := newFakeController(&fakeData{ manifestResponses: []*apiclient.ManifestResponse{{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: fakeRoleBinding, - }, - { - CompiledManifest: fakeRole, - }, - { - CompiledManifest: fakeServiceAccount, - }, - { - CompiledManifest: fakePostDeleteHook, - }, + Manifests: []string{ + fakeRoleBinding, + fakeRole, + fakeServiceAccount, + fakePostDeleteHook, }, }}, apps: []runtime.Object{app, &defaultProj}, @@ -1116,7 +1100,7 @@ func TestNormalizeApplication(t *testing.T) { data := fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1595,7 +1579,7 @@ func TestUpdateReconciledAt(t *testing.T) { ctrl := newFakeController(&fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1652,7 +1636,7 @@ func TestProjectErrorToCondition(t *testing.T) { ctrl := newFakeController(&fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1810,7 +1794,7 @@ func TestProcessRequestedAppOperation_RunningPreviouslyFailed(t *testing.T) { data := &fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1843,7 +1827,7 @@ func TestProcessRequestedAppOperation_HasRetriesTerminated(t *testing.T) { data := &fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1874,7 +1858,7 @@ func TestProcessRequestedAppOperation_Successful(t *testing.T) { ctrl := newFakeController(&fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponses: []*apiclient.ManifestResponse{{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, }}, }, nil) fakeAppCs := ctrl.applicationClientset.(*appclientset.Clientset) @@ -1900,7 +1884,7 @@ func TestGetAppHosts(t *testing.T) { data := &fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", diff --git a/controller/state.go b/controller/state.go index a6e4add80c6ef..95f60c03bf2af 100644 --- a/controller/state.go +++ b/controller/state.go @@ -283,7 +283,7 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp return nil, nil, false, fmt.Errorf("failed to generate manifest for source %d of %d: %w", i+1, len(sources), err) } - targetObj, err := unmarshalManifests(manifestInfo.GetCompiledManifests()) + targetObj, err := unmarshalManifests(manifestInfo.Manifests) if err != nil { return nil, nil, false, fmt.Errorf("failed to unmarshal manifests for source %d of %d: %w", i+1, len(sources), err) } diff --git a/controller/state_test.go b/controller/state_test.go index 72de49fd656dd..77a3b3cccbce3 100644 --- a/controller/state_test.go +++ b/controller/state_test.go @@ -38,7 +38,7 @@ func TestCompareAppStateEmpty(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -102,7 +102,7 @@ func TestCompareAppStateNamespaceMetadataDiffers(t *testing.T) { data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -149,9 +149,7 @@ func TestCompareAppStateNamespaceMetadataDiffersToManifest(t *testing.T) { data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - {CompiledManifest: toJSON(t, liveNs)}, - }, + Manifests: []string{toJSON(t, liveNs)}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -209,7 +207,7 @@ func TestCompareAppStateNamespaceMetadata(t *testing.T) { data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -270,7 +268,7 @@ func TestCompareAppStateNamespaceMetadataIsTheSame(t *testing.T) { data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -298,10 +296,8 @@ func TestCompareAppStateMissing(t *testing.T) { data := fakeData{ apps: []runtime.Object{app}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: PodManifest, - }, + Manifests: []string{ + PodManifest, }, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, @@ -332,7 +328,7 @@ func TestCompareAppStateExtra(t *testing.T) { key := kube.ResourceKey{Group: "", Kind: "Pod", Namespace: test.FakeDestNamespace, Name: app.Name} data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -365,10 +361,8 @@ func TestCompareAppStateHook(t *testing.T) { data := fakeData{ apps: []runtime.Object{app}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: string(podBytes), - }, + Manifests: []string{ + string(podBytes), }, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, @@ -401,10 +395,8 @@ func TestCompareAppStateSkipHook(t *testing.T) { data := fakeData{ apps: []runtime.Object{app}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: string(podBytes), - }, + Manifests: []string{ + string(podBytes), }, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, @@ -435,7 +427,7 @@ func TestCompareAppStateCompareOptionIgnoreExtraneous(t *testing.T) { data := fakeData{ apps: []runtime.Object{app}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -467,7 +459,7 @@ func TestCompareAppStateExtraHook(t *testing.T) { key := kube.ResourceKey{Group: "", Kind: "Pod", Namespace: test.FakeDestNamespace, Name: app.Name} data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -498,8 +490,8 @@ func TestAppRevisionsSingleSource(t *testing.T) { obj1.SetNamespace(test.FakeDestNamespace) data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - {CompiledManifest: toJSON(t, obj1)}, + Manifests: []string{ + toJSON(t, obj1), }, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, @@ -527,23 +519,23 @@ func TestAppRevisionsMultiSource(t *testing.T) { data := fakeData{ manifestResponses: []*apiclient.ManifestResponse{ { - Manifests: []*apiclient.Manifest{ - {CompiledManifest: toJSON(t, obj1)}, + Manifests: []string{ + toJSON(t, obj1), }, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", }, { - Manifests: []*apiclient.Manifest{ - {CompiledManifest: toJSON(t, obj1)}, + Manifests: []string{ + toJSON(t, obj1), }, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "def456", }, { - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "ghi789", @@ -589,12 +581,12 @@ func TestCompareAppStateDuplicatedNamespacedResources(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - {CompiledManifest: toJSON(t, obj1)}, - {CompiledManifest: toJSON(t, obj2)}, - {CompiledManifest: toJSON(t, obj3)}, - {CompiledManifest: toJSON(t, obj4)}, - {CompiledManifest: toJSON(t, obj5)}, + Manifests: []string{ + toJSON(t, obj1), + toJSON(t, obj2), + toJSON(t, obj3), + toJSON(t, obj4), + toJSON(t, obj5), }, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, @@ -637,7 +629,7 @@ func TestCompareAppStateManagedNamespaceMetadataWithLiveNsDoesNotGetPruned(t *te data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -690,7 +682,7 @@ func TestCompareAppStateWithManifestGeneratePath(t *testing.T) { data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -724,7 +716,7 @@ func TestSetHealth(t *testing.T) { ctrl := newFakeController(&fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -760,7 +752,7 @@ func TestSetHealthSelfReferencedApp(t *testing.T) { ctrl := newFakeController(&fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -978,7 +970,7 @@ func TestSignedResponseNoSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1005,7 +997,7 @@ func TestSignedResponseNoSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1037,7 +1029,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1064,7 +1056,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1091,7 +1083,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1118,7 +1110,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1146,7 +1138,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1176,7 +1168,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1208,7 +1200,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1236,7 +1228,7 @@ func TestSignedResponseSignatureRequired(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1375,7 +1367,7 @@ func TestIsLiveResourceManaged(t *testing.T) { ctrl := newFakeController(&fakeData{ apps: []runtime.Object{app, &defaultProj}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1473,9 +1465,9 @@ func TestUseDiffCache(t *testing.T) { manifestInfos := func(revision string) []*apiclient.ManifestResponse { return []*apiclient.ManifestResponse{ { - Manifests: []*apiclient.Manifest{ - {CompiledManifest: "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"labels\":{\"app.kubernetes.io/instance\":\"httpbin\"},\"name\":\"httpbin-svc\",\"namespace\":\"httpbin\"},\"spec\":{\"ports\":[{\"name\":\"http-port\",\"port\":7777,\"targetPort\":80},{\"name\":\"test\",\"port\":333}],\"selector\":{\"app\":\"httpbin\"}}}"}, - {CompiledManifest: "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"labels\":{\"app.kubernetes.io/instance\":\"httpbin\"},\"name\":\"httpbin-deployment\",\"namespace\":\"httpbin\"},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"app\":\"httpbin\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"httpbin\"}},\"spec\":{\"containers\":[{\"image\":\"kennethreitz/httpbin\",\"imagePullPolicy\":\"Always\",\"name\":\"httpbin\",\"ports\":[{\"containerPort\":80}]}]}}}}"}, + Manifests: []string{ + "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"labels\":{\"app.kubernetes.io/instance\":\"httpbin\"},\"name\":\"httpbin-svc\",\"namespace\":\"httpbin\"},\"spec\":{\"ports\":[{\"name\":\"http-port\",\"port\":7777,\"targetPort\":80},{\"name\":\"test\",\"port\":333}],\"selector\":{\"app\":\"httpbin\"}}}", + "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"labels\":{\"app.kubernetes.io/instance\":\"httpbin\"},\"name\":\"httpbin-deployment\",\"namespace\":\"httpbin\"},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"app\":\"httpbin\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"httpbin\"}},\"spec\":{\"containers\":[{\"image\":\"kennethreitz/httpbin\",\"imagePullPolicy\":\"Always\",\"name\":\"httpbin\",\"ports\":[{\"containerPort\":80}]}]}}}}", }, Namespace: "", Server: "", @@ -1741,7 +1733,7 @@ func TestCompareAppStateDefaultRevisionUpdated(t *testing.T) { app := newFakeApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -1764,7 +1756,7 @@ func TestCompareAppStateRevisionUpdatedWithHelmSource(t *testing.T) { app := newFakeMultiSourceApp() data := fakeData{ manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", diff --git a/controller/sync_test.go b/controller/sync_test.go index 756498d785974..1dbfa2ff9e1a5 100644 --- a/controller/sync_test.go +++ b/controller/sync_test.go @@ -35,7 +35,7 @@ func TestPersistRevisionHistory(t *testing.T) { data := fakeData{ apps: []runtime.Object{app, defaultProject}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -81,7 +81,7 @@ func TestPersistManagedNamespaceMetadataState(t *testing.T) { data := fakeData{ apps: []runtime.Object{app, defaultProject}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -112,7 +112,7 @@ func TestPersistRevisionHistoryRollback(t *testing.T) { data := fakeData{ apps: []runtime.Object{app, defaultProject}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -165,7 +165,7 @@ func TestSyncComparisonError(t *testing.T) { data := fakeData{ apps: []runtime.Object{app, defaultProject}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -211,7 +211,7 @@ func TestAppStateManager_SyncAppState(t *testing.T) { data := fakeData{ apps: []runtime.Object{app, project}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", @@ -286,7 +286,7 @@ func TestSyncWindowDeniesSync(t *testing.T) { data := fakeData{ apps: []runtime.Object{app, project}, manifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{}, + Manifests: []string{}, Namespace: test.FakeDestNamespace, Server: test.FakeClusterURL, Revision: "abc123", diff --git a/event_reporter/controller/controller.go b/event_reporter/controller/controller.go index 46322180f51f2..29c733c5d4e2c 100644 --- a/event_reporter/controller/controller.go +++ b/event_reporter/controller/controller.go @@ -69,7 +69,7 @@ func (c *eventReporterController) Run(ctx context.Context) { // sendIfPermitted is a helper to send the application to the client's streaming channel if the // caller has RBAC privileges permissions to view it - sendIfPermitted := func(ctx context.Context, a appv1.Application, eventType watch.EventType, eventProcessingStartedAt string, ignoreResourceCache bool) error { + sendIfPermitted := func(ctx context.Context, a appv1.Application, eventType watch.EventType, eventProcessingStartedAt time.Time, ignoreResourceCache bool) error { if eventType == watch.Bookmark { return nil // ignore this event } @@ -80,10 +80,17 @@ func (c *eventReporterController) Run(ctx context.Context) { } trackingMethod := argoutil.GetTrackingMethod(c.settingsMgr) - err = c.applicationEventReporter.StreamApplicationEvents(ctx, &a, eventProcessingStartedAt, ignoreResourceCache, &reporter.ArgoTrackingMetadata{ + argoTrackingMetadata := &reporter.ArgoTrackingMetadata{ AppInstanceLabelKey: &appInstanceLabelKey, TrackingMethod: &trackingMethod, - }) + } + err = c.applicationEventReporter.StreamApplicationEvents( + ctx, + eventProcessingStartedAt, + &a, + argoTrackingMetadata, + ignoreResourceCache, + ) if err != nil { return err } @@ -92,6 +99,7 @@ func (c *eventReporterController) Run(ctx context.Context) { logCtx.WithError(err).Error("failed to cache last sent application event") return err } + return nil } @@ -112,7 +120,8 @@ func (c *eventReporterController) Run(ctx context.Context) { c.metricsServer.IncCachedIgnoredEventsCounter(metrics.MetricAppEventType, event.Application.Name) continue } - eventProcessingStartedAt := time.Now().Format("2006-01-02T15:04:05.000Z") + + eventProcessingStartedAt := time.Now() ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) err := sendIfPermitted(ctx, event.Application, event.Type, eventProcessingStartedAt, ignoreResourceCache) if err != nil { @@ -122,6 +131,7 @@ func (c *eventReporterController) Run(ctx context.Context) { cancel() } } + cancel() } } diff --git a/event_reporter/reporter/app_revision.go b/event_reporter/reporter/app_revision.go index b4c68f346325f..45d9acfb8d8d4 100644 --- a/event_reporter/reporter/app_revision.go +++ b/event_reporter/reporter/app_revision.go @@ -6,8 +6,6 @@ import ( "github.com/argoproj/argo-cd/v2/event_reporter/utils" "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - - log "github.com/sirupsen/logrus" ) // treats multi-sourced apps as single source and gets first revision details @@ -63,8 +61,9 @@ func (s *applicationEventReporter) getRevisionsDetails(ctx context.Context, a *v return rms, nil } -func (s *applicationEventReporter) getApplicationRevisionsMetadata(ctx context.Context, logCtx *log.Entry, a *v1alpha1.Application) (*utils.AppSyncRevisionsMetadata, error) { +func (s *applicationEventReporter) getApplicationRevisionsMetadata(ctx context.Context, a *v1alpha1.Application) (*utils.AppSyncRevisionsMetadata, error) { result := &utils.AppSyncRevisionsMetadata{} + logCtx := utils.GetLogger(ctx) if a.Status.Sync.Revision != "" || a.Status.Sync.Revisions != nil || (a.Status.History != nil && len(a.Status.History) > 0) { // can be the latest revision of repository diff --git a/event_reporter/reporter/application_errors_parser.go b/event_reporter/reporter/application_errors_parser.go index 5c52d1a5cfde8..5c23027ed9129 100644 --- a/event_reporter/reporter/application_errors_parser.go +++ b/event_reporter/reporter/application_errors_parser.go @@ -4,21 +4,20 @@ import ( "fmt" "strings" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" + "github.com/argoproj/argo-cd/v2/pkg/codefresh" "github.com/argoproj/gitops-engine/pkg/health" "github.com/argoproj/gitops-engine/pkg/sync/common" - - "github.com/argoproj/argo-cd/v2/pkg/apiclient/events" - appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -func parseApplicationSyncResultErrors(os *appv1.OperationState) []*events.ObjectError { - var errors []*events.ObjectError +func parseApplicationSyncResultErrors(os *appv1.OperationState) []*codefresh.EventError { + var errors []*codefresh.EventError // mean that resource not found as sync result but application can contain error inside operation state itself, // for example app created with invalid yaml if os.Phase == common.OperationError || os.Phase == common.OperationFailed { - errors = append(errors, &events.ObjectError{ + errors = append(errors, &codefresh.EventError{ Type: "sync", Level: "error", Message: os.Message, @@ -33,8 +32,8 @@ var ( syncTaskNotValidErrorMessage = "one or more synchronization tasks are not valid" ) -func parseApplicationSyncResultErrorsFromConditions(status appv1.ApplicationStatus) []*events.ObjectError { - var errs []*events.ObjectError +func parseApplicationSyncResultErrorsFromConditions(status appv1.ApplicationStatus) []*codefresh.EventError { + var errs []*codefresh.EventError if status.Conditions == nil { return errs } @@ -47,7 +46,7 @@ func parseApplicationSyncResultErrorsFromConditions(status appv1.ApplicationStat } if level := getConditionLevel(cnd); level != "" { - errs = append(errs, &events.ObjectError{ + errs = append(errs, &codefresh.EventError{ Type: "sync", Level: level, Message: cnd.Message, @@ -75,8 +74,8 @@ func getConditionTime(cnd appv1.ApplicationCondition) metav1.Time { return metav1.Now() } -func parseResourceSyncResultErrors(rs *appv1.ResourceStatus, os *appv1.OperationState) []*events.ObjectError { - errors := []*events.ObjectError{} +func parseResourceSyncResultErrors(rs *appv1.ResourceStatus, os *appv1.OperationState) []*codefresh.EventError { + errors := []*codefresh.EventError{} if os.SyncResult == nil { return errors } @@ -93,7 +92,7 @@ func parseResourceSyncResultErrors(rs *appv1.ResourceStatus, os *appv1.Operation return errors } - errors = append(errors, &events.ObjectError{ + errors = append(errors, &codefresh.EventError{ Type: "sync", Level: "error", Message: sr.Message, @@ -103,8 +102,8 @@ func parseResourceSyncResultErrors(rs *appv1.ResourceStatus, os *appv1.Operation return errors } -func parseAggregativeHealthErrorsOfApplication(a *appv1.Application, appTree *appv1.ApplicationTree) []*events.ObjectError { - var errors []*events.ObjectError +func parseAggregativeHealthErrorsOfApplication(a *appv1.Application, appTree *appv1.ApplicationTree) []*codefresh.EventError { + var errors []*codefresh.EventError if a.Status.Resources == nil { return errors } @@ -120,8 +119,8 @@ func parseAggregativeHealthErrorsOfApplication(a *appv1.Application, appTree *ap return errors } -func parseAggregativeHealthErrors(rs *appv1.ResourceStatus, apptree *appv1.ApplicationTree, addReference bool) []*events.ObjectError { - errs := make([]*events.ObjectError, 0) +func parseAggregativeHealthErrors(rs *appv1.ResourceStatus, apptree *appv1.ApplicationTree, addReference bool) []*codefresh.EventError { + errs := make([]*codefresh.EventError, 0) if apptree == nil { return errs @@ -149,12 +148,12 @@ func parseAggregativeHealthErrors(rs *appv1.ResourceStatus, apptree *appv1.Appli return errs } -func getNodeHealthError(node appv1.ResourceNode, managedResource *appv1.ResourceStatus, addReference bool) *events.ObjectError { +func getNodeHealthError(node appv1.ResourceNode, managedResource *appv1.ResourceStatus, addReference bool) *codefresh.EventError { if node.Health == nil || node.Health.Status != health.HealthStatusDegraded { return nil } - newErr := &events.ObjectError{ + newErr := &codefresh.EventError{ Type: "health", Level: "error", Message: node.Health.Message, @@ -162,7 +161,7 @@ func getNodeHealthError(node appv1.ResourceNode, managedResource *appv1.Resource } if addReference { - newErr.SourceReference = &events.ErrorSourceReference{ + newErr.SourceReference = &codefresh.ErrorSourceReference{ Group: managedResource.Group, Version: managedResource.Version, Kind: managedResource.Kind, @@ -173,8 +172,8 @@ func getNodeHealthError(node appv1.ResourceNode, managedResource *appv1.Resource return newErr } -func parseAggregativeResourcesSyncErrors(resourceResults appv1.ResourceResults) []*events.ObjectError { - var errs []*events.ObjectError +func parseAggregativeResourcesSyncErrors(resourceResults appv1.ResourceResults) []*codefresh.EventError { + var errs []*codefresh.EventError if resourceResults == nil { return errs @@ -182,17 +181,18 @@ func parseAggregativeResourcesSyncErrors(resourceResults appv1.ResourceResults) for _, rr := range resourceResults { if rr.Message != "" { - objectError := events.ObjectError{ + objectError := &codefresh.EventError{ Type: "sync", Level: "error", LastSeen: metav1.Now(), Message: fmt.Sprintf("Resource %s(%s): \n %s", rr.Kind, rr.Name, rr.Message), } if rr.Status == common.ResultCodeSyncFailed { - errs = append(errs, &objectError) + errs = append(errs, objectError) } + if rr.HookPhase == common.OperationFailed || rr.HookPhase == common.OperationError { - errs = append(errs, &objectError) + errs = append(errs, objectError) } } } diff --git a/event_reporter/reporter/application_event_reporter.go b/event_reporter/reporter/application_event_reporter.go index 0670f0b7602d6..94c3e8c76da08 100644 --- a/event_reporter/reporter/application_event_reporter.go +++ b/event_reporter/reporter/application_event_reporter.go @@ -9,21 +9,20 @@ import ( "strings" "time" - "github.com/argoproj/argo-cd/v2/pkg/sources_server_client" - - "github.com/argoproj/argo-cd/v2/util/db" - - "github.com/argoproj/argo-cd/v2/event_reporter/utils" - - argoutils "github.com/argoproj/argo-cd/v2/util/argo" - - "github.com/argoproj/argo-cd/v2/reposerver/apiclient" - argocommon "github.com/argoproj/argo-cd/v2/common" + appclient "github.com/argoproj/argo-cd/v2/event_reporter/application" "github.com/argoproj/argo-cd/v2/event_reporter/metrics" + metricsUtils "github.com/argoproj/argo-cd/v2/event_reporter/metrics/utils" + "github.com/argoproj/argo-cd/v2/event_reporter/utils" + "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" + appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" applisters "github.com/argoproj/argo-cd/v2/pkg/client/listers/application/v1alpha1" "github.com/argoproj/argo-cd/v2/pkg/codefresh" + "github.com/argoproj/argo-cd/v2/pkg/sources_server_client" + "github.com/argoproj/argo-cd/v2/reposerver/apiclient" servercache "github.com/argoproj/argo-cd/v2/server/cache" + argoutils "github.com/argoproj/argo-cd/v2/util/argo" + "github.com/argoproj/argo-cd/v2/util/db" "github.com/argoproj/argo-cd/v2/util/env" "github.com/argoproj/gitops-engine/pkg/health" @@ -31,37 +30,28 @@ import ( "github.com/argoproj/gitops-engine/pkg/utils/text" log "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/watch" - - appclient "github.com/argoproj/argo-cd/v2/event_reporter/application" - metricsUtils "github.com/argoproj/argo-cd/v2/event_reporter/metrics/utils" - "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" - appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" ) var resourceEventCacheExpiration = time.Minute * time.Duration(env.ParseNumFromEnv(argocommon.EnvResourceEventCacheDuration, 20, 0, math.MaxInt32)) -type applicationEventReporter struct { - cache *servercache.Cache - codefreshClient codefresh.CodefreshClientInterface - appLister applisters.ApplicationLister - applicationServiceClient appclient.ApplicationClient - metricsServer *metrics.MetricsServer - db db.ArgoDB - runtimeVersion string - useSourcesServer bool - sourcesServerClient sources_server_client.SourceServerClientInteface -} +type ( + applicationEventReporter struct { + cache *servercache.Cache + codefreshClient codefresh.CodefreshClientInterface + appLister applisters.ApplicationLister + applicationServiceClient appclient.ApplicationClient + metricsServer *metrics.MetricsServer + db db.ArgoDB + runtimeVersion string + useSourcesServer bool + sourcesServerClient sources_server_client.SourceServerClientInteface + } -type ApplicationEventReporter interface { - StreamApplicationEvents( - ctx context.Context, - a *appv1.Application, - eventProcessingStartedAt string, - ignoreResourceCache bool, - argoTrackingMetadata *ArgoTrackingMetadata, - ) error - ShouldSendApplicationEvent(ae *appv1.ApplicationWatchEvent) (shouldSend bool, syncStatusChanged bool) -} + ApplicationEventReporter interface { + StreamApplicationEvents(ctx context.Context, eventProcessingStartedAt time.Time, app *appv1.Application, argoTrackingMetadata *ArgoTrackingMetadata, ignoreResourceCache bool) error + ShouldSendApplicationEvent(ae *appv1.ApplicationWatchEvent) (shouldSend bool, syncStatusChanged bool) + } +) func NewApplicationEventReporter(cache *servercache.Cache, applicationServiceClient appclient.ApplicationClient, appLister applisters.ApplicationLister, codefreshConfig *codefresh.CodefreshConfig, metricsServer *metrics.MetricsServer, db db.ArgoDB, useSourcesServer bool, sourcesServerConfig *sources_server_client.SourcesServerConfig) ApplicationEventReporter { return &applicationEventReporter{ @@ -103,7 +93,6 @@ func (s *applicationEventReporter) shouldSendResourceEvent(a *appv1.Application, func (r *applicationEventReporter) getDesiredManifests( ctx context.Context, - logCtx *log.Entry, a *appv1.Application, revision *string, sourcePositions *[]int64, @@ -127,30 +116,31 @@ func (r *applicationEventReporter) getDesiredManifests( // if it's manifest generation error we need to still report the actual state // of the resources, but since we can't get the desired state, we will report // each resource with empty desired state - logCtx.WithError(err).Warn("failed to get application desired state manifests, reporting actual state only") - desiredManifests = &apiclient.ManifestResponse{Manifests: []*apiclient.Manifest{}} + utils.GetLogger(ctx).WithError(err).Warn("failed to get application desired state manifests, reporting actual state only") return desiredManifests, true // will ignore requiresPruning=true to not delete resources with actual state } + return desiredManifests, false } func (s *applicationEventReporter) StreamApplicationEvents( ctx context.Context, - a *appv1.Application, - eventProcessingStartedAt string, - ignoreResourceCache bool, + eventProcessingStartedAt time.Time, + app *appv1.Application, argoTrackingMetadata *ArgoTrackingMetadata, + ignoreResourceCache bool, ) error { metricTimer := metricsUtils.NewMetricTimer() - logCtx := log.WithField("app", a.Name) + logCtx := log.WithField("application", app.Name) + ctx = utils.WithLogger(ctx, logCtx.Logger) logCtx.WithField("ignoreResourceCache", ignoreResourceCache).Info("streaming application events") - project := a.Spec.GetProject() + project := app.Spec.GetProject() appTree, err := s.applicationServiceClient.ResourceTree(ctx, &application.ResourcesQuery{ - ApplicationName: &a.Name, + ApplicationName: &app.Name, Project: &project, - AppNamespace: &a.Namespace, + AppNamespace: &app.Namespace, }) if err != nil { if strings.Contains(err.Error(), "context deadline exceeded") { @@ -163,15 +153,10 @@ func (s *applicationEventReporter) StreamApplicationEvents( } logCtx.Info("getting desired manifests") - - desiredManifests, manifestGenErr := s.getDesiredManifests(ctx, logCtx, a, nil, nil, nil) - - applicationVersions := s.resolveApplicationVersions(ctx, a, logCtx) - + desiredManifests, manifestGenErr := s.getDesiredManifests(ctx, app, nil, nil, nil) + applicationVersions := s.resolveApplicationVersions(ctx, app) logCtx.Info("getting parent application name") - - parentAppIdentity := utils.GetParentAppIdentity(a, *argoTrackingMetadata.AppInstanceLabelKey, *argoTrackingMetadata.TrackingMethod) - + parentAppIdentity := utils.GetParentAppIdentity(app, *argoTrackingMetadata.AppInstanceLabelKey, *argoTrackingMetadata.TrackingMethod) if utils.IsChildApp(parentAppIdentity) { logCtx.Info("processing as child application") parentApplicationEntity, err := s.applicationServiceClient.Get(ctx, &application.ApplicationQuery{ @@ -182,75 +167,98 @@ func (s *applicationEventReporter) StreamApplicationEvents( return fmt.Errorf("failed to get parent application entity: %w", err) } - rs := utils.GetAppAsResource(a) + rs := utils.GetAppAsResource(app) utils.SetHealthStatusIfMissing(rs) - - parentDesiredManifests, manifestGenErr := s.getDesiredManifests(ctx, logCtx, parentApplicationEntity, nil, nil, nil) - - parentAppSyncRevisionsMetadata, err := s.getApplicationRevisionsMetadata(ctx, logCtx, parentApplicationEntity) + parentDesiredManifest, manifestGenErr := s.getDesiredManifests(ctx, parentApplicationEntity, nil, nil, nil) + parentAppSyncRevisionsMetadata, err := s.getApplicationRevisionsMetadata(ctx, parentApplicationEntity) if err != nil { logCtx.WithError(err).Warn("failed to get parent application's revision metadata, resuming") } validatedDestination := parentApplicationEntity.Spec.Destination.DeepCopy() _ = argoutils.ValidateDestination(ctx, validatedDestination, s.db) // resolves server field if missing - - err = s.processResource(ctx, *rs, logCtx, eventProcessingStartedAt, parentDesiredManifests, manifestGenErr, a, applicationVersions, &ReportedEntityParentApp{ + parentApp := &ReportedEntityParentApp{ app: parentApplicationEntity, appTree: appTree, revisionsMetadata: parentAppSyncRevisionsMetadata, validatedDestination: validatedDestination, - }, argoTrackingMetadata) + } + err = s.processResource( + ctx, + eventProcessingStartedAt, + *rs, + parentDesiredManifest, + manifestGenErr, + app, + applicationVersions, + parentApp, + argoTrackingMetadata, + ) if err != nil { - s.metricsServer.IncErroredEventsCounter(metrics.MetricChildAppEventType, metrics.MetricEventUnknownErrorType, a.Name) + s.metricsServer.IncErroredEventsCounter(metrics.MetricChildAppEventType, metrics.MetricEventUnknownErrorType, app.Name) return err } - s.metricsServer.ObserveEventProcessingDurationHistogramDuration(a.Name, metrics.MetricChildAppEventType, metricTimer.Duration()) + + s.metricsServer.ObserveEventProcessingDurationHistogramDuration(app.Name, metrics.MetricChildAppEventType, metricTimer.Duration()) } else { // will get here only for root applications (not managed as a resource by another application) logCtx.Info("processing as root application") - appEvent, err := s.getApplicationEventPayload(ctx, a, appTree, eventProcessingStartedAt, applicationVersions, argoTrackingMetadata, s.runtimeVersion) + appEvent, err := s.getApplicationEventPayload(ctx, eventProcessingStartedAt, app, appTree, applicationVersions) if err != nil { - s.metricsServer.IncErroredEventsCounter(metrics.MetricParentAppEventType, metrics.MetricEventGetPayloadErrorType, a.Name) + s.metricsServer.IncErroredEventsCounter(metrics.MetricParentAppEventType, metrics.MetricEventGetPayloadErrorType, app.Name) return fmt.Errorf("failed to get application event: %w", err) } + logCtx.Info("Application event sent successfully") if appEvent == nil { // event did not have an OperationState - skip all events return nil } - utils.LogWithAppStatus(a, logCtx, eventProcessingStartedAt).Info("sending root application event") - if err := s.codefreshClient.SendEvent(ctx, a.Name, appEvent); err != nil { - s.metricsServer.IncErroredEventsCounter(metrics.MetricParentAppEventType, metrics.MetricEventDeliveryErrorType, a.Name) - return fmt.Errorf("failed to send event for root application %s/%s: %w", a.Namespace, a.Name, err) + utils.LogWithAppStatus(app, logCtx, eventProcessingStartedAt).Info("sending root application event") + if err := s.codefreshClient.SendApplicationEvent(ctx, appEvent); err != nil { + s.metricsServer.IncErroredEventsCounter(metrics.MetricParentAppEventType, metrics.MetricEventDeliveryErrorType, app.Name) + return fmt.Errorf("failed to send event for root application %s/%s: %w", app.Namespace, app.Name, err) } - s.metricsServer.ObserveEventProcessingDurationHistogramDuration(a.Name, metrics.MetricParentAppEventType, metricTimer.Duration()) + + s.metricsServer.ObserveEventProcessingDurationHistogramDuration(app.Name, metrics.MetricParentAppEventType, metricTimer.Duration()) } - validatedDestination := a.Spec.Destination.DeepCopy() + validatedDestination := app.Spec.Destination.DeepCopy() _ = argoutils.ValidateDestination(ctx, validatedDestination, s.db) // resolves server field if missing - revisionsMetadata, _ := s.getApplicationRevisionsMetadata(ctx, logCtx, a) + revisionsMetadata, _ := s.getApplicationRevisionsMetadata(ctx, app) // for each resource in the application get desired and actual state, // then stream the event - for _, rs := range a.Status.Resources { + for _, rs := range app.Status.Resources { if utils.IsApp(rs) { continue } utils.SetHealthStatusIfMissing(&rs) - if !ignoreResourceCache && !s.shouldSendResourceEvent(a, rs) { - s.metricsServer.IncCachedIgnoredEventsCounter(metrics.MetricResourceEventType, a.Name) + if !ignoreResourceCache && !s.shouldSendResourceEvent(app, rs) { + s.metricsServer.IncCachedIgnoredEventsCounter(metrics.MetricResourceEventType, app.Name) continue } - err := s.processResource(ctx, rs, logCtx, eventProcessingStartedAt, desiredManifests, manifestGenErr, nil, nil, &ReportedEntityParentApp{ - app: a, + + parentApp := &ReportedEntityParentApp{ + app: app, appTree: appTree, revisionsMetadata: revisionsMetadata, validatedDestination: validatedDestination, - }, argoTrackingMetadata) + } + err := s.processResource( + ctx, + eventProcessingStartedAt, + rs, + desiredManifests, + manifestGenErr, + nil, + nil, + parentApp, + argoTrackingMetadata, + ) if err != nil { - s.metricsServer.IncErroredEventsCounter(metrics.MetricResourceEventType, metrics.MetricEventUnknownErrorType, a.Name) + s.metricsServer.IncErroredEventsCounter(metrics.MetricResourceEventType, metrics.MetricEventUnknownErrorType, app.Name) return err } } @@ -258,9 +266,9 @@ func (s *applicationEventReporter) StreamApplicationEvents( } // returns appVersion from first non-ref source for multisourced apps -func (s *applicationEventReporter) resolveApplicationVersions(ctx context.Context, a *appv1.Application, logCtx *log.Entry) *apiclient.ApplicationVersions { - if a.Spec.HasMultipleSources() { - syncResultRevisions := utils.GetOperationSyncResultRevisions(a) +func (s *applicationEventReporter) resolveApplicationVersions(ctx context.Context, app *appv1.Application) *apiclient.ApplicationVersions { + if app.Spec.HasMultipleSources() { + syncResultRevisions := utils.GetOperationSyncResultRevisions(app) if syncResultRevisions == nil { return nil } @@ -270,16 +278,17 @@ func (s *applicationEventReporter) resolveApplicationVersions(ctx context.Contex sourcePositions = append(sourcePositions, int64(i+1)) } - syncManifests, _ := s.getDesiredManifests(ctx, logCtx, a, nil, &sourcePositions, syncResultRevisions) + syncManifests, _ := s.getDesiredManifests(ctx, app, nil, &sourcePositions, syncResultRevisions) var applicationVersions *apiclient.ApplicationVersions if s.useSourcesServer { - log.Infof("cfGetAppVersion. Getting version from sourcesserver") + utils.GetLogger(ctx).Infof("cfGetAppVersion. Getting version from sourcesserver") if len(*syncResultRevisions) == 0 { return nil } - appVers := s.sourcesServerClient.GetAppVersion(a, &(*syncResultRevisions)[0]) - applicationVersions = utils.SourcesAppVersionsToRepo(appVers, logCtx) + + appVers := s.sourcesServerClient.GetAppVersion(app, &(*syncResultRevisions)[0]) + applicationVersions = utils.SourcesAppVersionsToRepo(utils.GetLogger(ctx), appVers) } else { applicationVersions = syncManifests.GetApplicationVersions() } @@ -287,19 +296,19 @@ func (s *applicationEventReporter) resolveApplicationVersions(ctx context.Contex return applicationVersions } - syncResultRevision := utils.GetOperationSyncResultRevision(a) + syncResultRevision := utils.GetOperationSyncResultRevision(app) if syncResultRevision == nil { return nil } - syncManifests, _ := s.getDesiredManifests(ctx, logCtx, a, syncResultRevision, nil, nil) + syncManifests, _ := s.getDesiredManifests(ctx, app, syncResultRevision, nil, nil) var applicationVersions *apiclient.ApplicationVersions if s.useSourcesServer { log.Infof("cfGetAppVersion. Getting version from sourcesserver") - appVers := s.sourcesServerClient.GetAppVersion(a, syncResultRevision) - applicationVersions = utils.SourcesAppVersionsToRepo(appVers, logCtx) + appVers := s.sourcesServerClient.GetAppVersion(app, syncResultRevision) + applicationVersions = utils.SourcesAppVersionsToRepo(utils.GetLogger(ctx), appVers) } else { applicationVersions = syncManifests.GetApplicationVersions() } @@ -322,7 +331,7 @@ func (s *applicationEventReporter) getAppForResourceReporting( return a, syncRevisionsMetadata } - revisionMetadataToReport, err := s.getApplicationRevisionsMetadata(ctx, logCtx, latestAppStatus) + revisionMetadataToReport, err := s.getApplicationRevisionsMetadata(ctx, latestAppStatus) if err != nil { return a, syncRevisionsMetadata } @@ -332,9 +341,8 @@ func (s *applicationEventReporter) getAppForResourceReporting( func (s *applicationEventReporter) processResource( ctx context.Context, + appEventProcessingStartedAt time.Time, rs appv1.ResourceStatus, - logCtx *log.Entry, - appEventProcessingStartedAt string, desiredManifests *apiclient.ManifestResponse, manifestGenErr bool, originalApplication *appv1.Application, // passed only if resource is app @@ -347,38 +355,36 @@ func (s *applicationEventReporter) processResource( metricsEventType = metrics.MetricChildAppEventType } - logCtx = logCtx.WithFields(log.Fields{ + logCtx := utils.GetLogger(ctx).WithFields(log.Fields{ "gvk": fmt.Sprintf("%s/%s/%s", rs.Group, rs.Version, rs.Kind), "resource": fmt.Sprintf("%s/%s", rs.Namespace, rs.Name), }) // get resource desired state - desiredState, appSourceIdx := getResourceDesiredState(&rs, desiredManifests, logCtx) - actualState, err := s.getResourceActualState(ctx, logCtx, metricsEventType, rs, reportedEntityParentApp.app, originalApplication) + desiredManifest, appSourceIdx := getResourceDesiredManifest(&rs, desiredManifests, logCtx) if err != nil { return err } + if actualState == nil { return nil } parentApplicationToReport, revisionMetadataToReport := s.getAppForResourceReporting(rs, ctx, logCtx, reportedEntityParentApp.app, reportedEntityParentApp.revisionsMetadata) - var originalAppRevisionMetadata *utils.AppSyncRevisionsMetadata = nil - if originalApplication != nil { - originalAppRevisionMetadata, _ = s.getApplicationRevisionsMetadata(ctx, logCtx, originalApplication) + originalAppRevisionMetadata, _ = s.getApplicationRevisionsMetadata(ctx, originalApplication) } - ev, err := getResourceEventPayload( + payload, err := getResourceEventPayload( appEventProcessingStartedAt, &ReportedResource{ - rs: &rs, - actualState: actualState, - desiredState: desiredState, - manifestGenErr: manifestGenErr, - appSourceIdx: appSourceIdx, + rs: &rs, + actualState: actualState, + desiredManifest: desiredManifest, + manifestGenErr: manifestGenErr, + appSourceIdx: appSourceIdx, rsAsAppInfo: &ReportedResourceAsApp{ app: originalApplication, revisionsMetadata: originalAppRevisionMetadata, @@ -393,7 +399,6 @@ func (s *applicationEventReporter) processResource( desiredManifests: reportedEntityParentApp.desiredManifests, }, argoTrackingMetadata, - s.runtimeVersion, ) if err != nil { s.metricsServer.IncErroredEventsCounter(metricsEventType, metrics.MetricEventGetPayloadErrorType, reportedEntityParentApp.app.Name) @@ -411,7 +416,7 @@ func (s *applicationEventReporter) processResource( appName = reportedEntityParentApp.app.Name } - if err := s.codefreshClient.SendEvent(ctx, appName, ev); err != nil { + if err := s.codefreshClient.SendResourceEvent(ctx, payload); err != nil { if strings.Contains(err.Error(), "context deadline exceeded") { return fmt.Errorf("failed to send resource event: %w", err) } @@ -552,12 +557,13 @@ func applicationMetadataChanged(ae *appv1.ApplicationWatchEvent, cachedApp *appv return !reflect.DeepEqual(newEventAppMeta, cachedAppMeta) } -func getResourceDesiredState(rs *appv1.ResourceStatus, ds *apiclient.ManifestResponse, logger *log.Entry) (manifest *apiclient.Manifest, sourceIdx int32) { +func getResourceDesiredManifest(rs *appv1.ResourceStatus, ds *apiclient.ManifestResponse, logger *log.Entry) (manifest string, sourceIdx int32) { if ds == nil { - return &apiclient.Manifest{}, 0 + return "", 0 } + for idx, m := range ds.Manifests { - u, err := appv1.UnmarshalToUnstructured(m.CompiledManifest) + u, err := appv1.UnmarshalToUnstructured(m) if err != nil { logger.WithError(err).Warnf("failed to unmarshal compiled manifest") continue @@ -573,7 +579,7 @@ func getResourceDesiredState(rs *appv1.ResourceStatus, ds *apiclient.ManifestRes u.GetName() == rs.Name && ns == rs.Namespace { if rs.Kind == kube.SecretKind && rs.Version == "v1" { - m.RawManifest = m.CompiledManifest + m = "" } return m, getResourceSourceIdxFromManifestResponse(idx, ds) @@ -582,7 +588,7 @@ func getResourceDesiredState(rs *appv1.ResourceStatus, ds *apiclient.ManifestRes // no desired state for resource // it's probably deleted from git - return &apiclient.Manifest{}, 0 + return "", 0 } func getResourceSourceIdxFromManifestResponse(rsIdx int, ds *apiclient.ManifestResponse) int32 { diff --git a/event_reporter/reporter/application_event_reporter_test.go b/event_reporter/reporter/application_event_reporter_test.go index b3fc5a6cdb868..53ede8836c1a7 100644 --- a/event_reporter/reporter/application_event_reporter_test.go +++ b/event_reporter/reporter/application_event_reporter_test.go @@ -4,56 +4,60 @@ import ( "context" "encoding/json" "fmt" - "net/http" "testing" "time" - "github.com/argoproj/argo-cd/v2/util/db" - "github.com/argoproj/argo-cd/v2/util/settings" - - "k8s.io/client-go/kubernetes/fake" - - "github.com/aws/smithy-go/ptr" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/watch" - - "google.golang.org/grpc" - "k8s.io/apimachinery/pkg/runtime" - appclient "github.com/argoproj/argo-cd/v2/event_reporter/application" appMocks "github.com/argoproj/argo-cd/v2/event_reporter/application/mocks" + "github.com/argoproj/argo-cd/v2/event_reporter/metrics" "github.com/argoproj/argo-cd/v2/pkg/apiclient" + "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" apiclientapppkg "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" appv1reg "github.com/argoproj/argo-cd/v2/pkg/apis/application" - repoapiclient "github.com/argoproj/argo-cd/v2/reposerver/apiclient" - "github.com/argoproj/argo-cd/v2/util/io" - - "github.com/argoproj/argo-cd/v2/event_reporter/metrics" - + "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" appsv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" fakeapps "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned/fake" appinformer "github.com/argoproj/argo-cd/v2/pkg/client/informers/externalversions" applisters "github.com/argoproj/argo-cd/v2/pkg/client/listers/application/v1alpha1" - + "github.com/argoproj/argo-cd/v2/pkg/codefresh" + repoapiclient "github.com/argoproj/argo-cd/v2/reposerver/apiclient" servercache "github.com/argoproj/argo-cd/v2/server/cache" cacheutil "github.com/argoproj/argo-cd/v2/util/cache" appstatecache "github.com/argoproj/argo-cd/v2/util/cache/appstate" + "github.com/argoproj/argo-cd/v2/util/db" + "github.com/argoproj/argo-cd/v2/util/io" + "github.com/argoproj/argo-cd/v2/util/settings" + "github.com/aws/smithy-go/ptr" + "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "google.golang.org/grpc" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" - "github.com/argoproj/argo-cd/v2/pkg/apiclient/events" - "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - "github.com/argoproj/argo-cd/v2/pkg/codefresh" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/kubernetes/fake" ) const ( testNamespace = "default" ) +type MockCodefreshClient struct{} + +func (cc *MockCodefreshClient) SendApplicationEvent(ctx context.Context, payload *codefresh.ApplicationPayload) error { + return nil +} + +func (cc *MockCodefreshClient) SendResourceEvent(ctx context.Context, payload *codefresh.ResourcePayload) error { + return nil +} + +func (cc *MockCodefreshClient) SendGraphQL(query codefresh.GraphQLQuery) (*json.RawMessage, error) { + return nil, nil +} + func newAppLister(objects ...runtime.Object) applisters.ApplicationLister { fakeAppsClientset := fakeapps.NewSimpleClientset(objects...) factory := appinformer.NewSharedInformerFactoryWithOptions(fakeAppsClientset, 0, appinformer.WithNamespace(""), appinformer.WithTweakListOptions(func(options *metav1.ListOptions) {})) @@ -68,28 +72,6 @@ func newAppLister(objects ...runtime.Object) applisters.ApplicationLister { return appLister } -type MockcodefreshClient interface { - Send(ctx context.Context, appName string, event *events.Event) error -} - -type MockCodefreshConfig struct { - BaseURL string - AuthToken string -} - -type MockCodefreshClient struct { - cfConfig *MockCodefreshConfig - httpClient *http.Client -} - -func (cc *MockCodefreshClient) SendEvent(ctx context.Context, appName string, event *events.Event) error { - return nil -} - -func (cc *MockCodefreshClient) SendGraphQL(query codefresh.GraphQLQuery) (*json.RawMessage, error) { - return nil, nil -} - func fakeAppServiceClient() apiclientapppkg.ApplicationServiceClient { closer, applicationServiceClient, _ := apiclient.NewClientOrDie(&apiclient.ClientOptions{ ServerAddr: "site.com", @@ -153,18 +135,8 @@ func fakeReporter(customAppServiceClient appclient.ApplicationClient) *applicati 1*time.Minute, ) - cfClient := &MockCodefreshClient{ - cfConfig: &MockCodefreshConfig{ - BaseURL: "", - AuthToken: "", - }, - httpClient: &http.Client{ - Timeout: 30 * time.Second, - }, - } - + cfClient := &MockCodefreshClient{} metricsServ := metrics.NewMetricsServer("", 8099) - return &applicationEventReporter{ cache, cfClient, @@ -215,11 +187,7 @@ type MockEventing_StartEventSourceServer struct { grpc.ServerStream } -var result func(*events.Event) error - -func (m *MockEventing_StartEventSourceServer) Send(event *events.Event) error { - return result(event) -} +var result func(*codefresh.ApplicationPayload) error func TestStreamApplicationEvent(t *testing.T) { eventReporter := fakeReporter(fakeAppServiceClient()) @@ -231,16 +199,19 @@ func TestStreamApplicationEvent(t *testing.T) { }, } - result = func(event *events.Event) error { - var payload events.EventPayload - _ = json.Unmarshal(event.Payload, &payload) - + result = func(payload *codefresh.ApplicationPayload) error { var actualApp v1alpha1.Application - _ = json.Unmarshal([]byte(payload.Source.ActualManifest), &actualApp) + _ = json.Unmarshal([]byte(payload.ActualManifest), &actualApp) assert.Equal(t, *app, actualApp) return nil } - _ = eventReporter.StreamApplicationEvents(context.Background(), app, "", false, getMockedArgoTrackingMetadata()) + _ = eventReporter.StreamApplicationEvents( + context.Background(), + time.Now(), + app, + getMockedArgoTrackingMetadata(), + false, + ) }) } diff --git a/event_reporter/reporter/applications_errors_parser_test.go b/event_reporter/reporter/applications_errors_parser_test.go index 60a820f0fba05..be613dee975f9 100644 --- a/event_reporter/reporter/applications_errors_parser_test.go +++ b/event_reporter/reporter/applications_errors_parser_test.go @@ -5,13 +5,12 @@ import ( "testing" "time" - "github.com/argoproj/gitops-engine/pkg/health" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" + "github.com/argoproj/gitops-engine/pkg/health" "github.com/argoproj/gitops-engine/pkg/sync/common" "github.com/stretchr/testify/assert" - - "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestParseResourceSyncResultErrors(t *testing.T) { diff --git a/event_reporter/reporter/broadcaster.go b/event_reporter/reporter/broadcaster.go index fd46e1027ac42..f22a7750ee882 100644 --- a/event_reporter/reporter/broadcaster.go +++ b/event_reporter/reporter/broadcaster.go @@ -4,14 +4,14 @@ import ( "math" "sync" - log "github.com/sirupsen/logrus" - "k8s.io/apimachinery/pkg/watch" - argocommon "github.com/argoproj/argo-cd/v2/common" "github.com/argoproj/argo-cd/v2/event_reporter/metrics" "github.com/argoproj/argo-cd/v2/event_reporter/sharding" appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" "github.com/argoproj/argo-cd/v2/util/env" + + log "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/watch" ) type subscriber struct { diff --git a/event_reporter/reporter/event_payload.go b/event_reporter/reporter/event_payload.go index 24d7cbd465011..a1571a2970e83 100644 --- a/event_reporter/reporter/event_payload.go +++ b/event_reporter/reporter/event_payload.go @@ -2,89 +2,45 @@ package reporter import ( "context" - "encoding/json" "fmt" "strings" + "time" "github.com/argoproj/argo-cd/v2/event_reporter/utils" - "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" - "github.com/argoproj/argo-cd/v2/pkg/apiclient/events" appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" + "github.com/argoproj/argo-cd/v2/pkg/codefresh" "github.com/argoproj/argo-cd/v2/reposerver/apiclient" "github.com/argoproj/gitops-engine/pkg/health" log "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "sigs.k8s.io/yaml" ) func getResourceEventPayload( - appEventProcessingStartedAt string, + eventProcessingStartedAt time.Time, rr *ReportedResource, - reportedEntityParentApp *ReportedEntityParentApp, + parentApp *ReportedEntityParentApp, argoTrackingMetadata *ArgoTrackingMetadata, - runtimeVersion string, -) (*events.Event, error) { +) (*codefresh.ResourcePayload, error) { var ( - err error - syncStarted = metav1.Now() - syncFinished *metav1.Time - logCtx *log.Entry + syncStarted = metav1.Now() + syncFinished *metav1.Time + revisionsMetadata *utils.AppSyncRevisionsMetadata ) - if rr.rsAsAppInfo != nil && rr.rsAsAppInfo.app != nil { - logCtx = log.WithField("application", rr.rsAsAppInfo.app.Name) - } else { - logCtx = log.NewEntry(log.StandardLogger()) - } - - object := []byte(*rr.actualState.Manifest) - - if rr.rsAsAppInfo != nil && rr.rsAsAppInfo.revisionsMetadata != nil && len(object) != 0 { - actualObject, err := appv1.UnmarshalToUnstructured(*rr.actualState.Manifest) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal manifest: %w", err) - } - - object, err = addCommitDetailsToUnstructured(actualObject, rr) - if err != nil { - return nil, err - } - } - if len(object) == 0 { - if len(rr.desiredState.CompiledManifest) == 0 { - object, err = buildEventObjectAsLiveAndCompiledManifestsEmpty(rr) - if err != nil { - return nil, err - } - } else { - object, err = useCompiledManifestAsEventObject(rr) - if err != nil { - return nil, err - } - } - } else if rr.rs.RequiresPruning && !rr.manifestGenErr { - // resource should be deleted - makeDesiredAndLiveManifestEmpty(rr.actualState, rr.desiredState) + if rr.rsAsAppInfo != nil { + revisionsMetadata = rr.rsAsAppInfo.revisionsMetadata } - if (rr.rsAsAppInfo != nil && rr.rsAsAppInfo.app != nil && rr.rsAsAppInfo.app.DeletionTimestamp != nil) || reportedEntityParentApp.app.ObjectMeta.DeletionTimestamp != nil { + if (rr.rsAsAppInfo != nil && rr.rsAsAppInfo.app != nil && rr.rsAsAppInfo.app.DeletionTimestamp != nil) || parentApp.app.ObjectMeta.DeletionTimestamp != nil { // resource should be deleted in case if application in process of deletion - makeDesiredAndLiveManifestEmpty(rr.actualState, rr.desiredState) - } - - if len(rr.desiredState.RawManifest) == 0 && len(rr.desiredState.CompiledManifest) != 0 { - // for handling helm defined resources, etc... - y, err := yaml.JSONToYAML([]byte(rr.desiredState.CompiledManifest)) - if err == nil { - rr.desiredState.RawManifest = string(y) - } + rr.actualState.Manifest = nil + rr.desiredManifest = "" } - if reportedEntityParentApp.app.Status.OperationState != nil { - syncStarted = reportedEntityParentApp.app.Status.OperationState.StartedAt - syncFinished = reportedEntityParentApp.app.Status.OperationState.FinishedAt + if parentApp.app.Status.OperationState != nil { + syncStarted = parentApp.app.Status.OperationState.StartedAt + syncFinished = parentApp.app.Status.OperationState.FinishedAt } // for primitive resources that are synced right away and don't require progression time (like configmap) @@ -92,120 +48,89 @@ func getResourceEventPayload( syncFinished = &syncStarted } - var applicationVersionsEvents *events.ApplicationVersions - if rr.rsAsAppInfo != nil { - applicationVersionsEvents, err = utils.RepoAppVersionsToEvent(rr.rsAsAppInfo.applicationVersions) - if err != nil { - logCtx.Errorf("failed to convert appVersions: %v", err) - } - } - - source := events.ObjectSource{ - DesiredManifest: rr.desiredState.CompiledManifest, - ActualManifest: *rr.actualState.Manifest, - GitManifest: rr.desiredState.RawManifest, - Path: rr.desiredState.Path, - Revision: utils.GetApplicationLatestRevision(reportedEntityParentApp.app), - Revisions: utils.GetApplicationLatestRevisions(reportedEntityParentApp.app), - OperationSyncRevision: utils.GetOperationRevision(reportedEntityParentApp.app), - OperationSyncRevisions: utils.GetOperationRevisions(reportedEntityParentApp.app), - HistoryId: utils.GetLatestAppHistoryId(reportedEntityParentApp.app), - AppName: reportedEntityParentApp.app.Name, - AppNamespace: reportedEntityParentApp.app.Namespace, - AppUID: string(reportedEntityParentApp.app.ObjectMeta.UID), - AppLabels: reportedEntityParentApp.app.Labels, - SyncStatus: string(rr.rs.Status), + repoURL, targetRevision := getResourceSourceRepoData(rr, parentApp) + source := &codefresh.Source{ + RepoURL: repoURL, + TargetRevision: targetRevision, + Revisions: utils.GetApplicationLatestRevisions(parentApp.app), + OperationSyncRevisions: utils.GetOperationRevisions(parentApp.app), + ClusterServer: parentApp.app.Spec.Destination.Server, + AppName: parentApp.app.Name, + AppNamespace: parentApp.app.Namespace, + AppUID: parentApp.app.ObjectMeta.UID, + AppLabels: parentApp.app.Labels, + SyncStatus: rr.rs.Status, SyncStartedAt: syncStarted, SyncFinishedAt: syncFinished, - Cluster: reportedEntityParentApp.app.Spec.Destination.Server, + HistoryId: utils.GetLatestAppHistoryId(parentApp.app), AppInstanceLabelKey: *argoTrackingMetadata.AppInstanceLabelKey, - TrackingMethod: string(*argoTrackingMetadata.TrackingMethod), - AppMultiSourced: reportedEntityParentApp.app.Spec.HasMultipleSources(), + TrackingMethod: *argoTrackingMetadata.TrackingMethod, + AppMultiSourced: parentApp.app.Spec.HasMultipleSources(), AppSourceIdx: rr.appSourceIdx, } - source.RepoURL = getResourceSourceRepoUrl(rr, reportedEntityParentApp) - addResourceEventPayloadGitCommitDetails(&source, rr, reportedEntityParentApp) + if parentApp.revisionsMetadata != nil && parentApp.revisionsMetadata.SyncRevisions != nil && rr.appSourceIdx != -1 { + syncRevisionWithMetadata := parentApp.revisionsMetadata.GetSyncRevisionAt(int(rr.appSourceIdx)) - if reportedEntityParentApp.validatedDestination != nil { - source.ClusterName = &reportedEntityParentApp.validatedDestination.Name - } - - if rr.rs.Health != nil { - source.HealthStatus = (*string)(&rr.rs.Health.Status) - source.HealthMessage = &rr.rs.Health.Message + if syncRevisionWithMetadata != nil && syncRevisionWithMetadata.Metadata != nil { + source.CommitMessage = syncRevisionWithMetadata.Metadata.Message + source.CommitAuthor = syncRevisionWithMetadata.Metadata.Author + source.CommitDate = &syncRevisionWithMetadata.Metadata.Date + } } - payload := events.EventPayload{ - Timestamp: appEventProcessingStartedAt, - Object: object, - Source: &source, - Errors: getResourceEventPayloadErrors(rr, reportedEntityParentApp), - AppVersions: applicationVersionsEvents, - RuntimeVersion: runtimeVersion, + if parentApp.validatedDestination != nil { + source.ClusterName = &parentApp.validatedDestination.Name } - if payload.AppVersions != nil { - logCtx.Infof("AppVersion before encoding: %v", utils.SafeString(payload.AppVersions.AppVersion)) + if rr.rs.Health != nil { + source.HealthStatus = rr.rs.Health } - payloadBytes, err := json.Marshal(&payload) - if err != nil { - return nil, fmt.Errorf("failed to marshal payload for resource %s/%s: %w", rr.rs.Namespace, rr.rs.Name, err) + payload := &codefresh.ResourcePayload{ + Timestamp: metav1.NewTime(eventProcessingStartedAt), + ActualManifest: rr.actualState.GetManifest(), + DesiredManifest: rr.desiredManifest, + Source: source, + AppVersions: rr.rsAsAppInfo.applicationVersions, + RevisionsMetadata: revisionsMetadata, + Errors: getResourceEventPayloadErrors(rr, parentApp), } - return &events.Event{Payload: payloadBytes}, nil + return payload, nil } -func getResourceSourceRepoUrl( - rr *ReportedResource, - reportedEntityParentApp *ReportedEntityParentApp, -) string { - specCopy := reportedEntityParentApp.app.Spec.DeepCopy() +func getResourceSourceRepoData(rr *ReportedResource, parentApp *ReportedEntityParentApp) (repoURL string, targetRevision string) { + repoURL = "" + targetRevision = "" + specCopy := parentApp.app.Spec.DeepCopy() - specCopy.Sources = reportedEntityParentApp.app.Status.Sync.ComparedTo.Sources - specCopy.Source = reportedEntityParentApp.app.Status.Sync.ComparedTo.Source.DeepCopy() + specCopy.Sources = parentApp.app.Status.Sync.ComparedTo.Sources + specCopy.Source = parentApp.app.Status.Sync.ComparedTo.Source.DeepCopy() if specCopy.HasMultipleSources() { if !rr.appSourceIdxDetected() { - return "" + return } + source := specCopy.GetSourcePtrByIndex(int(rr.appSourceIdx)) - if source == nil { - return "" + if source != nil { + repoURL = source.RepoURL + targetRevision = source.TargetRevision } - return source.RepoURL - } - - return specCopy.Source.RepoURL -} - -func addResourceEventPayloadGitCommitDetails( - source *events.ObjectSource, - rr *ReportedResource, - reportedEntityParentApp *ReportedEntityParentApp, -) { - if reportedEntityParentApp.revisionsMetadata == nil || reportedEntityParentApp.revisionsMetadata.SyncRevisions == nil || rr.appSourceIdx == -1 { - return + } else { + repoURL = specCopy.Source.RepoURL + targetRevision = specCopy.Source.TargetRevision } - syncRevisionWithMetadata := reportedEntityParentApp.revisionsMetadata.GetSyncRevisionAt(int(rr.appSourceIdx)) - - if syncRevisionWithMetadata != nil && syncRevisionWithMetadata.Metadata != nil { - source.CommitMessage = syncRevisionWithMetadata.Metadata.Message - source.CommitAuthor = syncRevisionWithMetadata.Metadata.Author - source.CommitDate = &syncRevisionWithMetadata.Metadata.Date - } + return } -func getResourceEventPayloadErrors( - rr *ReportedResource, - reportedEntityParentApp *ReportedEntityParentApp, -) []*events.ObjectError { - var errors []*events.ObjectError +func getResourceEventPayloadErrors(rr *ReportedResource, parentApp *ReportedEntityParentApp) []*codefresh.EventError { + var errors []*codefresh.EventError - if reportedEntityParentApp.app.Status.OperationState != nil { - errors = append(errors, parseResourceSyncResultErrors(rr.rs, reportedEntityParentApp.app.Status.OperationState)...) + if parentApp.app.Status.OperationState != nil { + errors = append(errors, parseResourceSyncResultErrors(rr.rs, parentApp.app.Status.OperationState)...) } // parent application not include errors in application originally was created with broken state, for example in destination missed namespace @@ -218,100 +143,26 @@ func getResourceEventPayloadErrors( errors = append(errors, parseApplicationSyncResultErrorsFromConditions(rr.rsAsAppInfo.app.Status)...) } - errors = append(errors, parseAggregativeHealthErrorsOfApplication(rr.rsAsAppInfo.app, reportedEntityParentApp.appTree)...) + errors = append(errors, parseAggregativeHealthErrorsOfApplication(rr.rsAsAppInfo.app, parentApp.appTree)...) } if rr.rs.Health != nil && rr.rs.Health.Status != health.HealthStatusHealthy { - errors = append(errors, parseAggregativeHealthErrors(rr.rs, reportedEntityParentApp.appTree, false)...) + errors = append(errors, parseAggregativeHealthErrors(rr.rs, parentApp.appTree, false)...) } return errors } -func useCompiledManifestAsEventObject( - rr *ReportedResource, -) ([]byte, error) { - // no actual state, use desired state as event object - unstructuredWithNamespace, err := utils.AddDestNamespaceToManifest([]byte(rr.desiredState.CompiledManifest), rr.rs) - if err != nil { - return nil, fmt.Errorf("failed to add destination namespace to manifest: %w", err) - } - - return addCommitDetailsToUnstructured(unstructuredWithNamespace, rr) -} - -func buildEventObjectAsLiveAndCompiledManifestsEmpty( - rr *ReportedResource, -) ([]byte, error) { - // no actual or desired state, don't send event - u := &unstructured.Unstructured{} - - u.SetAPIVersion(rr.GetApiVersion()) - u.SetKind(rr.rs.Kind) - u.SetName(rr.rs.Name) - u.SetNamespace(rr.rs.Namespace) - - return addCommitDetailsToUnstructured(u, rr) -} - -// when empty minifests reported to codefresh they will get deleted -func makeDesiredAndLiveManifestEmpty( - actualState *application.ApplicationResourceResponse, - desiredState *apiclient.Manifest, -) { - // resource should be deleted - desiredState.CompiledManifest = "" - manifest := "" - actualState.Manifest = &manifest -} - -func addCommitDetailsToUnstructured( - u *unstructured.Unstructured, - rr *ReportedResource, -) ([]byte, error) { - if rr.rsAsAppInfo != nil && rr.rsAsAppInfo.revisionsMetadata != nil { - u = utils.AddCommitsDetailsToAnnotations(u, rr.rsAsAppInfo.revisionsMetadata) - if rr.rsAsAppInfo.app != nil { - u = utils.AddCommitDetailsToLabels(u, getApplicationLegacyRevisionDetails(rr.rsAsAppInfo.app, rr.rsAsAppInfo.revisionsMetadata)) - } - } - - object, err := u.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("failed to marshal unstructured object: %w", err) - } - - return object, err -} - func (s *applicationEventReporter) getApplicationEventPayload( ctx context.Context, - a *appv1.Application, + eventProcessingStartedAt time.Time, + app *appv1.Application, appTree *appv1.ApplicationTree, - eventProcessingStartedAt string, applicationVersions *apiclient.ApplicationVersions, - argoTrackingMetadata *ArgoTrackingMetadata, - runtimeVersion string, -) (*events.Event, error) { - var ( - syncStarted = metav1.Now() - syncFinished *metav1.Time - logCtx = log.WithField("application", a.Name) - errors = []*events.ObjectError{} - ) - - obj := appv1.Application{} - a.DeepCopyInto(&obj) - - // make sure there is type meta on object - obj.SetDefaultTypeMeta() - - if a.Status.OperationState != nil { - syncStarted = a.Status.OperationState.StartedAt - syncFinished = a.Status.OperationState.FinishedAt - } +) (*codefresh.ApplicationPayload, error) { + logCtx := log.WithField("application", app.Name) - revisionsMetadata, err := s.getApplicationRevisionsMetadata(ctx, logCtx, a) + revisionsMetadata, err := s.getApplicationRevisionsMetadata(ctx, app) if err != nil { if !strings.Contains(err.Error(), "not found") { return nil, fmt.Errorf("failed to get revision metadata: %w", err) @@ -320,68 +171,31 @@ func (s *applicationEventReporter) getApplicationEventPayload( logCtx.Warnf("failed to get revision metadata: %s, reporting application deletion event", err.Error()) } - utils.AddCommitsDetailsToAppAnnotations(obj, revisionsMetadata) - utils.AddCommitsDetailsToAppLabels(&obj, getApplicationLegacyRevisionDetails(&obj, revisionsMetadata)) - - object, err := json.Marshal(&obj) - if err != nil { - return nil, fmt.Errorf("failed to marshal application event") - } - - actualManifest := string(object) - if a.DeletionTimestamp != nil { - actualManifest = "" // mark as deleted + var actualManifest string + if app.DeletionTimestamp != nil { + // mark as deleted + actualManifest = "" logCtx.Info("reporting application deletion event") - } - - applicationVersionsEvents, err := utils.RepoAppVersionsToEvent(applicationVersions) - if err != nil { - logCtx.Errorf("failed to convert appVersions: %v", err) - } - - hs := string(a.Status.Health.Status) - source := &events.ObjectSource{ - DesiredManifest: "", - GitManifest: "", - ActualManifest: actualManifest, - RepoURL: a.Spec.GetSource().RepoURL, - CommitMessage: "", - CommitAuthor: "", - Path: "", - Revision: "", - OperationSyncRevision: "", - HistoryId: 0, - AppName: "", - AppUID: "", - AppLabels: map[string]string{}, - SyncStatus: string(a.Status.Sync.Status), - SyncStartedAt: syncStarted, - SyncFinishedAt: syncFinished, - HealthStatus: &hs, - HealthMessage: &a.Status.Health.Message, - Cluster: a.Spec.Destination.Server, - AppInstanceLabelKey: *argoTrackingMetadata.AppInstanceLabelKey, - TrackingMethod: string(*argoTrackingMetadata.TrackingMethod), - } - - errors = append(errors, parseApplicationSyncResultErrorsFromConditions(a.Status)...) - errors = append(errors, parseAggregativeHealthErrorsOfApplication(a, appTree)...) + } else { + data, err := app.Marshal() + if err != nil { + return nil, fmt.Errorf("failed to marshal application event: %w", err) + } - payload := events.EventPayload{ - Timestamp: eventProcessingStartedAt, - Object: object, - Source: source, - Errors: errors, - AppVersions: applicationVersionsEvents, - RuntimeVersion: runtimeVersion, + actualManifest = string(data) } - logCtx.Infof("AppVersion before encoding: %v", utils.SafeString(payload.AppVersions.AppVersion)) + errors := []*codefresh.EventError{} + errors = append(errors, parseApplicationSyncResultErrorsFromConditions(app.Status)...) + errors = append(errors, parseAggregativeHealthErrorsOfApplication(app, appTree)...) - payloadBytes, err := json.Marshal(&payload) - if err != nil { - return nil, fmt.Errorf("failed to marshal payload for resource %s/%s: %w", a.Namespace, a.Name, err) + payload := &codefresh.ApplicationPayload{ + Timestamp: metav1.NewTime(eventProcessingStartedAt), + ActualManifest: actualManifest, + RevisionsMetadata: revisionsMetadata, + AppVersions: applicationVersions, + Errors: errors, } - return &events.Event{Payload: payloadBytes}, nil + return payload, nil } diff --git a/event_reporter/reporter/event_payload_test.go b/event_reporter/reporter/event_payload_test.go index 87e22e7a2cb36..dbd89d709e537 100644 --- a/event_reporter/reporter/event_payload_test.go +++ b/event_reporter/reporter/event_payload_test.go @@ -1,21 +1,18 @@ package reporter import ( - "encoding/json" "testing" + "time" + "github.com/argoproj/argo-cd/v2/common" "github.com/argoproj/argo-cd/v2/event_reporter/utils" + "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" + "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" + "github.com/argoproj/argo-cd/v2/util/argo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/argoproj/argo-cd/v2/common" - "github.com/argoproj/argo-cd/v2/pkg/apiclient/application" - "github.com/argoproj/argo-cd/v2/pkg/apiclient/events" - "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - repoApiclient "github.com/argoproj/argo-cd/v2/reposerver/apiclient" - "github.com/argoproj/argo-cd/v2/util/argo" ) func getMockedArgoTrackingMetadata() *ArgoTrackingMetadata { @@ -38,15 +35,11 @@ func TestGetResourceEventPayload(t *testing.T) { }, } rs := v1alpha1.ResourceStatus{} - man := "{ \"key\" : \"manifest\" }" - actualState := application.ApplicationResourceResponse{ Manifest: &man, } - desiredState := repoApiclient.Manifest{ - CompiledManifest: "{ \"key\" : \"manifest\" }", - } + desiredState := "{ \"key\" : \"manifest\" }" appTree := v1alpha1.ApplicationTree{} revisionMetadata := utils.AppSyncRevisionsMetadata{ SyncRevisions: []*utils.RevisionWithMetadata{{ @@ -58,26 +51,26 @@ func TestGetResourceEventPayload(t *testing.T) { }}, } - event, err := getResourceEventPayload("", &ReportedResource{ - rs: &rs, - actualState: &actualState, - desiredState: &desiredState, - manifestGenErr: true, - rsAsAppInfo: nil, - }, &ReportedEntityParentApp{ - app: &app, - appTree: &appTree, - revisionsMetadata: &revisionMetadata, - }, getMockedArgoTrackingMetadata(), "0.0.1") - require.NoError(t, err) - - var eventPayload events.EventPayload - - err = json.Unmarshal(event.Payload, &eventPayload) + payload, err := getResourceEventPayload( + time.Now(), + &ReportedResource{ + rs: &rs, + actualState: &actualState, + desiredManifest: desiredState, + manifestGenErr: true, + rsAsAppInfo: nil, + }, + &ReportedEntityParentApp{ + app: &app, + appTree: &appTree, + revisionsMetadata: &revisionMetadata, + }, + getMockedArgoTrackingMetadata(), + ) require.NoError(t, err) - assert.Equal(t, "{ \"key\" : \"manifest\" }", eventPayload.Source.DesiredManifest) - assert.Equal(t, "{ \"key\" : \"manifest\" }", eventPayload.Source.ActualManifest) + assert.Equal(t, "{ \"key\" : \"manifest\" }", payload.DesiredManifest) + assert.Equal(t, "{ \"key\" : \"manifest\" }", payload.ActualManifest) }) t.Run("Deleting timestamp not empty", func(t *testing.T) { @@ -92,60 +85,59 @@ func TestGetResourceEventPayload(t *testing.T) { actualState := application.ApplicationResourceResponse{ Manifest: &man, } - desiredState := repoApiclient.Manifest{ - CompiledManifest: "{ \"key\" : \"manifest\" }", - } + desiredState := "{ \"key\" : \"manifest\" }" appTree := v1alpha1.ApplicationTree{} revisionMetadata := utils.AppSyncRevisionsMetadata{ SyncRevisions: []*utils.RevisionWithMetadata{}, } - event, err := getResourceEventPayload("", &ReportedResource{ - rs: &rs, - actualState: &actualState, - desiredState: &desiredState, - manifestGenErr: true, - rsAsAppInfo: nil, - }, &ReportedEntityParentApp{ - app: &app, - appTree: &appTree, - revisionsMetadata: &revisionMetadata, - }, getMockedArgoTrackingMetadata(), "0.0.1") - require.NoError(t, err) - - var eventPayload events.EventPayload - - err = json.Unmarshal(event.Payload, &eventPayload) + payload, err := getResourceEventPayload( + time.Now(), + &ReportedResource{ + rs: &rs, + actualState: &actualState, + desiredManifest: desiredState, + manifestGenErr: true, + rsAsAppInfo: nil, + }, + &ReportedEntityParentApp{ + app: &app, + appTree: &appTree, + revisionsMetadata: &revisionMetadata, + }, + getMockedArgoTrackingMetadata(), + ) require.NoError(t, err) - assert.Equal(t, "", eventPayload.Source.DesiredManifest) - assert.Equal(t, "", eventPayload.Source.ActualManifest) + assert.Equal(t, "", payload.DesiredManifest) + assert.Equal(t, "", payload.ActualManifest) }) } func TestGetResourceEventPayloadWithoutRevision(t *testing.T) { app := v1alpha1.Application{} rs := v1alpha1.ResourceStatus{} - mf := "{ \"key\" : \"manifest\" }" - actualState := application.ApplicationResourceResponse{ Manifest: &mf, } - desiredState := repoApiclient.Manifest{ - CompiledManifest: "{ \"key\" : \"manifest\" }", - } + desiredState := "{ \"key\" : \"manifest\" }" appTree := v1alpha1.ApplicationTree{} - _, err := getResourceEventPayload("", &ReportedResource{ - rs: &rs, - actualState: &actualState, - desiredState: &desiredState, - manifestGenErr: true, - rsAsAppInfo: nil, - }, &ReportedEntityParentApp{ - app: &app, - appTree: &appTree, - }, getMockedArgoTrackingMetadata(), "0.0.1") + _, err := getResourceEventPayload( + time.Now(), + &ReportedResource{ + rs: &rs, + actualState: &actualState, + desiredManifest: desiredState, + manifestGenErr: true, + rsAsAppInfo: nil, + }, + &ReportedEntityParentApp{ + app: &app, + appTree: &appTree, + }, + getMockedArgoTrackingMetadata(), + ) assert.NoError(t, err) } diff --git a/event_reporter/reporter/types.go b/event_reporter/reporter/types.go index 810f26253ec1a..58331a7bfc850 100644 --- a/event_reporter/reporter/types.go +++ b/event_reporter/reporter/types.go @@ -8,12 +8,12 @@ import ( ) type ReportedResource struct { - rs *appv1.ResourceStatus - rsAsAppInfo *ReportedResourceAsApp // passed if resource is application - appSourceIdx int32 - actualState *application.ApplicationResourceResponse - desiredState *apiclient.Manifest - manifestGenErr bool + rs *appv1.ResourceStatus + rsAsAppInfo *ReportedResourceAsApp // passed if resource is application + appSourceIdx int32 + actualState *application.ApplicationResourceResponse + desiredManifest string + manifestGenErr bool } type ReportedResourceAsApp struct { diff --git a/event_reporter/utils/app_version.go b/event_reporter/utils/app_version.go index fc6b0d186d6aa..0d89efb242118 100644 --- a/event_reporter/utils/app_version.go +++ b/event_reporter/utils/app_version.go @@ -3,27 +3,16 @@ package utils import ( "encoding/json" - log "github.com/sirupsen/logrus" - - "github.com/argoproj/argo-cd/v2/pkg/apiclient/events" "github.com/argoproj/argo-cd/v2/pkg/sources_server_client" "github.com/argoproj/argo-cd/v2/reposerver/apiclient" + log "github.com/sirupsen/logrus" ) -func RepoAppVersionsToEvent(applicationVersions *apiclient.ApplicationVersions) (*events.ApplicationVersions, error) { - applicationVersionsEvents := &events.ApplicationVersions{} - applicationVersionsData, _ := json.Marshal(applicationVersions) - err := json.Unmarshal(applicationVersionsData, applicationVersionsEvents) - if err != nil { - return nil, err - } - return applicationVersionsEvents, nil -} - -func SourcesAppVersionsToRepo(applicationVersions *sources_server_client.AppVersionResult, logCtx *log.Entry) *apiclient.ApplicationVersions { +func SourcesAppVersionsToRepo(logCtx *log.Logger, applicationVersions *sources_server_client.AppVersionResult) *apiclient.ApplicationVersions { if applicationVersions == nil { return nil } + applicationVersionsRepo := &apiclient.ApplicationVersions{} applicationVersionsData, _ := json.Marshal(applicationVersions) err := json.Unmarshal(applicationVersionsData, applicationVersionsRepo) @@ -31,5 +20,6 @@ func SourcesAppVersionsToRepo(applicationVersions *sources_server_client.AppVers logCtx.Errorf("can't unmarshal app version: %v", err) return nil } + return applicationVersionsRepo } diff --git a/event_reporter/utils/utils.go b/event_reporter/utils/utils.go index 8857f7d39150c..3e3040ef51d53 100644 --- a/event_reporter/utils/utils.go +++ b/event_reporter/utils/utils.go @@ -1,7 +1,9 @@ package utils import ( + "context" "fmt" + "time" "github.com/argoproj/gitops-engine/pkg/health" log "github.com/sirupsen/logrus" @@ -10,6 +12,9 @@ import ( appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" ) +// LoggerKey is a unique key for storing the logger in the context. +type LoggerKey struct{} + func SetHealthStatusIfMissing(rs *appv1.ResourceStatus) { if rs.Health == nil && rs.Status == appv1.SyncStatusCodeSynced { // for resources without health status we need to add 'Healthy' status @@ -25,7 +30,7 @@ func IsApp(rs appv1.ResourceStatus) bool { return rs.GroupVersionKind().String() == appv1.ApplicationSchemaGroupVersionKind.String() } -func LogWithAppStatus(a *appv1.Application, logCtx *log.Entry, ts string) *log.Entry { +func LogWithAppStatus(a *appv1.Application, logCtx *log.Entry, ts time.Time) *log.Entry { return logCtx.WithFields(log.Fields{ "sync": a.Status.Sync.Status, "health": a.Status.Health.Status, @@ -78,3 +83,16 @@ func AddDestNamespaceToManifest(resourceManifest []byte, rs *appv1.ResourceStatu return u, nil } + +// WithLogger returns a new context with the given logger. +func WithLogger(ctx context.Context, logger *log.Logger) context.Context { + return context.WithValue(ctx, LoggerKey{}, logger) +} + +// GetLogger retrieves the logger from the context. +func GetLogger(ctx context.Context) *log.Logger { + if logger, ok := ctx.Value(LoggerKey{}).(*log.Logger); ok { + return logger + } + return log.StandardLogger() // Return a default logger if not found +} diff --git a/pkg/apiclient/events/events.pb.go b/pkg/apiclient/events/events.pb.go deleted file mode 100644 index 9abdc40a779b8..0000000000000 --- a/pkg/apiclient/events/events.pb.go +++ /dev/null @@ -1,4115 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: server/application/events.proto - -// Events Service -// -// Events Service API provides a generic event-source that allows -// listening for argo-cd events natively from argo-events. - -package events - -import ( - fmt "fmt" - _ "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - _ "github.com/gogo/protobuf/gogoproto" - github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - io "io" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type EventSource struct { - // The event source name. - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - // The event source configuration value. - Config []byte `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventSource) Reset() { *m = EventSource{} } -func (m *EventSource) String() string { return proto.CompactTextString(m) } -func (*EventSource) ProtoMessage() {} -func (*EventSource) Descriptor() ([]byte, []int) { - return fileDescriptor_3ad9267ec62b112f, []int{0} -} -func (m *EventSource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventSource.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EventSource) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventSource.Merge(m, src) -} -func (m *EventSource) XXX_Size() int { - return m.Size() -} -func (m *EventSource) XXX_DiscardUnknown() { - xxx_messageInfo_EventSource.DiscardUnknown(m) -} - -var xxx_messageInfo_EventSource proto.InternalMessageInfo - -func (m *EventSource) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *EventSource) GetConfig() []byte { - if m != nil { - return m.Config - } - return nil -} - -// * -// Represents an event -type Event struct { - // The event source name. - Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` - // The event payload. - Payload []byte `protobuf:"bytes,2,req,name=payload" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_3ad9267ec62b112f, []int{1} -} -func (m *Event) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(m, src) -} -func (m *Event) XXX_Size() int { - return m.Size() -} -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) -} - -var xxx_messageInfo_Event proto.InternalMessageInfo - -func (m *Event) GetName() string { - if m != nil && m.Name != nil { - return *m.Name - } - return "" -} - -func (m *Event) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -// * -// The actual object that will be send -// with each event. -type EventPayload struct { - // The timestamp of the event - Timestamp string `protobuf:"bytes,1,req,name=timestamp" json:"timestamp"` - // The object that the event is about - Object []byte `protobuf:"bytes,2,req,name=object" json:"object,omitempty"` - // The object source information - Source *ObjectSource `protobuf:"bytes,3,req,name=source" json:"source,omitempty"` - // The errors of this object - Errors []*ObjectError `protobuf:"bytes,4,rep,name=errors" json:"errors,omitempty"` - // A version of the application and its dependencies - AppVersions *ApplicationVersions `protobuf:"bytes,5,opt,name=appVersions" json:"appVersions,omitempty"` - // A version of codefresh runtime - RuntimeVersion string `protobuf:"bytes,6,req,name=runtimeVersion" json:"runtimeVersion"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EventPayload) Reset() { *m = EventPayload{} } -func (m *EventPayload) String() string { return proto.CompactTextString(m) } -func (*EventPayload) ProtoMessage() {} -func (*EventPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_3ad9267ec62b112f, []int{2} -} -func (m *EventPayload) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventPayload.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EventPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventPayload.Merge(m, src) -} -func (m *EventPayload) XXX_Size() int { - return m.Size() -} -func (m *EventPayload) XXX_DiscardUnknown() { - xxx_messageInfo_EventPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_EventPayload proto.InternalMessageInfo - -func (m *EventPayload) GetTimestamp() string { - if m != nil { - return m.Timestamp - } - return "" -} - -func (m *EventPayload) GetObject() []byte { - if m != nil { - return m.Object - } - return nil -} - -func (m *EventPayload) GetSource() *ObjectSource { - if m != nil { - return m.Source - } - return nil -} - -func (m *EventPayload) GetErrors() []*ObjectError { - if m != nil { - return m.Errors - } - return nil -} - -func (m *EventPayload) GetAppVersions() *ApplicationVersions { - if m != nil { - return m.AppVersions - } - return nil -} - -func (m *EventPayload) GetRuntimeVersion() string { - if m != nil { - return m.RuntimeVersion - } - return "" -} - -// * -// Holds information about the object source -type ObjectSource struct { - DesiredManifest string `protobuf:"bytes,1,opt,name=desiredManifest" json:"desiredManifest"` - ActualManifest string `protobuf:"bytes,2,opt,name=actualManifest" json:"actualManifest"` - GitManifest string `protobuf:"bytes,3,opt,name=gitManifest" json:"gitManifest"` - RepoURL string `protobuf:"bytes,4,opt,name=repoURL" json:"repoURL"` - Path string `protobuf:"bytes,5,opt,name=path" json:"path"` - Revision string `protobuf:"bytes,6,opt,name=revision" json:"revision"` - CommitMessage string `protobuf:"bytes,7,opt,name=commitMessage" json:"commitMessage"` - CommitAuthor string `protobuf:"bytes,8,opt,name=commitAuthor" json:"commitAuthor"` - CommitDate *v1.Time `protobuf:"bytes,9,opt,name=commitDate" json:"commitDate,omitempty"` - AppName string `protobuf:"bytes,10,opt,name=appName" json:"appName"` - AppLabels map[string]string `protobuf:"bytes,11,rep,name=appLabels" json:"appLabels" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - SyncStatus string `protobuf:"bytes,12,opt,name=syncStatus" json:"syncStatus"` - SyncStartedAt v1.Time `protobuf:"bytes,13,opt,name=syncStartedAt" json:"syncStartedAt"` - SyncFinishedAt *v1.Time `protobuf:"bytes,14,opt,name=syncFinishedAt" json:"syncFinishedAt,omitempty"` - HealthStatus *string `protobuf:"bytes,15,opt,name=healthStatus" json:"healthStatus,omitempty"` - HealthMessage *string `protobuf:"bytes,16,opt,name=healthMessage" json:"healthMessage,omitempty"` - Cluster string `protobuf:"bytes,17,opt,name=cluster" json:"cluster"` - HistoryId int64 `protobuf:"varint,18,opt,name=historyId" json:"historyId"` - OperationSyncRevision string `protobuf:"bytes,19,opt,name=operationSyncRevision" json:"operationSyncRevision"` - AppUID string `protobuf:"bytes,20,opt,name=appUID" json:"appUID"` - AppNamespace string `protobuf:"bytes,21,opt,name=appNamespace" json:"appNamespace"` - AppInstanceLabelKey string `protobuf:"bytes,22,opt,name=appInstanceLabelKey" json:"appInstanceLabelKey"` - TrackingMethod string `protobuf:"bytes,23,opt,name=trackingMethod" json:"trackingMethod"` - Revisions []string `protobuf:"bytes,24,rep,name=revisions" json:"revisions,omitempty"` - OperationSyncRevisions []string `protobuf:"bytes,25,rep,name=operationSyncRevisions" json:"operationSyncRevisions,omitempty"` - ClusterName *string `protobuf:"bytes,26,opt,name=clusterName" json:"clusterName,omitempty"` - AppMultiSourced bool `protobuf:"varint,27,req,name=appMultiSourced" json:"appMultiSourced"` - AppSourceIdx int32 `protobuf:"varint,28,req,name=appSourceIdx" json:"appSourceIdx"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ObjectSource) Reset() { *m = ObjectSource{} } -func (m *ObjectSource) String() string { return proto.CompactTextString(m) } -func (*ObjectSource) ProtoMessage() {} -func (*ObjectSource) Descriptor() ([]byte, []int) { - return fileDescriptor_3ad9267ec62b112f, []int{3} -} -func (m *ObjectSource) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ObjectSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ObjectSource.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ObjectSource) XXX_Merge(src proto.Message) { - xxx_messageInfo_ObjectSource.Merge(m, src) -} -func (m *ObjectSource) XXX_Size() int { - return m.Size() -} -func (m *ObjectSource) XXX_DiscardUnknown() { - xxx_messageInfo_ObjectSource.DiscardUnknown(m) -} - -var xxx_messageInfo_ObjectSource proto.InternalMessageInfo - -func (m *ObjectSource) GetDesiredManifest() string { - if m != nil { - return m.DesiredManifest - } - return "" -} - -func (m *ObjectSource) GetActualManifest() string { - if m != nil { - return m.ActualManifest - } - return "" -} - -func (m *ObjectSource) GetGitManifest() string { - if m != nil { - return m.GitManifest - } - return "" -} - -func (m *ObjectSource) GetRepoURL() string { - if m != nil { - return m.RepoURL - } - return "" -} - -func (m *ObjectSource) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *ObjectSource) GetRevision() string { - if m != nil { - return m.Revision - } - return "" -} - -func (m *ObjectSource) GetCommitMessage() string { - if m != nil { - return m.CommitMessage - } - return "" -} - -func (m *ObjectSource) GetCommitAuthor() string { - if m != nil { - return m.CommitAuthor - } - return "" -} - -func (m *ObjectSource) GetCommitDate() *v1.Time { - if m != nil { - return m.CommitDate - } - return nil -} - -func (m *ObjectSource) GetAppName() string { - if m != nil { - return m.AppName - } - return "" -} - -func (m *ObjectSource) GetAppLabels() map[string]string { - if m != nil { - return m.AppLabels - } - return nil -} - -func (m *ObjectSource) GetSyncStatus() string { - if m != nil { - return m.SyncStatus - } - return "" -} - -func (m *ObjectSource) GetSyncStartedAt() v1.Time { - if m != nil { - return m.SyncStartedAt - } - return v1.Time{} -} - -func (m *ObjectSource) GetSyncFinishedAt() *v1.Time { - if m != nil { - return m.SyncFinishedAt - } - return nil -} - -func (m *ObjectSource) GetHealthStatus() string { - if m != nil && m.HealthStatus != nil { - return *m.HealthStatus - } - return "" -} - -func (m *ObjectSource) GetHealthMessage() string { - if m != nil && m.HealthMessage != nil { - return *m.HealthMessage - } - return "" -} - -func (m *ObjectSource) GetCluster() string { - if m != nil { - return m.Cluster - } - return "" -} - -func (m *ObjectSource) GetHistoryId() int64 { - if m != nil { - return m.HistoryId - } - return 0 -} - -func (m *ObjectSource) GetOperationSyncRevision() string { - if m != nil { - return m.OperationSyncRevision - } - return "" -} - -func (m *ObjectSource) GetAppUID() string { - if m != nil { - return m.AppUID - } - return "" -} - -func (m *ObjectSource) GetAppNamespace() string { - if m != nil { - return m.AppNamespace - } - return "" -} - -func (m *ObjectSource) GetAppInstanceLabelKey() string { - if m != nil { - return m.AppInstanceLabelKey - } - return "" -} - -func (m *ObjectSource) GetTrackingMethod() string { - if m != nil { - return m.TrackingMethod - } - return "" -} - -func (m *ObjectSource) GetRevisions() []string { - if m != nil { - return m.Revisions - } - return nil -} - -func (m *ObjectSource) GetOperationSyncRevisions() []string { - if m != nil { - return m.OperationSyncRevisions - } - return nil -} - -func (m *ObjectSource) GetClusterName() string { - if m != nil && m.ClusterName != nil { - return *m.ClusterName - } - return "" -} - -func (m *ObjectSource) GetAppMultiSourced() bool { - if m != nil { - return m.AppMultiSourced - } - return false -} - -func (m *ObjectSource) GetAppSourceIdx() int32 { - if m != nil { - return m.AppSourceIdx - } - return 0 -} - -// * -// Holds error information; present only when error sent with application but not resource itself -type ObjectError struct { - Type string `protobuf:"bytes,1,opt,name=type" json:"type"` - Level string `protobuf:"bytes,2,opt,name=level" json:"level"` - Message string `protobuf:"bytes,3,opt,name=message" json:"message"` - LastSeen v1.Time `protobuf:"bytes,4,opt,name=lastSeen" json:"lastSeen"` - SourceReference *ErrorSourceReference `protobuf:"bytes,5,opt,name=sourceReference" json:"sourceReference,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ObjectError) Reset() { *m = ObjectError{} } -func (m *ObjectError) String() string { return proto.CompactTextString(m) } -func (*ObjectError) ProtoMessage() {} -func (*ObjectError) Descriptor() ([]byte, []int) { - return fileDescriptor_3ad9267ec62b112f, []int{4} -} -func (m *ObjectError) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ObjectError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ObjectError.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ObjectError) XXX_Merge(src proto.Message) { - xxx_messageInfo_ObjectError.Merge(m, src) -} -func (m *ObjectError) XXX_Size() int { - return m.Size() -} -func (m *ObjectError) XXX_DiscardUnknown() { - xxx_messageInfo_ObjectError.DiscardUnknown(m) -} - -var xxx_messageInfo_ObjectError proto.InternalMessageInfo - -func (m *ObjectError) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *ObjectError) GetLevel() string { - if m != nil { - return m.Level - } - return "" -} - -func (m *ObjectError) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func (m *ObjectError) GetLastSeen() v1.Time { - if m != nil { - return m.LastSeen - } - return v1.Time{} -} - -func (m *ObjectError) GetSourceReference() *ErrorSourceReference { - if m != nil { - return m.SourceReference - } - return nil -} - -// * -// Holds application resource metadata to which the error related -type ErrorSourceReference struct { - Group string `protobuf:"bytes,1,opt,name=group" json:"group"` - Version string `protobuf:"bytes,2,opt,name=version" json:"version"` - Kind string `protobuf:"bytes,3,req,name=kind" json:"kind"` - Name string `protobuf:"bytes,4,req,name=name" json:"name"` - Namespace string `protobuf:"bytes,5,opt,name=namespace" json:"namespace"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ErrorSourceReference) Reset() { *m = ErrorSourceReference{} } -func (m *ErrorSourceReference) String() string { return proto.CompactTextString(m) } -func (*ErrorSourceReference) ProtoMessage() {} -func (*ErrorSourceReference) Descriptor() ([]byte, []int) { - return fileDescriptor_3ad9267ec62b112f, []int{5} -} -func (m *ErrorSourceReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ErrorSourceReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ErrorSourceReference.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ErrorSourceReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_ErrorSourceReference.Merge(m, src) -} -func (m *ErrorSourceReference) XXX_Size() int { - return m.Size() -} -func (m *ErrorSourceReference) XXX_DiscardUnknown() { - xxx_messageInfo_ErrorSourceReference.DiscardUnknown(m) -} - -var xxx_messageInfo_ErrorSourceReference proto.InternalMessageInfo - -func (m *ErrorSourceReference) GetGroup() string { - if m != nil { - return m.Group - } - return "" -} - -func (m *ErrorSourceReference) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *ErrorSourceReference) GetKind() string { - if m != nil { - return m.Kind - } - return "" -} - -func (m *ErrorSourceReference) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ErrorSourceReference) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -type Dependencies struct { - // Content of Chart.lock - Lock *string `protobuf:"bytes,1,opt,name=lock" json:"lock,omitempty"` - // Content of Chart.yaml - Deps *string `protobuf:"bytes,2,opt,name=deps" json:"deps,omitempty"` - // Content of requirements.yaml - Requirements *string `protobuf:"bytes,3,opt,name=requirements" json:"requirements,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Dependencies) Reset() { *m = Dependencies{} } -func (m *Dependencies) String() string { return proto.CompactTextString(m) } -func (*Dependencies) ProtoMessage() {} -func (*Dependencies) Descriptor() ([]byte, []int) { - return fileDescriptor_3ad9267ec62b112f, []int{6} -} -func (m *Dependencies) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Dependencies) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Dependencies.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Dependencies) XXX_Merge(src proto.Message) { - xxx_messageInfo_Dependencies.Merge(m, src) -} -func (m *Dependencies) XXX_Size() int { - return m.Size() -} -func (m *Dependencies) XXX_DiscardUnknown() { - xxx_messageInfo_Dependencies.DiscardUnknown(m) -} - -var xxx_messageInfo_Dependencies proto.InternalMessageInfo - -func (m *Dependencies) GetLock() string { - if m != nil && m.Lock != nil { - return *m.Lock - } - return "" -} - -func (m *Dependencies) GetDeps() string { - if m != nil && m.Deps != nil { - return *m.Deps - } - return "" -} - -func (m *Dependencies) GetRequirements() string { - if m != nil && m.Requirements != nil { - return *m.Requirements - } - return "" -} - -type ApplicationVersions struct { - // Application version presented by single value - AppVersion *string `protobuf:"bytes,1,opt,name=appVersion" json:"appVersion,omitempty"` - // Yaml content of dependencies - Dependencies *Dependencies `protobuf:"bytes,2,opt,name=dependencies" json:"dependencies,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ApplicationVersions) Reset() { *m = ApplicationVersions{} } -func (m *ApplicationVersions) String() string { return proto.CompactTextString(m) } -func (*ApplicationVersions) ProtoMessage() {} -func (*ApplicationVersions) Descriptor() ([]byte, []int) { - return fileDescriptor_3ad9267ec62b112f, []int{7} -} -func (m *ApplicationVersions) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ApplicationVersions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ApplicationVersions.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ApplicationVersions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApplicationVersions.Merge(m, src) -} -func (m *ApplicationVersions) XXX_Size() int { - return m.Size() -} -func (m *ApplicationVersions) XXX_DiscardUnknown() { - xxx_messageInfo_ApplicationVersions.DiscardUnknown(m) -} - -var xxx_messageInfo_ApplicationVersions proto.InternalMessageInfo - -func (m *ApplicationVersions) GetAppVersion() string { - if m != nil && m.AppVersion != nil { - return *m.AppVersion - } - return "" -} - -func (m *ApplicationVersions) GetDependencies() *Dependencies { - if m != nil { - return m.Dependencies - } - return nil -} - -func init() { - proto.RegisterType((*EventSource)(nil), "generic.EventSource") - proto.RegisterType((*Event)(nil), "generic.Event") - proto.RegisterType((*EventPayload)(nil), "generic.EventPayload") - proto.RegisterType((*ObjectSource)(nil), "generic.ObjectSource") - proto.RegisterMapType((map[string]string)(nil), "generic.ObjectSource.AppLabelsEntry") - proto.RegisterType((*ObjectError)(nil), "generic.ObjectError") - proto.RegisterType((*ErrorSourceReference)(nil), "generic.ErrorSourceReference") - proto.RegisterType((*Dependencies)(nil), "generic.Dependencies") - proto.RegisterType((*ApplicationVersions)(nil), "generic.ApplicationVersions") -} - -func init() { proto.RegisterFile("server/application/events.proto", fileDescriptor_3ad9267ec62b112f) } - -var fileDescriptor_3ad9267ec62b112f = []byte{ - // 1125 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x8e, 0x1b, 0xb5, - 0x17, 0xff, 0x27, 0xfb, 0x99, 0x93, 0xec, 0xb6, 0x7f, 0x77, 0x5b, 0xcc, 0xb2, 0x6c, 0xa3, 0xa8, - 0x42, 0x51, 0xd5, 0x26, 0xea, 0x02, 0x55, 0x5b, 0x21, 0xa4, 0xad, 0x5a, 0x60, 0x61, 0x17, 0xd0, - 0x2c, 0xed, 0x45, 0xef, 0xdc, 0x99, 0xd3, 0x89, 0x9b, 0x89, 0x6d, 0x6c, 0x27, 0x22, 0x0f, 0xc2, - 0x4b, 0xf0, 0x24, 0xbd, 0xe4, 0x8a, 0x4b, 0x84, 0xfa, 0x18, 0x5c, 0x21, 0x7b, 0x3c, 0x89, 0x27, - 0x04, 0x89, 0x72, 0x67, 0xff, 0xce, 0xef, 0x1c, 0xfb, 0x7c, 0xda, 0x70, 0xd3, 0xa0, 0x9e, 0xa1, - 0x1e, 0x32, 0xa5, 0x0a, 0x9e, 0x32, 0xcb, 0xa5, 0x18, 0xe2, 0x0c, 0x85, 0x35, 0x03, 0xa5, 0xa5, - 0x95, 0x64, 0x27, 0x47, 0x81, 0x9a, 0xa7, 0x87, 0xe7, 0x39, 0xb7, 0xa3, 0xe9, 0xcb, 0x41, 0x2a, - 0x27, 0x43, 0xa6, 0x73, 0xa9, 0xb4, 0x7c,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- 0xe2, 0x96, 0xe4, 0x00, 0xb6, 0x66, 0xac, 0x98, 0x62, 0x39, 0xf4, 0x92, 0x72, 0xf3, 0xa8, 0xf9, - 0xa0, 0xd1, 0xfb, 0xb3, 0x01, 0xed, 0x68, 0xbc, 0xbb, 0x89, 0x65, 0xe7, 0x0a, 0x6b, 0xc3, 0xd4, - 0x23, 0xe4, 0x10, 0xb6, 0x0a, 0x9c, 0x61, 0x51, 0x1b, 0x9c, 0x25, 0xe4, 0x6a, 0x70, 0x12, 0x6a, - 0x34, 0x9e, 0x95, 0x15, 0x48, 0xce, 0x61, 0xb7, 0x60, 0xc6, 0x5e, 0x22, 0x0a, 0x3f, 0x28, 0xff, - 0x4b, 0x53, 0x2e, 0x2c, 0x90, 0x2f, 0xe1, 0x4a, 0xf9, 0x64, 0x25, 0xf8, 0x0a, 0x35, 0x8a, 0x14, - 0xc3, 0xf3, 0xf3, 0xe1, 0x62, 0xba, 0x78, 0x67, 0x2e, 0xeb, 0xa4, 0x64, 0x55, 0xab, 0xf7, 0x4b, - 0x03, 0x0e, 0xd6, 0x31, 0x9d, 0xaf, 0xb9, 0x96, 0x53, 0x55, 0x0b, 0x43, 0x09, 0x39, 0x5f, 0x67, - 0xe1, 0xc5, 0x8a, 0x23, 0x51, 0x81, 0x2e, 0x82, 0x63, 0x2e, 0x32, 0xff, 0xe6, 0x2e, 0x22, 0xe8, - 0x10, 0x27, 0xf1, 0x5f, 0x81, 0xcd, 0x58, 0xe2, 0x3f, 0x04, 0x3d, 0x68, 0x89, 0x45, 0x8b, 0xc4, - 0x8f, 0xc5, 0x12, 0xee, 0xbd, 0x80, 0xce, 0x13, 0x54, 0x28, 0x32, 0x14, 0x29, 0x47, 0xe3, 0x3e, - 0x16, 0x85, 0x4c, 0xc7, 0x21, 0xcd, 0x7e, 0xed, 0xb0, 0x0c, 0x95, 0x09, 0x69, 0xf6, 0x6b, 0x37, - 0x69, 0x34, 0xfe, 0x38, 0xe5, 0x1a, 0x27, 0xee, 0x6f, 0x56, 0x26, 0x28, 0xa9, 0x61, 0x3d, 0x05, - 0xd7, 0xd6, 0x3c, 0xd8, 0xe4, 0x18, 0x60, 0xf9, 0x64, 0x87, 0x83, 0x22, 0x84, 0x3c, 0x84, 0x4e, - 0x16, 0x5d, 0xc9, 0x1f, 0x1b, 0x7f, 0x33, 0xe2, 0xfb, 0x26, 0x35, 0xea, 0xe3, 0xd3, 0x37, 0x6f, - 0x8f, 0x1b, 0xbf, 0xbe, 0x3d, 0x6e, 0xfc, 0xf1, 0xf6, 0xb8, 0xf1, 0xe2, 0xe3, 0x7f, 0xf7, 0x41, - 0x4c, 0x0b, 0x8e, 0xc2, 0x86, 0x4f, 0xe6, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc5, 0xd7, 0x70, - 0xae, 0x80, 0x0a, 0x00, 0x00, -} - -func (m *EventSource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventSource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Config != nil { - i -= len(m.Config) - copy(dAtA[i:], m.Config) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Config))) - i-- - dAtA[i] = 0x12 - } - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - i -= len(*m.Name) - copy(dAtA[i:], *m.Name) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Payload == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("payload") - } else { - i -= len(m.Payload) - copy(dAtA[i:], m.Payload) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Payload))) - i-- - dAtA[i] = 0x12 - } - if m.Name == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } else { - i -= len(*m.Name) - copy(dAtA[i:], *m.Name) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventPayload) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventPayload) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - i -= len(m.RuntimeVersion) - copy(dAtA[i:], m.RuntimeVersion) - i = encodeVarintEvents(dAtA, i, uint64(len(m.RuntimeVersion))) - i-- - dAtA[i] = 0x32 - if m.AppVersions != nil { - { - size, err := m.AppVersions.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Errors) > 0 { - for iNdEx := len(m.Errors) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Errors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Source == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("source") - } else { - { - size, err := m.Source.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Object == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("object") - } else { - i -= len(m.Object) - copy(dAtA[i:], m.Object) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Object))) - i-- - dAtA[i] = 0x12 - } - i -= len(m.Timestamp) - copy(dAtA[i:], m.Timestamp) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Timestamp))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ObjectSource) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ObjectSource) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ObjectSource) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - i = encodeVarintEvents(dAtA, i, uint64(m.AppSourceIdx)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xe0 - i-- - if m.AppMultiSourced { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xd8 - if m.ClusterName != nil { - i -= len(*m.ClusterName) - copy(dAtA[i:], *m.ClusterName) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.ClusterName))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xd2 - } - if len(m.OperationSyncRevisions) > 0 { - for iNdEx := len(m.OperationSyncRevisions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.OperationSyncRevisions[iNdEx]) - copy(dAtA[i:], m.OperationSyncRevisions[iNdEx]) - i = encodeVarintEvents(dAtA, i, uint64(len(m.OperationSyncRevisions[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xca - } - } - if len(m.Revisions) > 0 { - for iNdEx := len(m.Revisions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Revisions[iNdEx]) - copy(dAtA[i:], m.Revisions[iNdEx]) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Revisions[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xc2 - } - } - i -= len(m.TrackingMethod) - copy(dAtA[i:], m.TrackingMethod) - i = encodeVarintEvents(dAtA, i, uint64(len(m.TrackingMethod))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xba - i -= len(m.AppInstanceLabelKey) - copy(dAtA[i:], m.AppInstanceLabelKey) - i = encodeVarintEvents(dAtA, i, uint64(len(m.AppInstanceLabelKey))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb2 - i -= len(m.AppNamespace) - copy(dAtA[i:], m.AppNamespace) - i = encodeVarintEvents(dAtA, i, uint64(len(m.AppNamespace))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xaa - i -= len(m.AppUID) - copy(dAtA[i:], m.AppUID) - i = encodeVarintEvents(dAtA, i, uint64(len(m.AppUID))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa2 - i -= len(m.OperationSyncRevision) - copy(dAtA[i:], m.OperationSyncRevision) - i = encodeVarintEvents(dAtA, i, uint64(len(m.OperationSyncRevision))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - i = encodeVarintEvents(dAtA, i, uint64(m.HistoryId)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x90 - i -= len(m.Cluster) - copy(dAtA[i:], m.Cluster) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Cluster))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - if m.HealthMessage != nil { - i -= len(*m.HealthMessage) - copy(dAtA[i:], *m.HealthMessage) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.HealthMessage))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if m.HealthStatus != nil { - i -= len(*m.HealthStatus) - copy(dAtA[i:], *m.HealthStatus) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.HealthStatus))) - i-- - dAtA[i] = 0x7a - } - if m.SyncFinishedAt != nil { - { - size, err := m.SyncFinishedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - } - { - size, err := m.SyncStartedAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - i -= len(m.SyncStatus) - copy(dAtA[i:], m.SyncStatus) - i = encodeVarintEvents(dAtA, i, uint64(len(m.SyncStatus))) - i-- - dAtA[i] = 0x62 - if len(m.AppLabels) > 0 { - for k := range m.AppLabels { - v := m.AppLabels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintEvents(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintEvents(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintEvents(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x5a - } - } - i -= len(m.AppName) - copy(dAtA[i:], m.AppName) - i = encodeVarintEvents(dAtA, i, uint64(len(m.AppName))) - i-- - dAtA[i] = 0x52 - if m.CommitDate != nil { - { - size, err := m.CommitDate.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - i -= len(m.CommitAuthor) - copy(dAtA[i:], m.CommitAuthor) - i = encodeVarintEvents(dAtA, i, uint64(len(m.CommitAuthor))) - i-- - dAtA[i] = 0x42 - i -= len(m.CommitMessage) - copy(dAtA[i:], m.CommitMessage) - i = encodeVarintEvents(dAtA, i, uint64(len(m.CommitMessage))) - i-- - dAtA[i] = 0x3a - i -= len(m.Revision) - copy(dAtA[i:], m.Revision) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Revision))) - i-- - dAtA[i] = 0x32 - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x2a - i -= len(m.RepoURL) - copy(dAtA[i:], m.RepoURL) - i = encodeVarintEvents(dAtA, i, uint64(len(m.RepoURL))) - i-- - dAtA[i] = 0x22 - i -= len(m.GitManifest) - copy(dAtA[i:], m.GitManifest) - i = encodeVarintEvents(dAtA, i, uint64(len(m.GitManifest))) - i-- - dAtA[i] = 0x1a - i -= len(m.ActualManifest) - copy(dAtA[i:], m.ActualManifest) - i = encodeVarintEvents(dAtA, i, uint64(len(m.ActualManifest))) - i-- - dAtA[i] = 0x12 - i -= len(m.DesiredManifest) - copy(dAtA[i:], m.DesiredManifest) - i = encodeVarintEvents(dAtA, i, uint64(len(m.DesiredManifest))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ObjectError) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ObjectError) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ObjectError) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.SourceReference != nil { - { - size, err := m.SourceReference.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - { - size, err := m.LastSeen.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x1a - i -= len(m.Level) - copy(dAtA[i:], m.Level) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Level))) - i-- - dAtA[i] = 0x12 - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ErrorSourceReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ErrorSourceReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ErrorSourceReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x2a - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x22 - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x1a - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - i -= len(m.Group) - copy(dAtA[i:], m.Group) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Group))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Dependencies) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Dependencies) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Dependencies) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Requirements != nil { - i -= len(*m.Requirements) - copy(dAtA[i:], *m.Requirements) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.Requirements))) - i-- - dAtA[i] = 0x1a - } - if m.Deps != nil { - i -= len(*m.Deps) - copy(dAtA[i:], *m.Deps) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.Deps))) - i-- - dAtA[i] = 0x12 - } - if m.Lock != nil { - i -= len(*m.Lock) - copy(dAtA[i:], *m.Lock) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.Lock))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ApplicationVersions) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ApplicationVersions) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ApplicationVersions) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Dependencies != nil { - { - size, err := m.Dependencies.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.AppVersion != nil { - i -= len(*m.AppVersion) - copy(dAtA[i:], *m.AppVersion) - i = encodeVarintEvents(dAtA, i, uint64(len(*m.AppVersion))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventSource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovEvents(uint64(l)) - } - if m.Config != nil { - l = len(m.Config) - n += 1 + l + sovEvents(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Event) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Name != nil { - l = len(*m.Name) - n += 1 + l + sovEvents(uint64(l)) - } - if m.Payload != nil { - l = len(m.Payload) - n += 1 + l + sovEvents(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *EventPayload) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Timestamp) - n += 1 + l + sovEvents(uint64(l)) - if m.Object != nil { - l = len(m.Object) - n += 1 + l + sovEvents(uint64(l)) - } - if m.Source != nil { - l = m.Source.Size() - n += 1 + l + sovEvents(uint64(l)) - } - if len(m.Errors) > 0 { - for _, e := range m.Errors { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } - } - if m.AppVersions != nil { - l = m.AppVersions.Size() - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.RuntimeVersion) - n += 1 + l + sovEvents(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ObjectSource) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DesiredManifest) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.ActualManifest) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.GitManifest) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.RepoURL) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.Path) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.Revision) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.CommitMessage) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.CommitAuthor) - n += 1 + l + sovEvents(uint64(l)) - if m.CommitDate != nil { - l = m.CommitDate.Size() - n += 1 + l + sovEvents(uint64(l)) - } - l = len(m.AppName) - n += 1 + l + sovEvents(uint64(l)) - if len(m.AppLabels) > 0 { - for k, v := range m.AppLabels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovEvents(uint64(len(k))) + 1 + len(v) + sovEvents(uint64(len(v))) - n += mapEntrySize + 1 + sovEvents(uint64(mapEntrySize)) - } - } - l = len(m.SyncStatus) - n += 1 + l + sovEvents(uint64(l)) - l = m.SyncStartedAt.Size() - n += 1 + l + sovEvents(uint64(l)) - if m.SyncFinishedAt != nil { - l = m.SyncFinishedAt.Size() - n += 1 + l + sovEvents(uint64(l)) - } - if m.HealthStatus != nil { - l = len(*m.HealthStatus) - n += 1 + l + sovEvents(uint64(l)) - } - if m.HealthMessage != nil { - l = len(*m.HealthMessage) - n += 2 + l + sovEvents(uint64(l)) - } - l = len(m.Cluster) - n += 2 + l + sovEvents(uint64(l)) - n += 2 + sovEvents(uint64(m.HistoryId)) - l = len(m.OperationSyncRevision) - n += 2 + l + sovEvents(uint64(l)) - l = len(m.AppUID) - n += 2 + l + sovEvents(uint64(l)) - l = len(m.AppNamespace) - n += 2 + l + sovEvents(uint64(l)) - l = len(m.AppInstanceLabelKey) - n += 2 + l + sovEvents(uint64(l)) - l = len(m.TrackingMethod) - n += 2 + l + sovEvents(uint64(l)) - if len(m.Revisions) > 0 { - for _, s := range m.Revisions { - l = len(s) - n += 2 + l + sovEvents(uint64(l)) - } - } - if len(m.OperationSyncRevisions) > 0 { - for _, s := range m.OperationSyncRevisions { - l = len(s) - n += 2 + l + sovEvents(uint64(l)) - } - } - if m.ClusterName != nil { - l = len(*m.ClusterName) - n += 2 + l + sovEvents(uint64(l)) - } - n += 3 - n += 2 + sovEvents(uint64(m.AppSourceIdx)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ObjectError) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.Level) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.Message) - n += 1 + l + sovEvents(uint64(l)) - l = m.LastSeen.Size() - n += 1 + l + sovEvents(uint64(l)) - if m.SourceReference != nil { - l = m.SourceReference.Size() - n += 1 + l + sovEvents(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ErrorSourceReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Group) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.Version) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.Kind) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.Name) - n += 1 + l + sovEvents(uint64(l)) - l = len(m.Namespace) - n += 1 + l + sovEvents(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Dependencies) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Lock != nil { - l = len(*m.Lock) - n += 1 + l + sovEvents(uint64(l)) - } - if m.Deps != nil { - l = len(*m.Deps) - n += 1 + l + sovEvents(uint64(l)) - } - if m.Requirements != nil { - l = len(*m.Requirements) - n += 1 + l + sovEvents(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ApplicationVersions) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppVersion != nil { - l = len(*m.AppVersion) - n += 1 + l + sovEvents(uint64(l)) - } - if m.Dependencies != nil { - l = m.Dependencies.Size() - n += 1 + l + sovEvents(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventSource) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventSource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventSource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Config = append(m.Config[:0], dAtA[iNdEx:postIndex]...) - if m.Config == nil { - m.Config = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Event) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Event: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Name = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) - if m.Payload == nil { - m.Payload = []byte{} - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("payload") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventPayload) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventPayload: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventPayload: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timestamp = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Object", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Object = append(m.Object[:0], dAtA[iNdEx:postIndex]...) - if m.Object == nil { - m.Object = []byte{} - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Source == nil { - m.Source = &ObjectSource{} - } - if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Errors", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Errors = append(m.Errors, &ObjectError{}) - if err := m.Errors[len(m.Errors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppVersions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AppVersions == nil { - m.AppVersions = &ApplicationVersions{} - } - if err := m.AppVersions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RuntimeVersion", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RuntimeVersion = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000008) - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("timestamp") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("object") - } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("source") - } - if hasFields[0]&uint64(0x00000008) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("runtimeVersion") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ObjectSource) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ObjectSource: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ObjectSource: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DesiredManifest", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DesiredManifest = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActualManifest", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ActualManifest = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GitManifest", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GitManifest = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RepoURL", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RepoURL = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Revision = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CommitMessage = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitAuthor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CommitAuthor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitDate", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CommitDate == nil { - m.CommitDate = &v1.Time{} - } - if err := m.CommitDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppLabels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AppLabels == nil { - m.AppLabels = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthEvents - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthEvents - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthEvents - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthEvents - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.AppLabels[mapkey] = mapvalue - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SyncStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SyncStatus = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SyncStartedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SyncStartedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SyncFinishedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SyncFinishedAt == nil { - m.SyncFinishedAt = &v1.Time{} - } - if err := m.SyncFinishedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HealthStatus", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.HealthStatus = &s - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HealthMessage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.HealthMessage = &s - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cluster = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HistoryId", wireType) - } - m.HistoryId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HistoryId |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperationSyncRevision", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperationSyncRevision = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 20: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppUID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppUID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 21: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppNamespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppNamespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 22: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppInstanceLabelKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppInstanceLabelKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 23: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TrackingMethod", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TrackingMethod = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 24: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revisions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Revisions = append(m.Revisions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 25: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperationSyncRevisions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperationSyncRevisions = append(m.OperationSyncRevisions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 26: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.ClusterName = &s - iNdEx = postIndex - case 27: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppMultiSourced", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AppMultiSourced = bool(v != 0) - hasFields[0] |= uint64(0x00000001) - case 28: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppSourceIdx", wireType) - } - m.AppSourceIdx = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppSourceIdx |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - hasFields[0] |= uint64(0x00000002) - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("appMultiSourced") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("appSourceIdx") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ObjectError) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ObjectError: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ObjectError: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Level = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastSeen", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastSeen.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceReference", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SourceReference == nil { - m.SourceReference = &ErrorSourceReference{} - } - if err := m.SourceReference.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ErrorSourceReference) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ErrorSourceReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ErrorSourceReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Group = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("kind") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("name") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Dependencies) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Dependencies: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Dependencies: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Lock", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Lock = &s - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deps", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Deps = &s - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requirements", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Requirements = &s - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ApplicationVersions) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ApplicationVersions: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ApplicationVersions: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.AppVersion = &s - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dependencies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Dependencies == nil { - m.Dependencies = &Dependencies{} - } - if err := m.Dependencies.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/apis/application/v1alpha1/types.go b/pkg/apis/application/v1alpha1/types.go index 468c9f74e30c0..122213ecde6a3 100644 --- a/pkg/apis/application/v1alpha1/types.go +++ b/pkg/apis/application/v1alpha1/types.go @@ -1708,6 +1708,7 @@ func (n *ResourceNode) GroupKindVersion() schema.GroupVersionKind { } } +// TODO: cf code func (n *ResourceNode) GetAllChildNodes(tree *ApplicationTree, kind string) []ResourceNode { curChildren := []ResourceNode{} @@ -2870,6 +2871,7 @@ func (condition *ApplicationCondition) IsError() bool { } // IsWarning returns true if a condition indicates an warning condition +// TODO: cf code func (condition *ApplicationCondition) IsWarning() bool { return strings.HasSuffix(condition.Type, "Warning") } diff --git a/pkg/apis/application/v1alpha1/types_codefresh.go b/pkg/apis/application/v1alpha1/types_codefresh.go index 1e2d922b407a4..0e429fa04b718 100644 --- a/pkg/apis/application/v1alpha1/types_codefresh.go +++ b/pkg/apis/application/v1alpha1/types_codefresh.go @@ -6,10 +6,12 @@ import ( appv1reg "github.com/argoproj/argo-cd/v2/pkg/apis/application" ) +// TODO: cf code func (a *Application) IsEmptyTypeMeta() bool { return a.TypeMeta.Size() == 0 || a.TypeMeta.Kind == "" || a.TypeMeta.APIVersion == "" } +// TODO: cf code func (a *Application) SetDefaultTypeMeta() { a.TypeMeta = metav1.TypeMeta{ Kind: appv1reg.ApplicationKind, @@ -17,6 +19,7 @@ func (a *Application) SetDefaultTypeMeta() { } } +// TODO: cf code func (spec *ApplicationSpec) GetNonRefSource() (*ApplicationSource, int) { if spec.HasMultipleSources() { for idx, source := range spec.Sources { @@ -34,6 +37,7 @@ func (spec *ApplicationSpec) GetNonRefSource() (*ApplicationSource, int) { return spec.Source, -1 } +// TODO: cf code func (spec *ApplicationSpec) SourceUnderIdxIsHelm(idx int) bool { source := spec.GetSourcePtrByIndex(idx) diff --git a/pkg/codefresh/client.go b/pkg/codefresh/client.go index 47158f6af6fd0..afe15a62323c5 100644 --- a/pkg/codefresh/client.go +++ b/pkg/codefresh/client.go @@ -16,50 +16,109 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" +) + +type ( + CodefreshConfig struct { + BaseURL string + AuthToken string + TlsInsecure bool + CaCertPath string + RuntimeVersion string + } + + CodefreshClientInterface interface { + SendApplicationEvent(ctx context.Context, payload *ApplicationPayload) error + SendResourceEvent(ctx context.Context, payload *ResourcePayload) error + SendGraphQL(query GraphQLQuery) (*json.RawMessage, error) + } + + codefreshClient struct { + baseURL string + httpClient *http.Client + } - "github.com/argoproj/argo-cd/v2/pkg/apiclient/events" + // GraphQLQuery structure to form a GraphQL query + GraphQLQuery struct { + Query string `json:"query"` + Variables map[string]interface{} `json:"variables"` + } ) -type CodefreshConfig struct { - BaseURL string - AuthToken string - TlsInsecure bool - CaCertPath string - RuntimeVersion string +func NewCodefreshClient(cfConfig *CodefreshConfig) CodefreshClientInterface { + return &codefreshClient{ + baseURL: cfConfig.BaseURL, + httpClient: cfConfig.getHttpClient(), + } } -type CodefreshClient struct { - cfConfig *CodefreshConfig - httpClient *http.Client +func (c *codefreshClient) SendApplicationEvent(ctx context.Context, payload *ApplicationPayload) error { + err := c.sendEvent(ctx, "/2.0/api/applications", payload) + if err != nil { + return fmt.Errorf("failed to send application event: %w", err) + } + + return nil } -type CodefreshClientInterface interface { - SendEvent(ctx context.Context, appName string, event *events.Event) error - SendGraphQL(query GraphQLQuery) (*json.RawMessage, error) +func (c *codefreshClient) SendResourceEvent(ctx context.Context, payload *ResourcePayload) error { + err := c.sendEvent(ctx, "/2.0/api/resources", payload) + if err != nil { + return fmt.Errorf("failed to send resource event: %w", err) + } + + return nil } -// GraphQLQuery structure to form a GraphQL query -type GraphQLQuery struct { - Query string `json:"query"` - Variables map[string]interface{} `json:"variables"` +// sendGraphQLRequest function to send the GraphQL request and handle the response +func (c *codefreshClient) SendGraphQL(query GraphQLQuery) (*json.RawMessage, error) { + queryJSON, err := json.Marshal(query) + if err != nil { + return nil, err + } + + url, err := url.JoinPath(c.baseURL, "/2.0/api/graphql") + if err != nil { + return nil, fmt.Errorf("failed to join URL: %w", err) + } + + req, err := http.NewRequest("POST", url, bytes.NewBuffer(queryJSON)) + if err != nil { + return nil, err + } + + req.Header.Set("Content-Type", "application/json") + resp, err := c.httpClient.Do(req) + if err != nil { + return nil, err + } + + if resp.StatusCode >= 400 { + return nil, errors.New(resp.Status) + } + + defer resp.Body.Close() + + var responseStruct struct { + Data json.RawMessage `json:"data"` + } + if err := json.NewDecoder(resp.Body).Decode(&responseStruct); err != nil { + return nil, err + } + + return &responseStruct.Data, nil } -func (c *CodefreshClient) SendEvent(ctx context.Context, appName string, event *events.Event) error { +func (c *codefreshClient) sendEvent(ctx context.Context, path string, payload any) error { return WithRetry(&DefaultBackoff, func() error { - url, err := url.JoinPath(c.cfConfig.BaseURL, "/2.0/api/events") + url, err := url.JoinPath(c.baseURL, path) if err != nil { return fmt.Errorf("failed to join URL: %w", err) } - log.Infof("Sending application event for %s", appName) - - wrappedPayload := map[string]json.RawMessage{ - "data": event.Payload, - } - - newPayloadBytes, err := json.Marshal(wrappedPayload) + data, err := json.Marshal(payload) if err != nil { - return err + return fmt.Errorf("failed to marshal event: %w", err) } // Create a buffer to hold the compressed data @@ -70,87 +129,49 @@ func (c *CodefreshClient) SendEvent(ctx context.Context, appName string, event * defer gz.Close() // Write the data to the gzip writer - if _, err := gz.Write(newPayloadBytes); err != nil { - return err + if _, err := gz.Write(data); err != nil { + return fmt.Errorf("failed to write payload to gzip writer: %w", err) } + if err := gz.Close(); err != nil { - return err + return fmt.Errorf("failed to close gzip writer: %w", err) } req, err := http.NewRequestWithContext(ctx, "POST", url, io.NopCloser(&buf)) if err != nil { - return err + return fmt.Errorf("failed to create request: %w", err) } req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Encoding", "gzip") - req.Header.Set("Authorization", c.cfConfig.AuthToken) res, err := c.httpClient.Do(req) if err != nil { - return errors.Wrap(err, fmt.Sprintf("failed reporting to Codefresh, event: %s", string(event.Payload))) + return fmt.Errorf("failed reporting to Codefresh, payload: %v, error: %w", payload, err) } defer res.Body.Close() isStatusOK := res.StatusCode >= 200 && res.StatusCode < 300 if !isStatusOK { b, _ := io.ReadAll(res.Body) - return errors.Errorf("failed reporting to Codefresh, got response: status code %d and body %s, original request body: %s", - res.StatusCode, string(b), string(event.Payload)) + return errors.Errorf("failed reporting to Codefresh, got response: status code %d and body %s, payload: %v", + res.StatusCode, string(b), payload) } - log.Infof("Application event for %s successfully sent", appName) return nil }) } -// sendGraphQLRequest function to send the GraphQL request and handle the response -func (c *CodefreshClient) SendGraphQL(query GraphQLQuery) (*json.RawMessage, error) { - queryJSON, err := json.Marshal(query) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", c.cfConfig.BaseURL+"/2.0/api/graphql", bytes.NewBuffer(queryJSON)) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", "application/json") - req.Header.Set("Authorization", c.cfConfig.AuthToken) - - resp, err := c.httpClient.Do(req) - if err != nil { - return nil, err - } - if resp.StatusCode >= 400 { - return nil, errors.New(resp.Status) - } - defer resp.Body.Close() - - var responseStruct struct { - Data json.RawMessage `json:"data"` - } - if err := json.NewDecoder(resp.Body).Decode(&responseStruct); err != nil { - return nil, err - } - - return &responseStruct.Data, nil -} - -func NewCodefreshClient(cfConfig *CodefreshConfig) CodefreshClientInterface { - return &CodefreshClient{ - cfConfig: cfConfig, - httpClient: cfConfig.getHttpClient(), - } -} - func (cfConfig *CodefreshConfig) getHttpClient() *http.Client { httpClient := &http.Client{ Timeout: 30 * time.Second, - } - - httpClient.Transport = &http.Transport{ - TLSClientConfig: cfConfig.getTlsConfig(), + Transport: &http.Transport{ + TLSClientConfig: cfConfig.getTlsConfig(), + }, + CheckRedirect: func(req *http.Request, via []*http.Request) error { + req.Header.Set("Authorization", cfConfig.AuthToken) + return nil + }, } return httpClient @@ -171,10 +192,12 @@ func (cfConfig *CodefreshConfig) getTlsConfig() *tls.Config { if err != nil { log.Fatal(err) } + pool := x509.NewCertPool() if ok := pool.AppendCertsFromPEM(cert); !ok { log.Fatalf("unable to parse codefresh cert from path %s", cfConfig.CaCertPath) } + c.RootCAs = pool } diff --git a/pkg/codefresh/client_test.go b/pkg/codefresh/client_test.go index 61bc69ef53074..9a67bd66e460a 100644 --- a/pkg/codefresh/client_test.go +++ b/pkg/codefresh/client_test.go @@ -6,13 +6,12 @@ import ( "io" "net/http" "testing" - - "github.com/stretchr/testify/require" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" - - "github.com/argoproj/argo-cd/v2/pkg/apiclient/events" + "github.com/stretchr/testify/require" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type MockRoundTripper struct { @@ -31,45 +30,43 @@ func (r *MockRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) func TestCodefreshClient_SendEvent(t *testing.T) { tests := []struct { - name string - baseURL string - authToken string - payload []byte - wantErr string - beforeFn func(t *testing.T, rt *MockRoundTripper) + name string + baseURL string + payload *ApplicationPayload + wantErr string + beforeFn func(t *testing.T, rt *MockRoundTripper) }{ { - name: "should return nil when all is good", - baseURL: "http://some.host", - authToken: "some-token", - payload: []byte(`{"key": "value"}`), + name: "should return nil when all is good", + baseURL: "https://some.host", + payload: &ApplicationPayload{ + Timestamp: metav1.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), + }, beforeFn: func(t *testing.T, rt *MockRoundTripper) { rt.On("RoundTrip", mock.Anything).Run(func(args mock.Arguments) { req := args.Get(0).(*http.Request) assert.Equal(t, "POST", req.Method, "invalid request method") - assert.Equal(t, "http://some.host/2.0/api/events", req.URL.String(), "invalid request URL") - assert.Equal(t, "some-token", req.Header.Get("Authorization"), "missing or invalid Authorization header") + assert.Equal(t, "https://some.host/2.0/api/applications", req.URL.String(), "invalid request URL") assert.Equal(t, "application/json", req.Header.Get("Content-Type"), "missing or invalid Content-Type header") reader, err := gzip.NewReader(req.Body) require.NoError(t, err, "failed to create gzip reader") defer reader.Close() body, err := io.ReadAll(reader) require.NoError(t, err, "failed to read request body") - assert.JSONEq(t, `{"data":{"key":"value"}}`, string(body), "invalid request body") + assert.JSONEq(t, `{"timestamp": "2021-01-01T00:00:00Z", "actualManifest": ""}`, string(body), "invalid request body") }).Return(&http.Response{ StatusCode: 200, }, nil) }, }, { - name: "should create correct url when baseUrl ends with '/'", - baseURL: "http://some.host/", - authToken: "some-token", - payload: []byte(`{"key": "value"}`), + name: "should create correct url when baseUrl ends with '/'", + baseURL: "https://some.host/", + payload: &ApplicationPayload{}, beforeFn: func(t *testing.T, rt *MockRoundTripper) { rt.On("RoundTrip", mock.Anything).Run(func(args mock.Arguments) { req := args.Get(0).(*http.Request) - assert.Equal(t, "http://some.host/2.0/api/events", req.URL.String(), "invalid request URL") + assert.Equal(t, "https://some.host/2.0/api/applications", req.URL.String(), "invalid request URL") }).Return(&http.Response{ StatusCode: 200, }, nil) @@ -79,20 +76,14 @@ func TestCodefreshClient_SendEvent(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { mockRT := &MockRoundTripper{} - c := &CodefreshClient{ - cfConfig: &CodefreshConfig{ - BaseURL: tt.baseURL, - AuthToken: tt.authToken, - }, + c := &codefreshClient{ + baseURL: tt.baseURL, httpClient: &http.Client{ Transport: mockRT, }, } - event := &events.Event{ - Payload: tt.payload, - } tt.beforeFn(t, mockRT) - if err := c.SendEvent(context.Background(), "appName", event); err != nil || tt.wantErr != "" { + if err := c.SendApplicationEvent(context.Background(), tt.payload); err != nil || tt.wantErr != "" { assert.EqualError(t, err, tt.wantErr) } }) diff --git a/pkg/codefresh/types.go b/pkg/codefresh/types.go index cd845ad1a609f..d0d1f316c5771 100644 --- a/pkg/codefresh/types.go +++ b/pkg/codefresh/types.go @@ -1,11 +1,81 @@ package codefresh -// VersionSource structure for the versionSource field -type VersionSource struct { - File string `json:"file"` - JsonPath string `json:"jsonPath"` -} - -type PromotionTemplate struct { - VersionSource VersionSource `json:"versionSource"` -} +import ( + "github.com/argoproj/argo-cd/v2/event_reporter/utils" + appv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" + "github.com/argoproj/argo-cd/v2/reposerver/apiclient" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +type ( + // VersionSource structure for the versionSource field + VersionSource struct { + File string `json:"file"` + JsonPath string `json:"jsonPath"` + } + + PromotionTemplate struct { + VersionSource VersionSource `json:"versionSource"` + } + + Source struct { + RepoURL string `json:"repoURL"` + TargetRevision string `json:"targetRevision"` + Revisions []string `json:"revisions,omitempty"` + OperationSyncRevisions []string `json:"operationSyncRevisions,omitempty"` + CommitMessage string `json:"commitMessage"` + CommitAuthor string `json:"commitAuthor"` + CommitDate *metav1.Time `json:"commitDate,omitempty"` + ClusterServer string `json:"clusterServer"` + ClusterName *string `json:"clusterName,omitempty"` + AppName string `json:"appName"` + AppLabels map[string]string `json:"appLabels"` + AppUID types.UID `json:"appUID"` + SyncStatus appv1.SyncStatusCode `json:"syncStatus"` + SyncStartedAt metav1.Time `json:"syncStartedAt"` + SyncFinishedAt *metav1.Time `json:"syncFinishedAt,omitempty"` + HealthStatus *appv1.HealthStatus `json:"healthStatus,omitempty"` + HistoryId int64 `json:"historyId"` + AppNamespace string `json:"appNamespace"` + AppInstanceLabelKey string `json:"appInstanceLabelKey"` + TrackingMethod appv1.TrackingMethod `json:"trackingMethod"` + AppMultiSourced bool `json:"appMultiSourced"` + AppSourceIdx int32 `json:"appSourceIdx"` + } + + ErrorSourceReference struct { + Group string `json:"group"` + Version string `json:"version"` + Kind string `json:"kind"` + Name string `json:"name"` + Namespace string `json:"namespace"` + } + + EventError struct { + Type string `json:"type"` + Level string `json:"level"` + Message string `json:"message"` + LastSeen metav1.Time `json:"lastSeen"` + SourceReference *ErrorSourceReference `json:"sourceReference,omitempty"` + } + + ResourcePayload struct { + Timestamp metav1.Time `json:"timestamp"` + ActualManifest string `json:"actualManifest"` + DesiredManifest string `json:"desiredManifest"` + Source *Source `json:"source"` + AppVersions *apiclient.ApplicationVersions `json:"appVersions,omitempty"` + RevisionsMetadata *utils.AppSyncRevisionsMetadata `json:"revisionsMetadata,omitempty"` + Errors []*EventError `json:"errors,omitempty"` + } + + ApplicationPayload struct { + Timestamp metav1.Time `json:"timestamp"` + ActualManifest string `json:"actualManifest"` + AppVersions *apiclient.ApplicationVersions `json:"appVersions,omitempty"` + RevisionsMetadata *utils.AppSyncRevisionsMetadata `json:"revisionsMetadata,omitempty"` + Errors []*EventError `json:"errors,omitempty"` + } +) diff --git a/reposerver/apiclient/repository.pb.go b/reposerver/apiclient/repository.pb.go index 1b79360fa657b..c4dc6814ff410 100644 --- a/reposerver/apiclient/repository.pb.go +++ b/reposerver/apiclient/repository.pb.go @@ -691,82 +691,6 @@ func (m *ResolveRevisionResponse) GetAmbiguousRevision() string { return "" } -type Manifest struct { - // The processed manifest that needs to be applied to the cluster - CompiledManifest string `protobuf:"bytes,1,opt,name=compiledManifest,proto3" json:"compiledManifest,omitempty"` - // The pre-processed manifest (for example the kustomization.yaml - // when using kustmize or the values.yaml when using helm). - RawManifest string `protobuf:"bytes,2,opt,name=rawManifest,proto3" json:"rawManifest,omitempty"` - // The path of the raw manifest inside the repo - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - // The line in the file where the object starts - Line int32 `protobuf:"varint,4,opt,name=line,proto3" json:"line,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Manifest) Reset() { *m = Manifest{} } -func (m *Manifest) String() string { return proto.CompactTextString(m) } -func (*Manifest) ProtoMessage() {} -func (*Manifest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{8} -} -func (m *Manifest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Manifest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Manifest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Manifest) XXX_Merge(src proto.Message) { - xxx_messageInfo_Manifest.Merge(m, src) -} -func (m *Manifest) XXX_Size() int { - return m.Size() -} -func (m *Manifest) XXX_DiscardUnknown() { - xxx_messageInfo_Manifest.DiscardUnknown(m) -} - -var xxx_messageInfo_Manifest proto.InternalMessageInfo - -func (m *Manifest) GetCompiledManifest() string { - if m != nil { - return m.CompiledManifest - } - return "" -} - -func (m *Manifest) GetRawManifest() string { - if m != nil { - return m.RawManifest - } - return "" -} - -func (m *Manifest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *Manifest) GetLine() int32 { - if m != nil { - return m.Line - } - return 0 -} - type Dependencies struct { // Content of Chart.lock Lock string `protobuf:"bytes,1,opt,name=lock,proto3" json:"lock,omitempty"` @@ -783,7 +707,7 @@ func (m *Dependencies) Reset() { *m = Dependencies{} } func (m *Dependencies) String() string { return proto.CompactTextString(m) } func (*Dependencies) ProtoMessage() {} func (*Dependencies) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{9} + return fileDescriptor_dd8723cfcc820480, []int{8} } func (m *Dependencies) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -847,7 +771,7 @@ func (m *ApplicationVersions) Reset() { *m = ApplicationVersions{} } func (m *ApplicationVersions) String() string { return proto.CompactTextString(m) } func (*ApplicationVersions) ProtoMessage() {} func (*ApplicationVersions) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{10} + return fileDescriptor_dd8723cfcc820480, []int{9} } func (m *ApplicationVersions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -891,9 +815,9 @@ func (m *ApplicationVersions) GetDependencies() *Dependencies { } type ManifestResponse struct { - Manifests []*Manifest `protobuf:"bytes,1,rep,name=manifests,proto3" json:"manifests,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Server string `protobuf:"bytes,3,opt,name=server,proto3" json:"server,omitempty"` + Manifests []string `protobuf:"bytes,1,rep,name=manifests,proto3" json:"manifests,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Server string `protobuf:"bytes,3,opt,name=server,proto3" json:"server,omitempty"` // resolved revision Revision string `protobuf:"bytes,4,opt,name=revision,proto3" json:"revision,omitempty"` SourceType string `protobuf:"bytes,6,opt,name=sourceType,proto3" json:"sourceType,omitempty"` @@ -903,8 +827,10 @@ type ManifestResponse struct { CommitAuthor string `protobuf:"bytes,9,opt,name=commitAuthor,proto3" json:"commitAuthor,omitempty"` CommitDate *v1.Time `protobuf:"bytes,10,opt,name=commitDate,proto3" json:"commitDate,omitempty"` // A version of the application and its dependencies + // TODO: cf ApplicationVersions *ApplicationVersions `protobuf:"bytes,11,opt,name=applicationVersions,proto3" json:"applicationVersions,omitempty"` // for multisourced apps will be [0,12,20], so this means that 0-11 - from first app source, 12-19 from second one, 20-x - third one + // TODO: cf SourcesManifestsStartingIdx []int32 `protobuf:"varint,12,rep,packed,name=sourcesManifestsStartingIdx,proto3" json:"sourcesManifestsStartingIdx,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -915,7 +841,7 @@ func (m *ManifestResponse) Reset() { *m = ManifestResponse{} } func (m *ManifestResponse) String() string { return proto.CompactTextString(m) } func (*ManifestResponse) ProtoMessage() {} func (*ManifestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{11} + return fileDescriptor_dd8723cfcc820480, []int{10} } func (m *ManifestResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -944,7 +870,7 @@ func (m *ManifestResponse) XXX_DiscardUnknown() { var xxx_messageInfo_ManifestResponse proto.InternalMessageInfo -func (m *ManifestResponse) GetManifests() []*Manifest { +func (m *ManifestResponse) GetManifests() []string { if m != nil { return m.Manifests } @@ -1032,7 +958,7 @@ func (m *ListRefsRequest) Reset() { *m = ListRefsRequest{} } func (m *ListRefsRequest) String() string { return proto.CompactTextString(m) } func (*ListRefsRequest) ProtoMessage() {} func (*ListRefsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{12} + return fileDescriptor_dd8723cfcc820480, []int{11} } func (m *ListRefsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1081,7 +1007,7 @@ func (m *Refs) Reset() { *m = Refs{} } func (m *Refs) String() string { return proto.CompactTextString(m) } func (*Refs) ProtoMessage() {} func (*Refs) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{13} + return fileDescriptor_dd8723cfcc820480, []int{12} } func (m *Refs) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1138,7 +1064,7 @@ func (m *ListAppsRequest) Reset() { *m = ListAppsRequest{} } func (m *ListAppsRequest) String() string { return proto.CompactTextString(m) } func (*ListAppsRequest) ProtoMessage() {} func (*ListAppsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{14} + return fileDescriptor_dd8723cfcc820480, []int{13} } func (m *ListAppsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1200,7 +1126,7 @@ func (m *AppList) Reset() { *m = AppList{} } func (m *AppList) String() string { return proto.CompactTextString(m) } func (*AppList) ProtoMessage() {} func (*AppList) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{15} + return fileDescriptor_dd8723cfcc820480, []int{14} } func (m *AppList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1247,7 +1173,7 @@ func (m *PluginInfo) Reset() { *m = PluginInfo{} } func (m *PluginInfo) String() string { return proto.CompactTextString(m) } func (*PluginInfo) ProtoMessage() {} func (*PluginInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{16} + return fileDescriptor_dd8723cfcc820480, []int{15} } func (m *PluginInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1295,7 +1221,7 @@ func (m *PluginList) Reset() { *m = PluginList{} } func (m *PluginList) String() string { return proto.CompactTextString(m) } func (*PluginList) ProtoMessage() {} func (*PluginList) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{17} + return fileDescriptor_dd8723cfcc820480, []int{16} } func (m *PluginList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1353,7 +1279,7 @@ func (m *RepoServerAppDetailsQuery) Reset() { *m = RepoServerAppDetailsQ func (m *RepoServerAppDetailsQuery) String() string { return proto.CompactTextString(m) } func (*RepoServerAppDetailsQuery) ProtoMessage() {} func (*RepoServerAppDetailsQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{18} + return fileDescriptor_dd8723cfcc820480, []int{17} } func (m *RepoServerAppDetailsQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1475,7 +1401,7 @@ func (m *RepoAppDetailsResponse) Reset() { *m = RepoAppDetailsResponse{} func (m *RepoAppDetailsResponse) String() string { return proto.CompactTextString(m) } func (*RepoAppDetailsResponse) ProtoMessage() {} func (*RepoAppDetailsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{19} + return fileDescriptor_dd8723cfcc820480, []int{18} } func (m *RepoAppDetailsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1555,7 +1481,7 @@ func (m *RepoServerRevisionMetadataRequest) Reset() { *m = RepoServerRev func (m *RepoServerRevisionMetadataRequest) String() string { return proto.CompactTextString(m) } func (*RepoServerRevisionMetadataRequest) ProtoMessage() {} func (*RepoServerRevisionMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{20} + return fileDescriptor_dd8723cfcc820480, []int{19} } func (m *RepoServerRevisionMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1621,7 +1547,7 @@ func (m *RepoServerRevisionChartDetailsRequest) Reset() { *m = RepoServe func (m *RepoServerRevisionChartDetailsRequest) String() string { return proto.CompactTextString(m) } func (*RepoServerRevisionChartDetailsRequest) ProtoMessage() {} func (*RepoServerRevisionChartDetailsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{21} + return fileDescriptor_dd8723cfcc820480, []int{20} } func (m *RepoServerRevisionChartDetailsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1690,7 +1616,7 @@ func (m *HelmAppSpec) Reset() { *m = HelmAppSpec{} } func (m *HelmAppSpec) String() string { return proto.CompactTextString(m) } func (*HelmAppSpec) ProtoMessage() {} func (*HelmAppSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{22} + return fileDescriptor_dd8723cfcc820480, []int{21} } func (m *HelmAppSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1767,7 +1693,7 @@ func (m *KustomizeAppSpec) Reset() { *m = KustomizeAppSpec{} } func (m *KustomizeAppSpec) String() string { return proto.CompactTextString(m) } func (*KustomizeAppSpec) ProtoMessage() {} func (*KustomizeAppSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{23} + return fileDescriptor_dd8723cfcc820480, []int{22} } func (m *KustomizeAppSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1814,7 +1740,7 @@ func (m *DirectoryAppSpec) Reset() { *m = DirectoryAppSpec{} } func (m *DirectoryAppSpec) String() string { return proto.CompactTextString(m) } func (*DirectoryAppSpec) ProtoMessage() {} func (*DirectoryAppSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{24} + return fileDescriptor_dd8723cfcc820480, []int{23} } func (m *DirectoryAppSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1874,7 +1800,7 @@ func (m *ParameterAnnouncement) Reset() { *m = ParameterAnnouncement{} } func (m *ParameterAnnouncement) String() string { return proto.CompactTextString(m) } func (*ParameterAnnouncement) ProtoMessage() {} func (*ParameterAnnouncement) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{25} + return fileDescriptor_dd8723cfcc820480, []int{24} } func (m *ParameterAnnouncement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1978,7 +1904,7 @@ func (m *PluginAppSpec) Reset() { *m = PluginAppSpec{} } func (m *PluginAppSpec) String() string { return proto.CompactTextString(m) } func (*PluginAppSpec) ProtoMessage() {} func (*PluginAppSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{26} + return fileDescriptor_dd8723cfcc820480, []int{25} } func (m *PluginAppSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2025,7 +1951,7 @@ func (m *HelmChartsRequest) Reset() { *m = HelmChartsRequest{} } func (m *HelmChartsRequest) String() string { return proto.CompactTextString(m) } func (*HelmChartsRequest) ProtoMessage() {} func (*HelmChartsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{27} + return fileDescriptor_dd8723cfcc820480, []int{26} } func (m *HelmChartsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2073,7 +1999,7 @@ func (m *HelmChart) Reset() { *m = HelmChart{} } func (m *HelmChart) String() string { return proto.CompactTextString(m) } func (*HelmChart) ProtoMessage() {} func (*HelmChart) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{28} + return fileDescriptor_dd8723cfcc820480, []int{27} } func (m *HelmChart) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2127,7 +2053,7 @@ func (m *HelmChartsResponse) Reset() { *m = HelmChartsResponse{} } func (m *HelmChartsResponse) String() string { return proto.CompactTextString(m) } func (*HelmChartsResponse) ProtoMessage() {} func (*HelmChartsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{29} + return fileDescriptor_dd8723cfcc820480, []int{28} } func (m *HelmChartsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2180,7 +2106,7 @@ func (m *GitFilesRequest) Reset() { *m = GitFilesRequest{} } func (m *GitFilesRequest) String() string { return proto.CompactTextString(m) } func (*GitFilesRequest) ProtoMessage() {} func (*GitFilesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{30} + return fileDescriptor_dd8723cfcc820480, []int{29} } func (m *GitFilesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2270,7 +2196,7 @@ func (m *GitFilesResponse) Reset() { *m = GitFilesResponse{} } func (m *GitFilesResponse) String() string { return proto.CompactTextString(m) } func (*GitFilesResponse) ProtoMessage() {} func (*GitFilesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{31} + return fileDescriptor_dd8723cfcc820480, []int{30} } func (m *GitFilesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2321,7 +2247,7 @@ func (m *GitDirectoriesRequest) Reset() { *m = GitDirectoriesRequest{} } func (m *GitDirectoriesRequest) String() string { return proto.CompactTextString(m) } func (*GitDirectoriesRequest) ProtoMessage() {} func (*GitDirectoriesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{32} + return fileDescriptor_dd8723cfcc820480, []int{31} } func (m *GitDirectoriesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2397,7 +2323,7 @@ func (m *GitDirectoriesResponse) Reset() { *m = GitDirectoriesResponse{} func (m *GitDirectoriesResponse) String() string { return proto.CompactTextString(m) } func (*GitDirectoriesResponse) ProtoMessage() {} func (*GitDirectoriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{33} + return fileDescriptor_dd8723cfcc820480, []int{32} } func (m *GitDirectoriesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2457,7 +2383,7 @@ func (m *UpdateRevisionForPathsRequest) Reset() { *m = UpdateRevisionFor func (m *UpdateRevisionForPathsRequest) String() string { return proto.CompactTextString(m) } func (*UpdateRevisionForPathsRequest) ProtoMessage() {} func (*UpdateRevisionForPathsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{34} + return fileDescriptor_dd8723cfcc820480, []int{33} } func (m *UpdateRevisionForPathsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2596,7 +2522,7 @@ func (m *UpdateRevisionForPathsResponse) Reset() { *m = UpdateRevisionFo func (m *UpdateRevisionForPathsResponse) String() string { return proto.CompactTextString(m) } func (*UpdateRevisionForPathsResponse) ProtoMessage() {} func (*UpdateRevisionForPathsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{35} + return fileDescriptor_dd8723cfcc820480, []int{34} } func (m *UpdateRevisionForPathsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2655,7 +2581,7 @@ func (m *ChangeRevisionRequest) Reset() { *m = ChangeRevisionRequest{} } func (m *ChangeRevisionRequest) String() string { return proto.CompactTextString(m) } func (*ChangeRevisionRequest) ProtoMessage() {} func (*ChangeRevisionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{36} + return fileDescriptor_dd8723cfcc820480, []int{35} } func (m *ChangeRevisionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2737,7 +2663,7 @@ func (m *ChangeRevisionResponse) Reset() { *m = ChangeRevisionResponse{} func (m *ChangeRevisionResponse) String() string { return proto.CompactTextString(m) } func (*ChangeRevisionResponse) ProtoMessage() {} func (*ChangeRevisionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd8723cfcc820480, []int{37} + return fileDescriptor_dd8723cfcc820480, []int{36} } func (m *ChangeRevisionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2784,7 +2710,6 @@ func init() { proto.RegisterType((*TestRepositoryResponse)(nil), "repository.TestRepositoryResponse") proto.RegisterType((*ResolveRevisionRequest)(nil), "repository.ResolveRevisionRequest") proto.RegisterType((*ResolveRevisionResponse)(nil), "repository.ResolveRevisionResponse") - proto.RegisterType((*Manifest)(nil), "repository.Manifest") proto.RegisterType((*Dependencies)(nil), "repository.Dependencies") proto.RegisterType((*ApplicationVersions)(nil), "repository.ApplicationVersions") proto.RegisterType((*ManifestResponse)(nil), "repository.ManifestResponse") @@ -2828,175 +2753,172 @@ func init() { } var fileDescriptor_dd8723cfcc820480 = []byte{ - // 2690 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x1a, 0x4d, 0x6f, 0x1c, 0x49, - 0xd5, 0xf3, 0xe9, 0x99, 0x37, 0xfe, 0xac, 0xd8, 0x4e, 0x67, 0x76, 0x63, 0xbc, 0xcd, 0x6e, 0xe4, - 0xf5, 0xee, 0xce, 0x60, 0xef, 0x27, 0xd9, 0xb0, 0xe0, 0x75, 0x12, 0x3b, 0x1f, 0x4e, 0xbc, 0x9d, - 0xec, 0xa2, 0x2c, 0x01, 0x54, 0xd3, 0x53, 0x9e, 0xe9, 0x4c, 0x7f, 0x54, 0xba, 0x7b, 0x9c, 0x75, - 0x24, 0x24, 0x24, 0x10, 0x1c, 0xb8, 0x23, 0xc1, 0x0d, 0xf1, 0x1b, 0x10, 0x47, 0x4e, 0x08, 0x4e, - 0x08, 0x71, 0x41, 0xe2, 0x02, 0xca, 0x2f, 0x41, 0xf5, 0xd1, 0xdd, 0xd5, 0x3d, 0xed, 0xb1, 0x17, - 0x27, 0x5e, 0xe0, 0x62, 0x57, 0xbd, 0x7e, 0xf5, 0xea, 0xd5, 0xfb, 0xaa, 0xf7, 0x5e, 0x0d, 0x5c, - 0xf2, 0x09, 0xf5, 0x02, 0xe2, 0x1f, 0x10, 0xbf, 0xcd, 0x87, 0x56, 0xe8, 0xf9, 0x87, 0xca, 0xb0, - 0x45, 0x7d, 0x2f, 0xf4, 0x10, 0x24, 0x90, 0xa6, 0x3e, 0xf8, 0x20, 0x68, 0x59, 0x5e, 0x1b, 0x53, - 0xab, 0x6d, 0x7a, 0x3e, 0x69, 0x1f, 0xac, 0xb7, 0x7b, 0xc4, 0x25, 0x3e, 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, 0xb3, 0x4f, 0xcc, 0x41, 0x30, 0x74, 0xa4, 0x98, 0xe3, 0x39, - 0x42, 0x50, 0x0e, 0xac, 0xa7, 0x42, 0xd4, 0x25, 0x83, 0x8f, 0xf5, 0xd7, 0x61, 0x7e, 0x64, 0x37, - 0xa6, 0x54, 0xc1, 0x1b, 0xa3, 0x30, 0x25, 0xb7, 0xd6, 0x87, 0xb0, 0x78, 0x9f, 0xcb, 0x22, 0xbe, - 0x50, 0xce, 0x22, 0x3b, 0xd0, 0x77, 0x60, 0x29, 0xbb, 0x6d, 0x40, 0x3d, 0x37, 0x20, 0xcc, 0xf4, - 0x79, 0x04, 0xb6, 0x48, 0x37, 0xf9, 0xca, 0xb9, 0xa8, 0x19, 0x39, 0x5f, 0xf4, 0xdf, 0x16, 0x61, - 0xc9, 0x20, 0x81, 0x67, 0x1f, 0x90, 0x28, 0x3c, 0x9e, 0x4d, 0x82, 0xf3, 0x3d, 0x28, 0x61, 0x4a, - 0xa5, 0x99, 0xdc, 0x78, 0x6e, 0x29, 0x84, 0xc1, 0xa8, 0xa2, 0x37, 0x61, 0x1e, 0x3b, 0x1d, 0xab, - 0x37, 0xf4, 0x86, 0x41, 0x74, 0x2c, 0x6e, 0x54, 0x75, 0x63, 0xf4, 0x03, 0x73, 0xff, 0x80, 0x7b, - 0xe4, 0x0d, 0xb7, 0x4b, 0xbe, 0xe0, 0x59, 0x53, 0xc9, 0x50, 0x41, 0xba, 0x09, 0xe7, 0x47, 0x84, - 0x24, 0x05, 0xae, 0x26, 0x6a, 0x85, 0x4c, 0xa2, 0x96, 0xcb, 0x46, 0xf1, 0x08, 0x36, 0xf4, 0x1f, - 0x17, 0xa0, 0x16, 0xd9, 0x1d, 0x5a, 0x83, 0x39, 0xd3, 0x73, 0xa8, 0x65, 0x93, 0x6e, 0x04, 0x93, - 0xe4, 0x47, 0xe0, 0x8c, 0x7f, 0x1f, 0x3f, 0x89, 0xd1, 0xc4, 0x06, 0x2a, 0x88, 0x59, 0x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d, 0x56, 0x9f, 0x40, - 0xbf, 0x2e, 0xc0, 0x79, 0x85, 0x31, 0xb5, 0xa5, 0x80, 0xd6, 0xc7, 0x33, 0x97, 0xd3, 0x7e, 0x68, - 0xde, 0x3c, 0xe5, 0x4f, 0xa9, 0x14, 0x92, 0xfa, 0x04, 0xda, 0xe3, 0x3a, 0x49, 0x2a, 0x08, 0x74, - 0x31, 0xb7, 0x54, 0x88, 0x77, 0x5f, 0x3e, 0xea, 0x73, 0xac, 0x87, 0x9b, 0xd0, 0xd8, 0x26, 0x61, - 0x94, 0xca, 0xa6, 0x2d, 0x2d, 0x53, 0x65, 0xa4, 0x5d, 0x35, 0x9b, 0xfd, 0x72, 0x8b, 0x99, 0x17, - 0xb4, 0x94, 0x74, 0x2d, 0xed, 0xab, 0xb9, 0x79, 0x6d, 0xda, 0x62, 0xf2, 0xb3, 0x3d, 0x7d, 0x02, - 0x3d, 0x86, 0xa5, 0xfc, 0xcb, 0x07, 0xbd, 0x7e, 0xe2, 0xf4, 0xa2, 0xb9, 0x76, 0x12, 0xd4, 0xcc, - 0x81, 0xd2, 0xe1, 0x37, 0x7d, 0xa0, 0xdc, 0x5b, 0x2b, 0x7d, 0xa0, 0xfc, 0xe8, 0xad, 0x4f, 0x7c, - 0xbc, 0xf9, 0xe7, 0x67, 0xcb, 0x85, 0xbf, 0x3e, 0x5b, 0x2e, 0xfc, 0xeb, 0xd9, 0x72, 0xe1, 0xf3, - 0xb7, 0x8f, 0xf9, 0x41, 0xa7, 0xf2, 0xeb, 0x53, 0x4c, 0x2d, 0xd3, 0xb6, 0x88, 0x1b, 0x76, 0xaa, - 0xdc, 0x9b, 0xdf, 0xfe, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2a, 0xb4, 0x26, 0x19, 0x9c, 0x2a, + // 2642 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x3a, 0xcd, 0x73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 0x63, 0xa7, 0x17, 0x8d, 0x4b, 0xc7, 0x59, 0x9a, + 0xb9, 0x50, 0xda, 0xfd, 0xa6, 0x2f, 0x94, 0x1b, 0xb5, 0xd2, 0x17, 0xca, 0xf7, 0xde, 0xe6, 0xc4, + 0xc7, 0x1b, 0x7f, 0x7c, 0xbe, 0x5c, 0xf8, 0xf3, 0xf3, 0xe5, 0xc2, 0x3f, 0x9e, 0x2f, 0x17, 0x3e, + 0xbf, 0x7c, 0xc4, 0xef, 0x26, 0xb5, 0x1f, 0x79, 0x62, 0xea, 0xd8, 0x03, 0x87, 0x78, 0xac, 0x5d, + 0x11, 0xd6, 0x7c, 0xf9, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xf2, 0xdf, 0x41, 0x03, 0x2a, 0x00, 0x00, } @@ -4305,59 +4227,6 @@ func (m *ResolveRevisionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *Manifest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Manifest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Manifest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Line != 0 { - i = encodeVarintRepository(dAtA, i, uint64(m.Line)) - i-- - dAtA[i] = 0x20 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintRepository(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x1a - } - if len(m.RawManifest) > 0 { - i -= len(m.RawManifest) - copy(dAtA[i:], m.RawManifest) - i = encodeVarintRepository(dAtA, i, uint64(len(m.RawManifest))) - i-- - dAtA[i] = 0x12 - } - if len(m.CompiledManifest) > 0 { - i -= len(m.CompiledManifest) - copy(dAtA[i:], m.CompiledManifest) - i = encodeVarintRepository(dAtA, i, uint64(len(m.CompiledManifest))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Dependencies) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -4570,14 +4439,9 @@ func (m *ManifestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { } if len(m.Manifests) > 0 { for iNdEx := len(m.Manifests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Manifests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRepository(dAtA, i, uint64(size)) - } + i -= len(m.Manifests[iNdEx]) + copy(dAtA[i:], m.Manifests[iNdEx]) + i = encodeVarintRepository(dAtA, i, uint64(len(m.Manifests[iNdEx]))) i-- dAtA[i] = 0xa } @@ -6501,33 +6365,6 @@ func (m *ResolveRevisionResponse) Size() (n int) { return n } -func (m *Manifest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CompiledManifest) - if l > 0 { - n += 1 + l + sovRepository(uint64(l)) - } - l = len(m.RawManifest) - if l > 0 { - n += 1 + l + sovRepository(uint64(l)) - } - l = len(m.Path) - if l > 0 { - n += 1 + l + sovRepository(uint64(l)) - } - if m.Line != 0 { - n += 1 + sovRepository(uint64(m.Line)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - func (m *Dependencies) Size() (n int) { if m == nil { return 0 @@ -6579,8 +6416,8 @@ func (m *ManifestResponse) Size() (n int) { var l int _ = l if len(m.Manifests) > 0 { - for _, e := range m.Manifests { - l = e.Size() + for _, s := range m.Manifests { + l = len(s) n += 1 + l + sovRepository(uint64(l)) } } @@ -9098,172 +8935,6 @@ func (m *ResolveRevisionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Manifest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRepository - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Manifest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Manifest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CompiledManifest", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRepository - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRepository - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRepository - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CompiledManifest = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RawManifest", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRepository - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRepository - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRepository - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RawManifest = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRepository - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthRepository - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRepository - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType) - } - m.Line = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRepository - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Line |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipRepository(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRepository - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Dependencies) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -9563,7 +9234,7 @@ func (m *ManifestResponse) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Manifests", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRepository @@ -9573,25 +9244,23 @@ func (m *ManifestResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthRepository } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthRepository } if postIndex > l { return io.ErrUnexpectedEOF } - m.Manifests = append(m.Manifests, &Manifest{}) - if err := m.Manifests[len(m.Manifests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Manifests = append(m.Manifests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/reposerver/apiclient/util.go b/reposerver/apiclient/util.go deleted file mode 100644 index f060911b8cf43..0000000000000 --- a/reposerver/apiclient/util.go +++ /dev/null @@ -1,9 +0,0 @@ -package apiclient - -func (m *ManifestResponse) GetCompiledManifests() []string { - manifests := make([]string, len(m.Manifests)) - for i, m := range m.Manifests { - manifests[i] = m.CompiledManifest - } - return manifests -} diff --git a/reposerver/cache/cache_test.go b/reposerver/cache/cache_test.go index c6fd54cf46612..ea0b8d43a939d 100644 --- a/reposerver/cache/cache_test.go +++ b/reposerver/cache/cache_test.go @@ -186,11 +186,7 @@ func TestCachedManifestResponse_HashBehavior(t *testing.T) { response := apiclient.ManifestResponse{ Namespace: "default", Revision: "revision", - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: "sample-text", - }, - }, + Manifests: []string{"sample-text"}, } appSrc := &appv1.ApplicationSource{} appKey := "key" @@ -290,9 +286,9 @@ func TestCachedManifestResponse_ShallowCopy(t *testing.T) { CacheEntryHash: "value", FirstFailureTimestamp: 1, ManifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - {CompiledManifest: "one"}, - {CompiledManifest: "two"}, + Manifests: []string{ + "one", + "two", }, }, MostRecentError: "error", @@ -307,9 +303,9 @@ func TestCachedManifestResponse_ShallowCopy(t *testing.T) { CacheEntryHash: "diff-value", FirstFailureTimestamp: 1, ManifestResponse: &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - {CompiledManifest: "one"}, - {CompiledManifest: "two"}, + Manifests: []string{ + "one", + "two", }, }, MostRecentError: "error", diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index dd6f79c093004..253a596e6f695 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -277,13 +277,6 @@ type operationSettings struct { allowConcurrent bool } -type manifest struct { - obj *unstructured.Unstructured - rawManifest []byte - path string - line int -} - // operationContext contains request values which are generated by runRepoOperation (on demand) by a call to the // provided operationContextSrc function. type operationContext struct { @@ -1203,7 +1196,7 @@ func isSourcePermitted(url string, repos []string) bool { return p.IsSourcePermitted(v1alpha1.ApplicationSource{RepoURL: url}) } -func helmTemplate(appPath string, repoRoot string, env *v1alpha1.Env, q *apiclient.ManifestRequest, isLocal bool, gitRepoPaths io.TempPaths) ([]manifest, error) { +func helmTemplate(appPath string, repoRoot string, env *v1alpha1.Env, q *apiclient.ManifestRequest, isLocal bool, gitRepoPaths io.TempPaths) ([]*unstructured.Unstructured, error) { concurrencyAllowed := helmConcurrencyDefault || isConcurrencyAllowed(appPath) if !concurrencyAllowed { manifestGenerateLock.Lock(appPath) @@ -1350,39 +1343,7 @@ func helmTemplate(appPath string, repoRoot string, env *v1alpha1.Env, q *apiclie return nil, err } } - - chartBytes := []byte{} - - // try to read Chart.yaml file - chartRelPath, err := filepath.Rel(repoRoot, filepath.Join(appPath, "Chart.yaml")) - if err == nil { - data, err := os.ReadFile(chartRelPath) - if err == nil { - chartBytes = data - } - } - - objects, err := kube.SplitYAML([]byte(out)) - if err != nil { - return nil, fmt.Errorf("failed to split helm resources: %w", err) - } - - jsonObjs, err := expandUnstructuredObjs(objects) - if err != nil { - return nil, err - } - - manifests := make([]manifest, len(jsonObjs)) - for i, obj := range jsonObjs { - manifests[i] = manifest{ - rawManifest: chartBytes, - obj: obj, - path: chartRelPath, - line: 1, - } - } - - return manifests, nil + return kube.SplitYAML([]byte(out)) } func getResolvedValueFiles( @@ -1515,11 +1476,7 @@ func WithCMPTarExcludedGlobs(excludedGlobs []string) GenerateManifestOpt { // GenerateManifests generates manifests from a path. Overrides are applied as a side effect on the given ApplicationSource. func GenerateManifests(ctx context.Context, appPath, repoRoot, revision string, q *apiclient.ManifestRequest, codefreshApplicationVersioningEnabled bool, versionConfig *version_config_manager.VersionConfig, isLocal bool, gitCredsStore git.CredsStore, gitClient git.Client, maxCombinedManifestQuantity resource.Quantity, gitRepoPaths io.TempPaths, opts ...GenerateManifestOpt) (*apiclient.ManifestResponse, error) { opt := newGenerateManifestOpt(opts...) - - var ( - manifests []manifest - dest *v1alpha1.ApplicationDestination - ) + var targetObjs []*unstructured.Unstructured resourceTracking := argo.NewResourceTracking() @@ -1536,22 +1493,21 @@ func GenerateManifests(ctx context.Context, appPath, repoRoot, revision string, switch appSourceType { case v1alpha1.ApplicationSourceTypeHelm: - manifests, err = helmTemplate(appPath, repoRoot, env, q, isLocal, gitRepoPaths) + targetObjs, err = helmTemplate(appPath, repoRoot, env, q, isLocal, gitRepoPaths) case v1alpha1.ApplicationSourceTypeKustomize: kustomizeBinary := "" if q.KustomizeOptions != nil { kustomizeBinary = q.KustomizeOptions.BinaryPath } k := kustomize.NewKustomizeApp(repoRoot, appPath, q.Repo.GetGitCreds(gitCredsStore), repoURL, kustomizeBinary) - manifests, err = kustomizeBuild(k, repoRoot, appPath, q.ApplicationSource.Kustomize, q.KustomizeOptions, env, q.Namespace) + targetObjs, _, err = k.Build(q.ApplicationSource.Kustomize, q.KustomizeOptions, env, q.Namespace) case v1alpha1.ApplicationSourceTypePlugin: pluginName := "" if q.ApplicationSource.Plugin != nil { pluginName = q.ApplicationSource.Plugin.Name } - log.Infof("running plugin sidecar for app %s, revision %s", q.AppName, q.Revision) // if pluginName is provided it has to be `-` or just `` if plugin version is empty - manifests, err = runConfigManagementPluginSidecars(ctx, appPath, repoRoot, pluginName, env, q, opt.cmpTarDoneCh, opt.cmpTarExcludedGlobs) + targetObjs, err = runConfigManagementPluginSidecars(ctx, appPath, repoRoot, pluginName, env, q, opt.cmpTarDoneCh, opt.cmpTarExcludedGlobs) if err != nil { err = fmt.Errorf("plugin sidecar failed. %s", err.Error()) } @@ -1561,36 +1517,54 @@ func GenerateManifests(ctx context.Context, appPath, repoRoot, revision string, directory = &v1alpha1.ApplicationSourceDirectory{} } logCtx := log.WithField("application", q.AppName) - manifests, err = findManifests(logCtx, appPath, repoRoot, env, *directory, q.EnabledSourceTypes, maxCombinedManifestQuantity) + targetObjs, err = findManifests(logCtx, appPath, repoRoot, env, *directory, q.EnabledSourceTypes, maxCombinedManifestQuantity) } if err != nil { return nil, err } - resManifests := make([]*apiclient.Manifest, len(manifests)) - for i, m := range manifests { - if q.AppLabelKey != "" && q.AppName != "" && !kube.IsCRD(m.obj) { - err = resourceTracking.SetAppInstance(m.obj, q.AppLabelKey, q.AppName, q.Namespace, v1alpha1.TrackingMethod(q.TrackingMethod)) + manifests := make([]string, 0) + for _, obj := range targetObjs { + if obj == nil { + continue + } + + var targets []*unstructured.Unstructured + if obj.IsList() { + err = obj.EachListItem(func(object runtime.Object) error { + unstructuredObj, ok := object.(*unstructured.Unstructured) + if ok { + targets = append(targets, unstructuredObj) + return nil + } + return fmt.Errorf("resource list item has unexpected type") + }) if err != nil { return nil, err } + } else if isNullList(obj) { + // noop + } else { + targets = []*unstructured.Unstructured{obj} } - manifestStr, err := json.Marshal(m.obj) - if err != nil { - return nil, err - } - - resManifests[i] = &apiclient.Manifest{ - CompiledManifest: string(manifestStr), - RawManifest: string(m.rawManifest), - Path: m.path, - Line: int32(m.line), + for _, target := range targets { + if q.AppLabelKey != "" && q.AppName != "" && !kube.IsCRD(target) { + err = resourceTracking.SetAppInstance(target, q.AppLabelKey, q.AppName, q.Namespace, v1alpha1.TrackingMethod(q.TrackingMethod)) + if err != nil { + return nil, fmt.Errorf("failed to set app instance tracking info on manifest: %w", err) + } + } + manifestStr, err := json.Marshal(target.Object) + if err != nil { + return nil, err + } + manifests = append(manifests, string(manifestStr)) } } res := apiclient.ManifestResponse{ - Manifests: resManifests, + Manifests: manifests, SourceType: string(appSourceType), } @@ -1633,10 +1607,7 @@ func GenerateManifests(ctx context.Context, appPath, repoRoot, revision string, } else { log.Warnf("failed to retrieve git information, app name: %q, because git client is nil", q.AppName) } - if dest != nil { - res.Namespace = dest.Namespace - res.Server = dest.Server - } + return &res, nil } @@ -1769,49 +1740,10 @@ func isNullList(obj *unstructured.Unstructured) bool { return field == nil } -func kustomizeBuild( - k kustomize.Kustomize, - repoRoot string, - appPath string, - opts *v1alpha1.ApplicationSourceKustomize, - kustomizeOptions *v1alpha1.KustomizeOptions, - env *v1alpha1.Env, - namespace string, -) ([]manifest, error) { - var targetObjs []*unstructured.Unstructured - - rawBytes, err := os.ReadFile(filepath.Join(appPath, "kustomization.yaml")) - if err != nil { - return nil, err - } - relPath, _ := filepath.Rel(repoRoot, appPath) - targetObjs, _, err = k.Build(opts, kustomizeOptions, env, namespace) - if err != nil { - return nil, err - } - - jsonObjs, err := expandUnstructuredObjs(targetObjs) - if err != nil { - return nil, err - } - - manifests := make([]manifest, len(jsonObjs)) - for i, obj := range jsonObjs { - manifests[i] = manifest{ - rawManifest: rawBytes, - obj: obj, - path: relPath, - line: 0, - } - } - - return manifests, nil -} - var manifestFile = regexp.MustCompile(`^.*\.(yaml|yml|json|jsonnet)$`) // findManifests looks at all yaml files in a directory and unmarshals them into a list of unstructured objects -func findManifests(logCtx *log.Entry, appPath string, repoRoot string, env *v1alpha1.Env, directory v1alpha1.ApplicationSourceDirectory, enabledManifestGeneration map[string]bool, maxCombinedManifestQuantity resource.Quantity) ([]manifest, error) { +func findManifests(logCtx *log.Entry, appPath string, repoRoot string, env *v1alpha1.Env, directory v1alpha1.ApplicationSourceDirectory, enabledManifestGeneration map[string]bool, maxCombinedManifestQuantity resource.Quantity) ([]*unstructured.Unstructured, error) { // Validate the directory before loading any manifests to save memory. potentiallyValidManifests, err := getPotentiallyValidManifests(logCtx, appPath, repoRoot, directory.Recurse, directory.Include, directory.Exclude, maxCombinedManifestQuantity) if err != nil { @@ -1819,21 +1751,12 @@ func findManifests(logCtx *log.Entry, appPath string, repoRoot string, env *v1al return nil, fmt.Errorf("failed to get potentially valid manifests: %w", err) } - absRepoRoot, err := filepath.Abs(repoRoot) - if err != nil { - return nil, err - } - var manifests []manifest + var objs []*unstructured.Unstructured for _, potentiallyValidManifest := range potentiallyValidManifests { manifestPath := potentiallyValidManifest.path manifestFileInfo := potentiallyValidManifest.fileInfo - absPath, _ := filepath.Abs(manifestPath) - - repoRelPath, _ := filepath.Rel(absRepoRoot, absPath) - if strings.HasSuffix(manifestFileInfo.Name(), ".jsonnet") { - var objs []*unstructured.Unstructured if !discovery.IsManifestGenerationEnabled(v1alpha1.ApplicationSourceTypeDirectory, enabledManifestGeneration) { continue } @@ -1841,10 +1764,6 @@ func findManifests(logCtx *log.Entry, appPath string, repoRoot string, env *v1al if err != nil { return nil, err } - rawBytes, err := os.ReadFile(manifestPath) - if err != nil { - return nil, err - } jsonStr, err := vm.EvaluateFile(manifestPath) if err != nil { return nil, status.Errorf(codes.FailedPrecondition, "Failed to evaluate jsonnet %q: %v", manifestFileInfo.Name(), err) @@ -1863,39 +1782,15 @@ func findManifests(logCtx *log.Entry, appPath string, repoRoot string, env *v1al } objs = append(objs, &jsonObj) } - - for _, obj := range objs { - manifests = append(manifests, manifest{ - rawManifest: rawBytes, - obj: obj, - path: repoRelPath, - line: 1, // TODO: can add later - }) - } } else { - var objs []*unstructured.Unstructured err := getObjsFromYAMLOrJson(logCtx, manifestPath, manifestFileInfo.Name(), &objs) if err != nil { return nil, err } - - rawBytes, err := os.ReadFile(manifestPath) - if err != nil { - return nil, err - } - - for _, obj := range objs { - manifests = append(manifests, manifest{ - rawManifest: rawBytes, - obj: obj, - path: repoRelPath, - line: 1, // TODO: can add later - }) - } } } - return manifests, nil + return objs, nil } // getObjsFromYAMLOrJson unmarshals the given yaml or json file and appends it to the given list of objects. @@ -2087,31 +1982,6 @@ func getPotentiallyValidManifests(logCtx *log.Entry, appPath string, repoRoot st return potentiallyValidManifests, nil } -func expandUnstructuredObjs(objs []*unstructured.Unstructured) ([]*unstructured.Unstructured, error) { - ret := make([]*unstructured.Unstructured, 0, len(objs)) - for _, obj := range objs { - if obj.IsList() { - err := obj.EachListItem(func(object runtime.Object) error { - unstructuredObj, ok := object.(*unstructured.Unstructured) - if ok { - ret = append(ret, unstructuredObj) - return nil - } - return fmt.Errorf("resource list item has unexpected type") - }) - if err != nil { - return nil, err - } - } else if isNullList(obj) { - // noop - } else { - ret = append(ret, obj) - } - } - - return ret, nil -} - func makeJsonnetVm(appPath string, repoRoot string, sourceJsonnet v1alpha1.ApplicationSourceJsonnet, env *v1alpha1.Env) (*jsonnet.VM, error) { vm := jsonnet.MakeVM() for i, j := range sourceJsonnet.TLAs { @@ -2190,7 +2060,7 @@ func getPluginParamEnvs(envVars []string, plugin *v1alpha1.ApplicationSourcePlug return env, nil } -func runConfigManagementPluginSidecars(ctx context.Context, appPath, repoPath, pluginName string, envVars *v1alpha1.Env, q *apiclient.ManifestRequest, tarDoneCh chan<- bool, tarExcludedGlobs []string) ([]manifest, error) { +func runConfigManagementPluginSidecars(ctx context.Context, appPath, repoPath, pluginName string, envVars *v1alpha1.Env, q *apiclient.ManifestRequest, tarDoneCh chan<- bool, tarExcludedGlobs []string) ([]*unstructured.Unstructured, error) { // compute variables. env, err := getPluginEnvs(envVars, q) if err != nil { @@ -2209,7 +2079,7 @@ func runConfigManagementPluginSidecars(ctx context.Context, appPath, repoPath, p if err != nil { return nil, fmt.Errorf("error generating manifests in cmp: %w", err) } - manifests := []manifest{} + var manifests []*unstructured.Unstructured for _, manifestString := range cmpManifests.Manifests { manifestObjs, err := kube.SplitYAML([]byte(manifestString)) if err != nil { @@ -2220,20 +2090,7 @@ func runConfigManagementPluginSidecars(ctx context.Context, appPath, repoPath, p log.Debugf("Failed to convert generated manifests. Beginning of generated manifests: %q", sanitizedManifestString) return nil, fmt.Errorf("failed to convert CMP manifests to unstructured objects: %s", err.Error()) } - - jsonObjs, err := expandUnstructuredObjs(manifestObjs) - if err != nil { - return nil, err - } - - for _, obj := range jsonObjs { - manifests = append(manifests, manifest{ - rawManifest: []byte(""), - obj: obj, - path: "unknown", - line: 1, - }) - } + manifests = append(manifests, manifestObjs...) } return manifests, nil } diff --git a/reposerver/repository/repository.proto b/reposerver/repository/repository.proto index 90de0e1a7c4b7..b0774705d18c9 100644 --- a/reposerver/repository/repository.proto +++ b/reposerver/repository/repository.proto @@ -86,18 +86,6 @@ message ResolveRevisionResponse { string ambiguousRevision = 2; } -message Manifest { - // The processed manifest that needs to be applied to the cluster - string compiledManifest = 1; - // The pre-processed manifest (for example the kustomization.yaml - // when using kustmize or the values.yaml when using helm). - string rawManifest = 2; - // The path of the raw manifest inside the repo - string path = 3; - // The line in the file where the object starts - int32 line = 4; -} - message Dependencies { // Content of Chart.lock string lock = 1; @@ -115,7 +103,7 @@ message ApplicationVersions { } message ManifestResponse { - repeated Manifest manifests = 1; + repeated string manifests = 1; string namespace = 2; string server = 3; // resolved revision @@ -127,8 +115,10 @@ message ManifestResponse { string commitAuthor = 9; k8s.io.apimachinery.pkg.apis.meta.v1.Time commitDate = 10; // A version of the application and its dependencies + // TODO: cf ApplicationVersions applicationVersions = 11; // for multisourced apps will be [0,12,20], so this means that 0-11 - from first app source, 12-19 from second one, 20-x - third one + // TODO: cf repeated int32 sourcesManifestsStartingIdx = 12; } diff --git a/reposerver/repository/repository_test.go b/reposerver/repository/repository_test.go index 371f4fc523921..e370c7c6e5061 100644 --- a/reposerver/repository/repository_test.go +++ b/reposerver/repository/repository_test.go @@ -315,7 +315,7 @@ func TestGenerateManifests_K8SAPIResetCache(t *testing.T) { ProjectSourceRepos: []string{"*"}, } - cachedFakeResponse := &apiclient.ManifestResponse{Manifests: []*apiclient.Manifest{{CompiledManifest: "Fake"}}, Revision: mock.Anything} + cachedFakeResponse := &apiclient.ManifestResponse{Manifests: []string{"Fake"}, Revision: mock.Anything} err := service.cache.SetManifests(mock.Anything, &src, q.RefSources, &q, "", "", "", "", &cache.CachedManifestResponse{ManifestResponse: cachedFakeResponse}, nil) require.NoError(t, err) @@ -496,13 +496,7 @@ func TestHelmManifestFromChartRepo(t *testing.T) { require.NoError(t, err) assert.NotNil(t, response) assert.Equal(t, &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: "{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}", - Path: "Chart.yaml", - Line: 1, - }, - }, + Manifests: []string{"{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}"}, Namespace: "", Server: "", Revision: "1.1.0", @@ -539,13 +533,7 @@ func TestHelmChartReferencingExternalValues(t *testing.T) { require.NoError(t, err) assert.NotNil(t, response) assert.Equal(t, &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: "{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}", - Path: "Chart.yaml", - Line: 1, - }, - }, + Manifests: []string{"{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}"}, Namespace: "", Server: "", Revision: "1.1.0", @@ -710,7 +698,7 @@ func TestNilMetadataAccessors(t *testing.T) { res, err := service.GenerateManifest(context.Background(), &q) require.NoError(t, err) assert.Len(t, res.Manifests, 1) - assert.Equal(t, expected, res.Manifests[0].CompiledManifest) + assert.Equal(t, expected, res.Manifests[0]) } func TestGenerateJsonnetManifestInDir(t *testing.T) { @@ -1121,7 +1109,7 @@ func TestGenerateHelmWithValues(t *testing.T) { replicasVerified := false for _, src := range res.Manifests { obj := unstructured.Unstructured{} - err = json.Unmarshal([]byte(src.CompiledManifest), &obj) + err = json.Unmarshal([]byte(src), &obj) require.NoError(t, err) if obj.GetKind() == "Deployment" && obj.GetName() == "test-redis-slave" { @@ -1184,7 +1172,7 @@ func TestGenerateHelmWithEnvVars(t *testing.T) { replicasVerified := false for _, src := range res.Manifests { obj := unstructured.Unstructured{} - err = json.Unmarshal([]byte(src.CompiledManifest), &obj) + err = json.Unmarshal([]byte(src), &obj) require.NoError(t, err) if obj.GetKind() == "Deployment" && obj.GetName() == "production-redis-slave" { @@ -1261,13 +1249,7 @@ func TestHelmManifestFromChartRepoWithValueFile(t *testing.T) { require.NoError(t, err) assert.NotNil(t, response) assert.Equal(t, &apiclient.ManifestResponse{ - Manifests: []*apiclient.Manifest{ - { - CompiledManifest: "{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}", - Path: "Chart.yaml", - Line: 1, - }, - }, + Manifests: []string{"{\"apiVersion\":\"v1\",\"kind\":\"ConfigMap\",\"metadata\":{\"name\":\"my-map\"}}"}, Namespace: "", Server: "", Revision: "1.1.0", @@ -1510,7 +1492,7 @@ func TestGenerateHelmWithFileParameter(t *testing.T) { ProjectSourceRepos: []string{"*"}, }) require.NoError(t, err) - assert.Contains(t, res.Manifests[6].CompiledManifest, `"replicas":2`, "ValuesObject should override Values") + assert.Contains(t, res.Manifests[6], `"replicas":2`, "ValuesObject should override Values") } func TestGenerateNullList(t *testing.T) { @@ -1526,7 +1508,7 @@ func TestGenerateNullList(t *testing.T) { }) require.NoError(t, err) assert.Len(t, res1.Manifests, 2) - assert.Contains(t, res1.Manifests[1].CompiledManifest, "prometheus-operator-operator") + assert.Contains(t, res1.Manifests[1], "prometheus-operator-operator") }) t.Run("empty list", func(t *testing.T) { @@ -1539,7 +1521,7 @@ func TestGenerateNullList(t *testing.T) { }) require.NoError(t, err) assert.Len(t, res1.Manifests, 2) - assert.Contains(t, res1.Manifests[1].CompiledManifest, "prometheus-operator-operator") + assert.Contains(t, res1.Manifests[1], "prometheus-operator-operator") }) t.Run("weird list", func(t *testing.T) { @@ -1920,7 +1902,7 @@ func TestGenerateManifestsWithAppParameterFile(t *testing.T) { resourceByKindName := make(map[string]*unstructured.Unstructured) for _, manifest := range manifests.Manifests { var un unstructured.Unstructured - err := yaml.Unmarshal([]byte(manifest.CompiledManifest), &un) + err := yaml.Unmarshal([]byte(manifest), &un) require.NoError(t, err) resourceByKindName[fmt.Sprintf("%s/%s", un.GetKind(), un.GetName())] = &un } @@ -1949,7 +1931,7 @@ func TestGenerateManifestsWithAppParameterFile(t *testing.T) { resourceByKindName := make(map[string]*unstructured.Unstructured) for _, manifest := range manifests.Manifests { var un unstructured.Unstructured - err := yaml.Unmarshal([]byte(manifest.CompiledManifest), &un) + err := yaml.Unmarshal([]byte(manifest), &un) require.NoError(t, err) resourceByKindName[fmt.Sprintf("%s/%s", un.GetKind(), un.GetName())] = &un } @@ -1979,7 +1961,7 @@ func TestGenerateManifestsWithAppParameterFile(t *testing.T) { resourceByKindName := make(map[string]*unstructured.Unstructured) for _, manifest := range manifests.Manifests { var un unstructured.Unstructured - err := yaml.Unmarshal([]byte(manifest.CompiledManifest), &un) + err := yaml.Unmarshal([]byte(manifest), &un) require.NoError(t, err) resourceByKindName[fmt.Sprintf("%s/%s", un.GetKind(), un.GetName())] = &un } @@ -2030,7 +2012,7 @@ func TestGenerateManifestsWithAppParameterFile(t *testing.T) { resourceByKindName := make(map[string]*unstructured.Unstructured) for _, manifest := range manifests.Manifests { var un unstructured.Unstructured - err := yaml.Unmarshal([]byte(manifest.CompiledManifest), &un) + err := yaml.Unmarshal([]byte(manifest), &un) require.NoError(t, err) resourceByKindName[fmt.Sprintf("%s/%s", un.GetKind(), un.GetName())] = &un } @@ -2228,7 +2210,7 @@ func TestFindResources(t *testing.T) { require.NoError(t, err) var names []string for i := range objs { - names = append(names, objs[i].obj.GetName()) + names = append(names, objs[i].GetName()) } assert.ElementsMatch(t, tc.expectedNames, names) }) @@ -2244,7 +2226,7 @@ func TestFindManifests_Exclude(t *testing.T) { require.NoError(t, err) require.Len(t, objs, 1) - assert.Equal(t, "nginx-deployment", objs[0].obj.GetName()) + assert.Equal(t, "nginx-deployment", objs[0].GetName()) } func TestFindManifests_Exclude_NothingMatches(t *testing.T) { @@ -2257,7 +2239,7 @@ func TestFindManifests_Exclude_NothingMatches(t *testing.T) { require.Len(t, objs, 2) assert.ElementsMatch(t, - []string{"nginx-deployment", "nginx-deployment-sub"}, []string{objs[0].obj.GetName(), objs[1].obj.GetName()}) + []string{"nginx-deployment", "nginx-deployment-sub"}, []string{objs[0].GetName(), objs[1].GetName()}) } func tempDir(t *testing.T) string { diff --git a/server/application/application.go b/server/application/application.go index 8e9d765cfb04f..7afd7b9a9dd78 100644 --- a/server/application/application.go +++ b/server/application/application.go @@ -558,7 +558,7 @@ func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationMan for _, manifestInfo := range manifestInfos { for i, manifest := range manifestInfo.Manifests { obj := &unstructured.Unstructured{} - err = json.Unmarshal([]byte(manifest.CompiledManifest), obj) + err = json.Unmarshal([]byte(manifest), obj) if err != nil { return nil, fmt.Errorf("error unmarshaling manifest into unstructured: %w", err) } @@ -571,7 +571,7 @@ func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationMan if err != nil { return nil, fmt.Errorf("error marshaling manifest: %w", err) } - manifestInfo.Manifests[i].CompiledManifest = string(data) + manifestInfo.Manifests[i] = string(data) } } manifests.SourcesManifestsStartingIdx = append(manifests.SourcesManifestsStartingIdx, int32(len(manifests.Manifests))) @@ -688,7 +688,7 @@ func (s *Server) GetManifestsWithFiles(stream application.ApplicationService_Get for i, manifest := range manifestInfo.Manifests { obj := &unstructured.Unstructured{} - err = json.Unmarshal([]byte(manifest.CompiledManifest), obj) + err = json.Unmarshal([]byte(manifest), obj) if err != nil { return fmt.Errorf("error unmarshaling manifest into unstructured: %w", err) } @@ -701,7 +701,7 @@ func (s *Server) GetManifestsWithFiles(stream application.ApplicationService_Get if err != nil { return fmt.Errorf("error marshaling manifest: %w", err) } - manifestInfo.Manifests[i].CompiledManifest = string(data) + manifestInfo.Manifests[i] = string(data) } } diff --git a/server/application/application_rollout_rollback.go b/server/application/application_rollout_rollback.go index 276d6f90917ef..3a21536b9bc1d 100644 --- a/server/application/application_rollout_rollback.go +++ b/server/application/application_rollout_rollback.go @@ -19,6 +19,7 @@ import ( "github.com/argoproj/argo-cd/v2/util/resource" ) +// TODO: cf func (s *Server) RollbackApplicationRollout(ctx context.Context, q *application.ApplicationRolloutRollbackRequest) (*application.ApplicationRolloutRollbackResponse, error) { a, err := s.appLister.Applications(*q.Namespace).Get(q.GetName()) if err != nil { diff --git a/server/application/events.proto b/server/application/events.proto deleted file mode 100644 index 045aa5888de7b..0000000000000 --- a/server/application/events.proto +++ /dev/null @@ -1,122 +0,0 @@ -syntax = "proto2"; -option go_package = "github.com/argoproj/argo-cd/v2/pkg/apiclient/events"; - -// Events Service -// -// Events Service API provides a generic event-source that allows -// listening for argo-cd events natively from argo-events. -package generic; - -import "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/generated.proto"; -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; - -message EventSource { - // The event source name. - required string name = 1; - // The event source configuration value. - optional bytes config = 2; -} - -/** -* Represents an event -*/ -message Event { - // The event source name. - required string name = 1; - // The event payload. - required bytes payload = 2; -} - -/** -* The actual object that will be send -* with each event. -*/ -message EventPayload { - // The timestamp of the event - required string timestamp = 1 [(gogoproto.nullable) = false]; - // The object that the event is about - required bytes object = 2; - // The object source information - required ObjectSource source = 3; - // The errors of this object - repeated ObjectError errors = 4; - // A version of the application and its dependencies - optional ApplicationVersions appVersions = 5; - // A version of codefresh runtime - required string runtimeVersion = 6 [(gogoproto.nullable) = false]; -} - -/** -* Holds information about the object source -*/ -message ObjectSource { - optional string desiredManifest = 1 [(gogoproto.nullable) = false]; - optional string actualManifest = 2 [(gogoproto.nullable) = false]; - optional string gitManifest = 3 [(gogoproto.nullable) = false]; - optional string repoURL = 4 [(gogoproto.nullable) = false]; - optional string path = 5 [(gogoproto.nullable) = false]; - optional string revision = 6 [(gogoproto.nullable) = false]; // sync.revision - optional string commitMessage = 7 [(gogoproto.nullable) = false]; - optional string commitAuthor = 8 [(gogoproto.nullable) = false]; - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time commitDate = 9; - optional string appName = 10 [(gogoproto.nullable) = false]; - map appLabels = 11 [(gogoproto.nullable) = false]; - optional string syncStatus = 12 [(gogoproto.nullable) = false]; - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time syncStartedAt = 13 [(gogoproto.nullable) = false]; - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time syncFinishedAt = 14; - optional string healthStatus = 15; - optional string healthMessage = 16; - optional string cluster = 17 [(gogoproto.nullable) = false]; // destination.server - optional int64 historyId = 18 [(gogoproto.nullable) = false]; // legacy - optional string operationSyncRevision = 19 [(gogoproto.nullable) = false]; - optional string appUID = 20 [(gogoproto.nullable) = false]; - optional string appNamespace = 21 [(gogoproto.nullable) = false]; - optional string appInstanceLabelKey = 22 [(gogoproto.nullable) = false]; - optional string trackingMethod = 23 [(gogoproto.nullable) = false]; - repeated string revisions = 24; // sync.revisions - repeated string operationSyncRevisions = 25; // syncResult.revisions - optional string clusterName = 26; // destination.name - required bool appMultiSourced = 27 [(gogoproto.nullable) = false]; - required int32 appSourceIdx = 28 [(gogoproto.nullable) = false]; -} - -/** -* Holds error information; present only when error sent with application but not resource itself -*/ -message ObjectError { - optional string type = 1 [(gogoproto.nullable) = false]; - optional string level = 2 [(gogoproto.nullable) = false]; - optional string message = 3 [(gogoproto.nullable) = false]; - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSeen = 4 [(gogoproto.nullable) = false]; - optional ErrorSourceReference sourceReference = 5; -} - -/** -* Holds application resource metadata to which the error related -*/ -message ErrorSourceReference { - optional string group = 1 [(gogoproto.nullable) = false]; - optional string version = 2 [(gogoproto.nullable) = false]; - required string kind = 3 [(gogoproto.nullable) = false]; - required string name = 4 [(gogoproto.nullable) = false]; - optional string namespace = 5 [(gogoproto.nullable) = false]; -} - -message Dependencies { - // Content of Chart.lock - optional string lock = 1; - // Content of Chart.yaml - optional string deps = 2; - // Content of requirements.yaml - optional string requirements = 3; -} - -message ApplicationVersions { - // Application version presented by single value - optional string appVersion = 1; - // Yaml content of dependencies - optional Dependencies dependencies = 2; -} - diff --git a/test/e2e/app_management_ns_test.go b/test/e2e/app_management_ns_test.go index 249733e10810c..4257e59bf9a62 100644 --- a/test/e2e/app_management_ns_test.go +++ b/test/e2e/app_management_ns_test.go @@ -656,7 +656,7 @@ func TestNamespacedAppWithSecrets(t *testing.T) { }) errors.CheckError(err) - for _, manifest := range manifests.GetCompiledManifests() { + for _, manifest := range manifests.Manifests { assetSecretDataHidden(t, manifest) } diff --git a/test/e2e/app_management_test.go b/test/e2e/app_management_test.go index c7a6b82d98afb..c34ed635e71bd 100644 --- a/test/e2e/app_management_test.go +++ b/test/e2e/app_management_test.go @@ -808,7 +808,7 @@ func TestAppWithSecrets(t *testing.T) { manifests, err := client.GetManifests(context.Background(), &applicationpkg.ApplicationManifestQuery{Name: &app.Name}) errors.CheckError(err) - for _, manifest := range manifests.GetCompiledManifests() { + for _, manifest := range manifests.Manifests { assetSecretDataHidden(t, manifest) }