-
Notifications
You must be signed in to change notification settings - Fork 13
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
ROX-26039: Create tenant argoCd app #2009
base: main
Are you sure you want to change the base?
Conversation
cb7795a
to
2f08d57
Compare
f42e55c
to
a1ac500
Compare
a1ac500
to
3635f24
Compare
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.
🔥
e3a4736
to
e4d10fa
Compare
New changes are detected. LGTM label has been removed. |
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.
I don't like being the "Process-driven block a PR because of formal issues guy", but for a change like this, I'd expect more information in the PR description. For instance how you've tested the changes and also a functional description of what you expect / not expect to work after this PR.
fleetshard/config/config.go
Outdated
DefaultTenantArgoCdAppSourceRepoURL string `env:"TENANT_ARGOCD_APP_SOURCE_REPO_URL_DEFAULT" envDefault:"https://github.com/stackrox/acscs-manifests.git"` | ||
DefaultTenantArgoCdAppSourceRef string `env:"TENANT_ARGOCD_APP_SOURCE_REF_DEFAULT" envDefault:"HEAD"` | ||
DefaultTenantArgoCdAppSourcePath string `env:"TENANT_ARGOCD_APP_SOURCE_PATH_DEFAULT" envDefault:"tenant-resources"` |
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.
The naming of the Env variables compared to the field is inconsistent. The "DEFAULT" should be at the start of the variable name.
Looking at the other parts of this PR I wonder if we even need that "Default" prefix. Currently it's never set to a "non-default" value. Is that going to come with a future PR?
Other thing to mention is that even if we can override it on a per tenant basis, on the CentralReconciler
and CentralReconcilerOptions
struct it shouldn't be called Default*
anymore if the override is applied on that level.
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.
I named it default in the sense of it being the default if there are no per-tenant overrides. You are recommending dropping the DEFAULT here ?
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.
For this specific env variables I'd recommend to make the naming consistent. The default should be either a prefix or a suffix, for instance: Env Variable: TENANT_ARGOCD_APP_SOURCE_REF_DEFAULT
should be field TenantArgoCdAppSourceRefDefault
not DefaultTenantArgoCdAppSourceRef
For the CentralReconciler
/ CentralReconcilerOptions
I don't see any logic for overriding that values on a per-tenant basis, so I'm questioning if this is going to be added in follow up PRs or if the "Default" prefix is unnecessary.
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.
The ability to override the ArgoCD application source (repo/path/ref) will be added later
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.
I'll rename the env var to be consistent
return nil | ||
} | ||
|
||
func (r *CentralReconciler) getArgoCDApplication(remoteCentral private.ManagedCentral) (*argocd.Application, error) { |
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.
nit: The method name was confusing me. I expected this function to send a GET requests to argoCd as opposed to creating the *argocd.Application
object from a remoteCentral.
} else { | ||
|
||
{ | ||
// This little part would only happen if we enable, then disable ArgoCD for a tenant |
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.
In my understanding this part would execute on every reconciliation where remoteCentral.Spec.ArgoCd.Enabled != true
, am I wrong here? If so could you explain why?
Maybe the function would be NOOP in that case but it would go through this code path.
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.
Not every reconciliation, only if the hashSum has been changed.
This would run if
- ArgoCD enabled for a tenant
- Then ArgoCD disabled for a tenant
This would basically clean up the ArgoCD application
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.
Not every reconciliation, only if the hashSum has been changed.
True, forgot about that part.
Still I think this code path would run even if ArgoCD was never enabled for a tenant. Not only in the situation described above, which makes the statement of the comment wrong.
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.
Ah I see what you mean. Will change to
This little part handles the case where we enable, then disable ArgoCD for a tenant
You're right. After some thought, I believe it would make sense to merge both https://github.com/stackrox/acs-fleet-manager/pull/2074/files and this PR together. Otherwise it might break the local development setup (because argoCD CRDs would not be present). Though it is easier to review separately. Edit: suspicion confirmed by the failing e2e test.
|
e4d10fa
to
a614365
Compare
5724a64
to
cee658d
Compare
/retest |
4 similar comments
/retest |
/retest |
/retest |
/retest |
/retest |
Description
Adds the support for deploying tenant-resources through ArgoCD rather than the built-in
tenant-resources
chart. TheCentralReconciler
willEnvironment variables have been added that represent the default
tenant-resources
application source. Currently, it defaults togithub.com/stackrox/acscs-manifests
tenant-resources
HEAD
Because this is an opt-in feature, at this point deploying this will have no consequence on the int/stage/prod environments.
The
acscs-manifests
repository is private. But ArgoCD should have access to it thanks to https://github.com/stackrox/acs-fleet-manager-aws-config/pull/257A further step in the development of the feature is to enable the local development support for ArgoCD: https://github.com/stackrox/acs-fleet-manager/pull/2074/files
Checklist (Definition of Done)
Test manual
ROX-12345: ...
Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.Add secret to app-interface Vault or Secrets Manager if necessaryRDS changes were e2e tested manuallyCheck AWS limits are reasonable for changes provisioning new resourcesTest manual
TODO: Add manual testing efforts