Skip to content

Commit 9e5d7eb

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents fe72157 + 274eb9f commit 9e5d7eb

File tree

12 files changed

+747
-257
lines changed

12 files changed

+747
-257
lines changed

api/apis/platform/v1alpha1/deployment_types.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,29 @@ const (
3333
FailedToCreateDeploymentReason = "FailedToCreateDeployment"
3434
)
3535

36+
type Revision struct {
37+
// Git ia a spec of the prior revision
38+
Git GitRef `json:",inline"`
39+
Version string `json:"version"`
40+
}
41+
42+
type GitRef struct {
43+
// Ref is the URL to the repository (Git or Helm) that contains the application manifests
44+
Ref string `json:"ref"`
45+
// Folder from the repository to work with.
46+
Folder string `json:"folder,omitempty"`
47+
}
48+
3649
type DeploymentSpec struct {
50+
3751
// PluralId is an ID of deployment from Plural.
3852
PluralId string `json:"pluralId"`
3953

40-
// RevisionId is ID of revision to sync.
41-
RevisionId string `json:"revisionId"`
54+
// Revision is revision to sync.
55+
Revision Revision `json:"revision"`
4256

43-
// Subfolder from the repository to work with.
44-
Subfolder string `json:"subfolder"`
57+
// Git ia a spec of the current revision
58+
Git GitRef `json:"git"`
4559

4660
// Namespace to sync into.
4761
Namespace string `json:"namespace"`

api/apis/platform/v1alpha1/zz_generated.deepcopy.go

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/config/crd/bases/platform.plural.sh_deployments.yaml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ spec:
5454
This field will be empty when the Deployment is dynamically provisioned
5555
by operator.
5656
type: string
57+
git:
58+
description: Git ia a spec of the current revision
59+
properties:
60+
folder:
61+
description: Folder from the repository to work with.
62+
type: string
63+
ref:
64+
description: Ref is the URL to the repository (Git or Helm) that
65+
contains the application manifests
66+
type: string
67+
required:
68+
- ref
69+
type: object
5770
namespace:
5871
description: Namespace to sync into.
5972
type: string
@@ -68,19 +81,29 @@ spec:
6881
description: ProviderName is the name of provider associated with
6982
this deployment operator
7083
type: string
71-
revisionId:
72-
description: RevisionId is ID of revision to sync.
73-
type: string
74-
subfolder:
75-
description: Subfolder from the repository to work with.
76-
type: string
84+
revision:
85+
description: Revision is revision to sync.
86+
properties:
87+
folder:
88+
description: Folder from the repository to work with.
89+
type: string
90+
ref:
91+
description: Ref is the URL to the repository (Git or Helm) that
92+
contains the application manifests
93+
type: string
94+
version:
95+
type: string
96+
required:
97+
- ref
98+
- version
99+
type: object
77100
required:
78101
- deploymentClassName
102+
- git
79103
- namespace
80104
- pluralId
81105
- providerName
82-
- revisionId
83-
- subfolder
106+
- revision
84107
type: object
85108
status:
86109
properties:

api/example/test_deployment.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ metadata:
44
name: test
55
spec:
66
pluralId: ""
7-
repoUrl: https://github.com/pluralsh/deployment-api
8-
ref: 957bde0e71dad665e53f7fcbff43fc2f0e10b0a9
9-
subfolder: example/test_deployment
7+
revision:
8+
version: ""
9+
ref: ""
10+
git:
11+
ref: https://github.com/argoproj/argocd-example-apps
12+
folder: blue-green
1013
namespace: test
11-
providerName: fake.platform.plural.sh
12-
deploymentClassName: fake
14+
providerName: argocd.platform.plural.sh
15+
deploymentClassName: argocd

operator/go.mod

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ module github.com/pluralsh/deployment-operator
22

33
go 1.21
44

5+
// Local workspace modules
6+
replace (
7+
github.com/pluralsh/deployment-operator/api => ./../api
8+
github.com/pluralsh/deployment-operator/common => ./../common
9+
github.com/pluralsh/deployment-operator/provisioner => ./../provisioner
10+
)
11+
512
require (
613
github.com/go-logr/logr v1.2.4
714
github.com/pluralsh/controller-reconcile-helper v0.1.0
8-
google.golang.org/grpc v1.54.0
15+
github.com/pluralsh/deployment-operator/api v0.0.0-00010101000000-000000000000
16+
github.com/pluralsh/deployment-operator/provisioner v0.0.0-00010101000000-000000000000
17+
google.golang.org/grpc v1.56.2
918
k8s.io/apimachinery v0.28.2
1019
k8s.io/apiserver v0.28.1
1120
k8s.io/client-go v0.28.1
@@ -25,6 +34,7 @@ require (
2534
github.com/felixge/httpsnoop v1.0.3 // indirect
2635
github.com/fsnotify/fsnotify v1.6.0 // indirect
2736
github.com/go-logr/stdr v1.2.2 // indirect
37+
github.com/go-logr/zapr v1.2.4 // indirect
2838
github.com/go-openapi/jsonpointer v0.19.6 // indirect
2939
github.com/go-openapi/jsonreference v0.20.2 // indirect
3040
github.com/go-openapi/swag v0.22.3 // indirect
@@ -47,6 +57,7 @@ require (
4757
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4858
github.com/onsi/gomega v1.27.10 // indirect
4959
github.com/pkg/errors v0.9.1 // indirect
60+
github.com/pluralsh/deployment-operator/common v0.0.0-00010101000000-000000000000 // indirect
5061
github.com/prometheus/client_golang v1.16.0 // indirect
5162
github.com/prometheus/client_model v0.4.0 // indirect
5263
github.com/prometheus/common v0.44.0 // indirect
@@ -66,20 +77,20 @@ require (
6677
go.opentelemetry.io/otel/trace v1.10.0 // indirect
6778
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
6879
go.uber.org/multierr v1.11.0 // indirect
69-
go.uber.org/zap v1.25.0 // indirect
80+
go.uber.org/zap v1.26.0 // indirect
7081
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
71-
golang.org/x/net v0.13.0 // indirect
82+
golang.org/x/net v0.15.0 // indirect
7283
golang.org/x/oauth2 v0.8.0 // indirect
73-
golang.org/x/sys v0.11.0 // indirect
74-
golang.org/x/term v0.10.0 // indirect
75-
golang.org/x/text v0.11.0 // indirect
84+
golang.org/x/sys v0.12.0 // indirect
85+
golang.org/x/term v0.12.0 // indirect
86+
golang.org/x/text v0.13.0 // indirect
7687
golang.org/x/time v0.3.0 // indirect
7788
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
7889
google.golang.org/appengine v1.6.7 // indirect
7990
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
8091
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
8192
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
82-
google.golang.org/protobuf v1.30.0 // indirect
93+
google.golang.org/protobuf v1.31.0 // indirect
8394
gopkg.in/inf.v0 v0.9.1 // indirect
8495
gopkg.in/yaml.v2 v2.4.0 // indirect
8596
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)