Skip to content

Commit

Permalink
feat: add applicationsets (#122)
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Braun (SAP) <maximilian.braun@sap.com>
  • Loading branch information
maximilianbraun authored Jan 11, 2024
1 parent 855a2dd commit 7d5eaa5
Show file tree
Hide file tree
Showing 38 changed files with 40,635 additions and 116 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ dev-debug: $(KIND) $(KUBECTL)
@$(INFO) Installing Crossplane CRDs
@$(KUBECTL) apply -k https://github.com/crossplane/crossplane//cluster?ref=master
@$(INFO) Installing Provider Template CRDs
@$(KUBECTL) apply -R -f package/crds
@$(KUBECTL) apply --server-side=true -R -f package/crds
@$(INFO) Creating crossplane-system namespace
@$(KUBECTL) create ns crossplane-system
@$(INFO) Creating provider config and secret
Expand Down
11 changes: 6 additions & 5 deletions apis/applications/v1alpha1/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ import (
)

// Converter helps to convert ArgoCD types to api types of this provider and vise-versa
// From & To shall both be defined for each type conversion, to prevent diverge from ArgoCD Types
// goverter:converter
// goverter:useZeroValueOnPointerInconsistency
// goverter:ignoreUnexported
// goverter:extend ExtV1JSONToRuntimeRawExtension
// goverter:struct:comment // +k8s:deepcopy-gen=false
// goverter:output:file ./zz_generated.conversion.go
// goverter:output:package github.com/crossplane-contrib/provider-argocd/apis/applications/v1alpha1
// +k8s:deepcopy-gen=false
type Converter interface {

// goverter:ignore ServerRef
// goverter:ignore ServerSelector
// goverter:ignore NameRef
// goverter:ignore NameSelector
FromArgoDestination(in argocdv1alpha1.ApplicationDestination) ApplicationDestination
FromArgoDestinationP(in *argocdv1alpha1.ApplicationDestination) *ApplicationDestination

// goverter:ignore ServerRef
// goverter:ignore ServerSelector
ToArgoDestination(in ApplicationDestination) argocdv1alpha1.ApplicationDestination
ToArgoDestinationP(in *ApplicationDestination) *argocdv1alpha1.ApplicationDestination

// goverter:ignore ForProvider.Source
ToArgoApplicationSpec(in *ApplicationParameters) *argocdv1alpha1.ApplicationSpec

FromArgoApplicationStatus(in *argocdv1alpha1.ApplicationStatus) *ArgoApplicationStatus
Expand Down
15 changes: 13 additions & 2 deletions apis/applications/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,34 @@ type ApplicationSources []ApplicationSource
type ApplicationDestination struct {
// Server specifies the URL of the target cluster and must be set to the Kubernetes control plane API
// +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-argocd/apis/cluster/v1alpha1.Cluster
// +crossplane:generate:reference:extractor=github.com/crossplane-contrib/provider-argocd/apis/cluster/v1alpha1.ServerAddress()
// +crossplane:generate:reference:refFieldName=ServerRef
// +crossplane:generate:reference:selectorFieldName=ServerSelector
// +optional
Server *string `json:"server,omitempty"`
// ServerRef is a reference to an Cluster used to set Server
// ServerRef is a reference to Cluster used to set Server
// +optional
ServerRef *xpv1.Reference `json:"serverRef,omitempty"`
// SourceReposSelector selects references to Repositories used to set SourceRepos
// ServerSelector selects references to Cluster used to set Server
// +optional
ServerSelector *xpv1.Selector `json:"serverSelector,omitempty"`
// Namespace specifies the target namespace for the application's resources.
// The namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace
// +optional
Namespace *string `json:"namespace,omitempty"`
// Name is an alternate way of specifying the target cluster by its symbolic name
// +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-argocd/apis/cluster/v1alpha1.Cluster
// +crossplane:generate:reference:extractor=github.com/crossplane-contrib/provider-argocd/apis/cluster/v1alpha1.ServerName()
// +crossplane:generate:reference:refFieldName=NameRef
// +crossplane:generate:reference:selectorFieldName=NameSelector
// +optional
Name *string `json:"name,omitempty"`
// NameRef is a reference to a Cluster used to set Name
// +optional
NameRef *xpv1.Reference `json:"nameRef,omitempty"`
// NameSelector is a reference to a Cluster used to set Name
// +optional
NameSelector *xpv1.Selector `json:"nameSelector,omitempty"`
// contains filtered or unexported fields
}

Expand Down
132 changes: 61 additions & 71 deletions apis/applications/v1alpha1/zz_generated.conversion.go

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

25 changes: 10 additions & 15 deletions apis/applications/v1alpha1/zz_generated.deepcopy.go

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

36 changes: 34 additions & 2 deletions apis/applications/v1alpha1/zz_generated.resolvers.go

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

Loading

0 comments on commit 7d5eaa5

Please sign in to comment.