Skip to content

Commit

Permalink
Merge pull request #165 from MisterMX/refactor/remove-apis-argocd-imp…
Browse files Browse the repository at this point in the history
…orts

refactor(apis): Remove argocd imports
  • Loading branch information
MisterMX authored Apr 30, 2024
2 parents 82346ac + 951015b commit 00b1685
Show file tree
Hide file tree
Showing 13 changed files with 561 additions and 534 deletions.
3 changes: 1 addition & 2 deletions apis/applications/v1alpha1/status.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package v1alpha1

import (
"github.com/argoproj/gitops-engine/pkg/health"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -84,7 +83,7 @@ type SyncStatus struct {
// HealthStatus contains information about the currently observed health state of an application or resource
type HealthStatus struct {
// Status holds the status code of the application or resource
Status health.HealthStatusCode `json:"status,omitempty" protobuf:"bytes,1,opt,name=status"`
Status string `json:"status,omitempty" protobuf:"bytes,1,opt,name=status"`
// Message is a human-readable informational message describing the health status
Message *string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
}
Expand Down
2 changes: 1 addition & 1 deletion apis/applications/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion apis/applicationsets/v1alpha1/zz_generated.deepcopy.go

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

5 changes: 0 additions & 5 deletions apis/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,9 @@ limitations under the License.
// Generate crossplane-runtime methodsets (resource.Managed, etc)
//go:generate go run -tags generate github.com/crossplane/crossplane-tools/cmd/angryjet generate-methodsets --header-file=../hack/boilerplate.go.txt ./...

// Generate conversion code
//go:generate go run -tags generate github.com/jmattheis/goverter/cmd/goverter gen -output-constraint !ignore_autogenerated ./...

package apis

import (
_ "github.com/jmattheis/goverter/cmd/goverter" //nolint:typecheck

_ "sigs.k8s.io/controller-tools/cmd/controller-gen" //nolint:typecheck

_ "github.com/crossplane/crossplane-tools/cmd/angryjet" //nolint:typecheck
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package v1alpha1
package applications

import (
argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"

"github.com/crossplane-contrib/provider-argocd/apis/applications/v1alpha1"
)

// Converter helps to convert ArgoCD types to api types of this provider and vise-versa
Expand All @@ -14,21 +16,21 @@ import (
// 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
// goverter:output:package github.com/crossplane-contrib/provider-argocd/pkg/clients/applications
// +k8s:deepcopy-gen=false
type Converter interface {

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

ToArgoDestination(in ApplicationDestination) argocdv1alpha1.ApplicationDestination
ToArgoDestination(in v1alpha1.ApplicationDestination) argocdv1alpha1.ApplicationDestination

ToArgoApplicationSpec(in *ApplicationParameters) *argocdv1alpha1.ApplicationSpec
ToArgoApplicationSpec(in *v1alpha1.ApplicationParameters) *argocdv1alpha1.ApplicationSpec

FromArgoApplicationStatus(in *argocdv1alpha1.ApplicationStatus) *ArgoApplicationStatus
FromArgoApplicationStatus(in *argocdv1alpha1.ApplicationStatus) *v1alpha1.ArgoApplicationStatus
}

// ExtV1JSONToRuntimeRawExtension converts an extv1.JSON into a
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package v1alpha1
package applicationsets

import (
argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
extv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"

"github.com/crossplane-contrib/provider-argocd/apis/applicationsets/v1alpha1"
)

// Converter helps to convert ArgoCD types to api types of this provider and vise-versa
Expand All @@ -14,23 +16,23 @@ import (
// 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/applicationsets/v1alpha1
// goverter:output:package github.com/crossplane-contrib/provider-argocd/pkg/clients/applicationsets
// +k8s:deepcopy-gen=false
type Converter interface {

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

ToArgoDestination(in ApplicationDestination) argocdv1alpha1.ApplicationDestination
ToArgoDestination(in v1alpha1.ApplicationDestination) argocdv1alpha1.ApplicationDestination

ToArgoApplicationSetSpec(in *ApplicationSetParameters) *argocdv1alpha1.ApplicationSetSpec
FromArgoApplicationSetSpec(in *argocdv1alpha1.ApplicationSetSpec) *ApplicationSetParameters
ToArgoApplicationSetSpec(in *v1alpha1.ApplicationSetParameters) *argocdv1alpha1.ApplicationSetSpec
FromArgoApplicationSetSpec(in *argocdv1alpha1.ApplicationSetSpec) *v1alpha1.ApplicationSetParameters

FromArgoApplicationSetStatus(in *argocdv1alpha1.ApplicationSetStatus) *ArgoApplicationSetStatus
ToArgoApplicationSetStatus(in *ArgoApplicationSetStatus) *argocdv1alpha1.ApplicationSetStatus
FromArgoApplicationSetStatus(in *argocdv1alpha1.ApplicationSetStatus) *v1alpha1.ArgoApplicationSetStatus
ToArgoApplicationSetStatus(in *v1alpha1.ArgoApplicationSetStatus) *argocdv1alpha1.ApplicationSetStatus
}

// ExtV1JSONToRuntimeRawExtension converts an extv1.JSON into a
Expand Down
Loading

0 comments on commit 00b1685

Please sign in to comment.