Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: clean cf code #371

Open
wants to merge 7 commits into
base: release-2.12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 2 additions & 24 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -5278,7 +5256,7 @@
"manifests": {
"type": "array",
"items": {
"$ref": "#/definitions/repositoryManifest"
"type": "string"
}
},
"namespace": {
Expand All @@ -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"
Expand Down
44 changes: 14 additions & 30 deletions controller/appcontroller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion controller/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Loading
Loading