Skip to content

Commit d44ad9d

Browse files
authored
argocd: add sync config and internal schemes (rh-ecosystem-edge#590)
The application types are set to sync false since they require manual intervention to avoid bringing in too many dependencies.
1 parent 7cfb14e commit d44ad9d

24 files changed

+12139
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
# Argo CD operator
3+
- name: argocd-operator
4+
sync: true
5+
repo_link: "https://github.com/argoproj-labs/argocd-operator"
6+
branch: master
7+
remote_api_directory: api/v1beta1
8+
local_api_directory: schemes/argocd/argocdoperator
9+
replace_imports:
10+
- old: '"github.com/argoproj-labs/argocd-operator/common"'
11+
new: common "github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdoperatorcommon"
12+
excludes:
13+
- "*_test.go"
14+
- "testdata"
15+
16+
- name: argocd-operator
17+
sync: true
18+
repo_link: "https://github.com/argoproj-labs/argocd-operator"
19+
branch: master
20+
remote_api_directory: common
21+
local_api_directory: schemes/argocd/argocdoperatorcommon
22+
23+
# Argo CD applications
24+
#
25+
# Refrences to imports not replaced in the sync were manually removed until no
26+
# more dependencies were added.
27+
- name: argo-cd
28+
sync: false
29+
repo_link: "https://github.com/argoproj/argo-cd"
30+
branch: master
31+
remote_api_directory: pkg/apis/application
32+
local_api_directory: schemes/argocd/argocdtypes
33+
replace_imports:
34+
- old: '"github.com/argoproj/argo-cd/v2/pkg/apis/application"'
35+
new: application "github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/argocdtypes"
36+
- old: synccommon "github.com/argoproj/gitops-engine/pkg/sync/common"
37+
new: '"github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/gitopsengine/synccommon"'
38+
- old: '"github.com/argoproj/gitops-engine/pkg/health"'
39+
new: '"github.com/openshift-kni/eco-goinfra/pkg/schemes/argocd/gitopsengine/health"'
40+
excludes:
41+
- "*_test.go"
42+
- "doc.go"
43+
- "generated.proto"
44+
- "generated.pb.go"
45+
- "openapi_generated.go"
46+
47+
# Argo GitOps Engine
48+
#
49+
# Refrences to the kube imports were manually removed since they are not
50+
# necessary for the sync.
51+
- name: gitops-engine
52+
sync: false
53+
repo_link: "https://github.com/argoproj/gitops-engine"
54+
branch: master
55+
remote_api_directory: pkg/sync/common
56+
local_api_directory: schemes/argocd/gitopsengine/synccommon
57+
excludes:
58+
- "*_test.go"
59+
60+
- name: gitops-engine
61+
sync: false
62+
repo_link: "https://github.com/argoproj/gitops-engine"
63+
branch: master
64+
remote_api_directory: pkg/health
65+
local_api_directory: schemes/argocd/gitopsengine/health
66+
excludes:
67+
- "testdata"
68+
- "*_test.go"
69+
- "health_*.go"
70+
...
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package argocdoperator
2+
3+
// Hub marks this type as a conversion hub.
4+
func (*ArgoCD) Hub() {}

pkg/schemes/argocd/argocdoperator/argocd_types.go

Lines changed: 1112 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
Copyright 2021.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package argocdoperator
18+
19+
import (
20+
ctrl "sigs.k8s.io/controller-runtime"
21+
)
22+
23+
func (r *ArgoCD) SetupWebhookWithManager(mgr ctrl.Manager) error {
24+
return ctrl.NewWebhookManagedBy(mgr).
25+
For(r).
26+
Complete()
27+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2021.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// Package v1beta1 contains API Schema definitions for the argoproj.io v1beta1 API group
18+
// +kubebuilder:object:generate=true
19+
// +groupName=argoproj.io
20+
package argocdoperator
21+
22+
import (
23+
"k8s.io/apimachinery/pkg/runtime/schema"
24+
"sigs.k8s.io/controller-runtime/pkg/scheme"
25+
)
26+
27+
var (
28+
// GroupVersion is group version used to register these objects
29+
GroupVersion = schema.GroupVersion{Group: "argoproj.io", Version: "v1beta1"}
30+
31+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
32+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
33+
34+
// AddToScheme adds the types in this group-version to the given scheme.
35+
AddToScheme = SchemeBuilder.AddToScheme
36+
)

0 commit comments

Comments
 (0)