Skip to content

Commit

Permalink
Merge pull request #156 from oskisk/fix/repo-secret-changes
Browse files Browse the repository at this point in the history
feat: Add Repository secret observation
  • Loading branch information
MisterMX authored Apr 23, 2024
2 parents ee64725 + b0ab6ce commit d70d68d
Show file tree
Hide file tree
Showing 7 changed files with 971 additions and 21 deletions.
31 changes: 31 additions & 0 deletions apis/repositories/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,41 @@ type SecretReference struct {
Key string `json:"key"`
}

// PasswordObservation holds the status of a referenced password
type PasswordObservation struct {
Secret SecretObservation `json:"secret,omitempty"`
}

// SecretObservation observes a secret
type SecretObservation struct {
// ResourceVersion tracks the meta1.ResourceVersion of an Object
ResourceVersion string `json:"resourceVersion,omitempty"`
}

// RepositoryObservation represents an argocd repository.
type RepositoryObservation struct {
// Current state of repository server connecting
ConnectionState ConnectionState `json:"connectionState,omitempty"`

// Password tracks changes to a Password secret
// +optional
Password *PasswordObservation `json:"password,omitempty"`

// SSHPrivateKey tracks changes to a SSHPrivateKey secret
// +optional
SSHPrivateKey *PasswordObservation `json:"sshPrivateKey,omitempty"`

// TLSClientCertData tracks changes to a TLSClientCertData secret
// +optional
TLSClientCertData *PasswordObservation `json:"tlsClientCertData,omitempty"`

// TLSClientCertKey tracks changes to a TLSClientCertKey secret
// +optional
TLSClientCertKey *PasswordObservation `json:"tlsClientCertKey,omitempty"`

// GithubAppPrivateKey tracks changes to a GithubAppPrivateKey secret
// +optional
GithubAppPrivateKey *PasswordObservation `json:"githubAppPrivateKey,omitempty"`
}

// ConnectionState is the observed state of the argocd repository
Expand Down
56 changes: 56 additions & 0 deletions apis/repositories/v1alpha1/zz_generated.deepcopy.go

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

63 changes: 63 additions & 0 deletions package/crds/repositories.argocd.crossplane.io_repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,69 @@ spec:
status:
type: string
type: object
githubAppPrivateKey:
description: GithubAppPrivateKey tracks changes to a GithubAppPrivateKey
secret
properties:
secret:
description: SecretObservation observes a secret
properties:
resourceVersion:
description: ResourceVersion tracks the meta1.ResourceVersion
of an Object
type: string
type: object
type: object
password:
description: Password tracks changes to a Password secret
properties:
secret:
description: SecretObservation observes a secret
properties:
resourceVersion:
description: ResourceVersion tracks the meta1.ResourceVersion
of an Object
type: string
type: object
type: object
sshPrivateKey:
description: SSHPrivateKey tracks changes to a SSHPrivateKey secret
properties:
secret:
description: SecretObservation observes a secret
properties:
resourceVersion:
description: ResourceVersion tracks the meta1.ResourceVersion
of an Object
type: string
type: object
type: object
tlsClientCertData:
description: TLSClientCertData tracks changes to a TLSClientCertData
secret
properties:
secret:
description: SecretObservation observes a secret
properties:
resourceVersion:
description: ResourceVersion tracks the meta1.ResourceVersion
of an Object
type: string
type: object
type: object
tlsClientCertKey:
description: TLSClientCertKey tracks changes to a TLSClientCertKey
secret
properties:
secret:
description: SecretObservation observes a secret
properties:
resourceVersion:
description: ResourceVersion tracks the meta1.ResourceVersion
of an Object
type: string
type: object
type: object
type: object
conditions:
description: Conditions of the resource.
Expand Down
1 change: 1 addition & 0 deletions pkg/clients/mock/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ package mock
//go:generate go run -mod=mod github.com/golang/mock/mockgen -package projects -destination=./projects/mock.go -source=../projects/client.go ServiceClient -build_flags=-mod=mod
//go:generate go run -mod=mod github.com/golang/mock/mockgen -package cluster -destination=./cluster/mock.go -source=../cluster/client.go ServiceClient -build_flags=-mod=mod
//go:generate go run -mod=mod github.com/golang/mock/mockgen -package applicationsets -destination=./applicationsets/mock.go -source=../applicationsets/client.go ServiceClient -build_flags=-mod=mod
//go:generate go run -mod=mod github.com/golang/mock/mockgen -package repositories -destination=./repositories/mock.go -source=../repositories/client.go ServiceClient -build_flags=-mod=mod
138 changes: 138 additions & 0 deletions pkg/clients/mock/repositories/mock.go

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

Loading

0 comments on commit d70d68d

Please sign in to comment.