Skip to content
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

tls: Check for certs to mark tls as unmanaged (PROJQUAY-2428) #518

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

jonathankingfc
Copy link
Collaborator

@jonathankingfc jonathankingfc commented Sep 9, 2021

  • TLS should determined to be unmanaged by the presence of tls cert and key, not on any particular field
  • Fields from the config.yaml are no longer used to determine this

controllers/quay/quayregistry_controller.go Show resolved Hide resolved
updatedQuay.Status.Conditions = v1.RemoveCondition(updatedQuay.Status.Conditions, v1.ConditionTypeRolloutBlocked)

for _, component := range updatedQuay.Spec.Components {
contains, err := kustomize.ContainsComponentConfig(userProvidedConfig, component)
contains, err := kustomize.ContainsComponentConfig(userProvidedConfig, userProvidedCerts, component)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could pass in configBundle.Data directly, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not unless we alter how it is called elsewhere as well, since the call to this function in configure.go takes a different shape as configBundle.Data.

Copy link
Contributor

@ricardomaraschini ricardomaraschini Sep 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow, configBundle.Data is of type map[string][]byte. userProvidedCerts is also a map[string][]byte.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this, but we will then have to combine reconfigureRequest.Certs and reconfigureRequest.Config into a single map in configure.go

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow, sorry. This makes no sense to me. The code "copies" data from A (configBundle.Data) to B (userProvidedCerts) if data is present in A, at last it then passes B to the function instead of just passing A and avoid the "copy" all together. Why can't we pass A directly here? As far as I understand nothing needs to be changed in configure.go.

updatedQuay.Status.Conditions = v1.RemoveCondition(updatedQuay.Status.Conditions, v1.ConditionTypeRolloutBlocked)

for _, component := range updatedQuay.Spec.Components {
contains, err := kustomize.ContainsComponentConfig(userProvidedConfig, component)
contains, err := kustomize.ContainsComponentConfig(userProvidedConfig, userProvidedCerts, component)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow, sorry. This makes no sense to me. The code "copies" data from A (configBundle.Data) to B (userProvidedCerts) if data is present in A, at last it then passes B to the function instead of just passing A and avoid the "copy" all together. Why can't we pass A directly here? As far as I understand nothing needs to be changed in configure.go.

- TLS is determined to be unmanaged by the presence of tls cert and key
- Fields from the config.yaml are no longer used to determine this
@ricardomaraschini ricardomaraschini merged commit dc31182 into master Sep 14, 2021
@jonathankingfc jonathankingfc deleted the PROJQUAY-2428 branch October 27, 2021 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants