Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Sep 21, 2023
2 parents fe72157 + 274eb9f commit 9e5d7eb
Show file tree
Hide file tree
Showing 12 changed files with 747 additions and 257 deletions.
22 changes: 18 additions & 4 deletions api/apis/platform/v1alpha1/deployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,29 @@ const (
FailedToCreateDeploymentReason = "FailedToCreateDeployment"
)

type Revision struct {
// Git ia a spec of the prior revision
Git GitRef `json:",inline"`
Version string `json:"version"`
}

type GitRef struct {
// Ref is the URL to the repository (Git or Helm) that contains the application manifests
Ref string `json:"ref"`
// Folder from the repository to work with.
Folder string `json:"folder,omitempty"`
}

type DeploymentSpec struct {

// PluralId is an ID of deployment from Plural.
PluralId string `json:"pluralId"`

// RevisionId is ID of revision to sync.
RevisionId string `json:"revisionId"`
// Revision is revision to sync.
Revision Revision `json:"revision"`

// Subfolder from the repository to work with.
Subfolder string `json:"subfolder"`
// Git ia a spec of the current revision
Git GitRef `json:"git"`

// Namespace to sync into.
Namespace string `json:"namespace"`
Expand Down
33 changes: 33 additions & 0 deletions api/apis/platform/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 31 additions & 8 deletions api/config/crd/bases/platform.plural.sh_deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ spec:
This field will be empty when the Deployment is dynamically provisioned
by operator.
type: string
git:
description: Git ia a spec of the current revision
properties:
folder:
description: Folder from the repository to work with.
type: string
ref:
description: Ref is the URL to the repository (Git or Helm) that
contains the application manifests
type: string
required:
- ref
type: object
namespace:
description: Namespace to sync into.
type: string
Expand All @@ -68,19 +81,29 @@ spec:
description: ProviderName is the name of provider associated with
this deployment operator
type: string
revisionId:
description: RevisionId is ID of revision to sync.
type: string
subfolder:
description: Subfolder from the repository to work with.
type: string
revision:
description: Revision is revision to sync.
properties:
folder:
description: Folder from the repository to work with.
type: string
ref:
description: Ref is the URL to the repository (Git or Helm) that
contains the application manifests
type: string
version:
type: string
required:
- ref
- version
type: object
required:
- deploymentClassName
- git
- namespace
- pluralId
- providerName
- revisionId
- subfolder
- revision
type: object
status:
properties:
Expand Down
13 changes: 8 additions & 5 deletions api/example/test_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ metadata:
name: test
spec:
pluralId: ""
repoUrl: https://github.com/pluralsh/deployment-api
ref: 957bde0e71dad665e53f7fcbff43fc2f0e10b0a9
subfolder: example/test_deployment
revision:
version: ""
ref: ""
git:
ref: https://github.com/argoproj/argocd-example-apps
folder: blue-green
namespace: test
providerName: fake.platform.plural.sh
deploymentClassName: fake
providerName: argocd.platform.plural.sh
deploymentClassName: argocd
25 changes: 18 additions & 7 deletions operator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@ module github.com/pluralsh/deployment-operator

go 1.21

// Local workspace modules
replace (
github.com/pluralsh/deployment-operator/api => ./../api
github.com/pluralsh/deployment-operator/common => ./../common
github.com/pluralsh/deployment-operator/provisioner => ./../provisioner
)

require (
github.com/go-logr/logr v1.2.4
github.com/pluralsh/controller-reconcile-helper v0.1.0
google.golang.org/grpc v1.54.0
github.com/pluralsh/deployment-operator/api v0.0.0-00010101000000-000000000000
github.com/pluralsh/deployment-operator/provisioner v0.0.0-00010101000000-000000000000
google.golang.org/grpc v1.56.2
k8s.io/apimachinery v0.28.2
k8s.io/apiserver v0.28.1
k8s.io/client-go v0.28.1
Expand All @@ -25,6 +34,7 @@ require (
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand All @@ -47,6 +57,7 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/gomega v1.27.10 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pluralsh/deployment-operator/common v0.0.0-00010101000000-000000000000 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
Expand All @@ -66,20 +77,20 @@ require (
go.opentelemetry.io/otel/trace v1.10.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 9e5d7eb

Please sign in to comment.