-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ability to entirely opt-out of argo cd and rollouts integrations #1382
Changes from all commits
ec27c1c
4f7ac7e
18f373c
1e0b661
294c2ac
e71ffc5
68d27ee
50a496c
4c219ab
12bfb28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,44 @@ | |
StagePhaseVerifying StagePhase = "Verifying" | ||
) | ||
|
||
type VerificationPhase string | ||
|
||
// Note: VerificationPhases are identical to AnalysisRunPhases. In almost all | ||
// cases, the VerificationPhase will be a reflection of the underlying | ||
// AnalysisRunPhase. There are exceptions to this, such as in the case where an | ||
// AnalysisRun cannot be launched successfully. | ||
|
||
const ( | ||
// VerificationPhasePending denotes a verification process that has not yet | ||
// started yet. | ||
VerificationPhasePending VerificationPhase = "Pending" | ||
// VerificationPhaseRunning denotes a verification that is currently running. | ||
VerificationPhaseRunning VerificationPhase = "Running" | ||
// VerificationPhaseSuccessful denotes a verification process that has | ||
// completed successfully. | ||
VerificationPhaseSuccessful VerificationPhase = "Successful" | ||
// VerificationPhaseFailed denotes a verification process that has completed | ||
// with a failure. | ||
VerificationPhaseFailed VerificationPhase = "Failed" | ||
// VerificationPhaseError denotes a verification process that has completed | ||
// with an error. | ||
VerificationPhaseError VerificationPhase = "Error" | ||
// VerificationPhaseInconclusive denotes a verification process that has | ||
// completed with an inconclusive result. | ||
VerificationPhaseInconclusive VerificationPhase = "Inconclusive" | ||
) | ||
|
||
// IsTerminal returns true if the VerificationPhase is a terminal one. | ||
func (v *VerificationPhase) IsTerminal() bool { | ||
switch *v { | ||
case VerificationPhaseSuccessful, VerificationPhaseFailed, | ||
VerificationPhaseError, VerificationPhaseInconclusive: | ||
return true | ||
default: | ||
return false | ||
} | ||
} | ||
|
||
// +kubebuilder:validation:Enum={ImageAndTag,Tag,ImageAndDigest,Digest} | ||
type ImageUpdateValueType string | ||
|
||
|
@@ -485,7 +523,7 @@ | |
Charts []Chart `json:"charts,omitempty"` | ||
// VerificationInfo is information about any verification process that was | ||
// associated with this Freight for this Stage. | ||
VerificationInfo *VerificationInfo `json:"verificationResult,omitempty"` | ||
VerificationInfo *VerificationInfo `json:"verificationInfo,omitempty"` | ||
} | ||
|
||
type FreightReferenceStack []FreightReference | ||
|
@@ -673,7 +711,17 @@ | |
// VerificationInfo contains information about the currently running | ||
// Verification process. | ||
type VerificationInfo struct { | ||
AnalysisRun AnalysisRunReference `json:"analysisRun"` | ||
// Phase describes the current phase of the Verification process. Generally, | ||
// this will be a reflection of the underlying AnalysisRun's phase, however, | ||
// there are exceptions to this, such as in the case where an AnalysisRun | ||
// cannot be launched successfully. | ||
Phase VerificationPhase `json:"phase,omitempty"` | ||
// Message may contain additional information about why the verification | ||
// process is in its current phase. | ||
Message string `json:"message,omitempty"` | ||
Comment on lines
+714
to
+721
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are the main changes to the resources types. It's always been possible that something could go wrong with a verification other than an AnalysisRun failing or erroring, so really, this is the way things should have been done from the start. Added Phase and Message fields for reporting such problems. The specific problem that is more likely to occur, starting with this PR, is that verification is requested, but the controller doesn't have Rollouts integration enabled. This means an AnalysisRun cannot even be launched. |
||
// AnalysisRun is a reference to the Argo Rollouts AnalysisRun that implements | ||
// the Verification process. | ||
AnalysisRun *AnalysisRunReference `json:"analysisRun,omitempty"` | ||
} | ||
|
||
// AnalysisRunReference is a reference to an AnalysisRun. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,4 +76,12 @@ rules: | |
verbs: | ||
- patch | ||
- update | ||
{{- if .Values.api.rollouts.integrationEnabled }} | ||
- apiGroups: | ||
- argoproj.io | ||
resources: | ||
- analysistemplates | ||
verbs: | ||
- "*" | ||
{{- end }} | ||
Comment on lines
+79
to
+86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes #1379 |
||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an oops to begin with.