sclorg / container-common-scripts

Apache License 2.0
21 stars 45 forks source link

Do not delete secrets with parametr --all #343

Closed phracek closed 1 year ago

phracek commented 1 year ago

This pull request disables deleting all 'secrets' and 'services' over all namespaces. Secrets are used for communication with kubernetes, docker etc.

phracek commented 1 year ago

[test]

phracek commented 1 year ago

More detail description. Also part of commit message.

In our nightly build tests when we clean a project, secrets are also delete which is not expected.

Example is here:

oc gets info about secrets
NAME                                        TYPE                                  DATA   AGE
6340056-core-services-apps-ci-pull-secret   kubernetes.io/dockerconfigjson        1      2m29s
builder-dockercfg-lvf4s                     kubernetes.io/dockercfg               1      63s
builder-token-cb2bj                         kubernetes.io/service-account-token   4      63s
default-dockercfg-k6ns9                     kubernetes.io/dockercfg               1      63s
default-token-66444                         kubernetes.io/service-account-token   4      63s
deployer-dockercfg-p7q9j                    kubernetes.io/dockercfg               1      63s
deployer-token-2vkxg                        kubernetes.io/service-account-token   4      63s
oc deletes secrets with --all --force --grace-period=0

These secrets are valid for the whole cluster and when it is deleted, then the other projects and communication will not work properly.

phracek commented 1 year ago

[test]

zmiklank commented 1 year ago

More detail description. Also part of commit message.

Thank you! Could you please also explain me why the services ("svc") are not deleted?

phracek commented 1 year ago

More detail description. Also part of commit message.

Thank you! Could you please also explain me why the services ("svc") are not deleted?

It looks like I did not review it carefully. Services has to be deleted.

phracek commented 1 year ago

[test]