Skip to content

Conversation

@samuelkarp
Copy link
Member

Part of #9312

These haven't been removed from main yet, so opening them here and then will backport.

@samuelkarp samuelkarp mentioned this pull request Nov 2, 2023
3 tasks
@samuelkarp samuelkarp added this to the 2.0 milestone Nov 2, 2023
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

}
log.G(ctx).Warning("`auths` is deprecated, please use `configs` instead")
warnings = append(warnings, deprecation.CRIRegistryAuths)
log.G(ctx).Warning("`auths` is deprecated, please use `ImagePullSecrets` instead")
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to leave the logging to the caller of this function? Or would that be complicated, because we also want to log the replacement?

(not a blocker, just thinking out loud)

Copy link
Member Author

Choose a reason for hiding this comment

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

I hadn't considered that. I think this is easier since the log line message and the deprecation warning message are different, but I don't really have a strong opinion on it.

Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker as well; existing code already logs, so it's not a new change in this PR.

Mostly planting "food for thought" here; reduce/avoid logging in library packages where it may not be needed by all consumers of it. That said, containerd's "context" logger can already provide more control over logging to the consumer

(but I just realise that I don't think we have a WithoutLogger() utility to disable / remove a logger from a context - perhaps that's something we should think about 🤔)


if len(c.Registry.Configs) != 0 {
warnings = append(warnings, deprecation.CRIRegistryConfigs)
log.G(ctx).Warning("`configs` is deprecated, please use `config_path` instead")
Copy link
Member

Choose a reason for hiding this comment

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

Bit orthogonal, and definitely not a blocker (I lost a better reference about this (:disappointed:) that had some great motivations / background on this), but generally "please" should be avoided in messages; here's some references (but perhaps there's better ones);

Copy link
Member Author

Choose a reason for hiding this comment

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

I've never considered that before!

I matched the existing messages which had "please". Do you feel strongly enough that we should change this?

Copy link
Member

Choose a reason for hiding this comment

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

No, not a blocker for this PR at all. I did notice the existing wording, so it made perfect sense to match that (consistency > being perfect), but it's something we could look at separately and check if we have more occurrences like that.

@samuelkarp samuelkarp force-pushed the config-deprecation-warnings branch from cb1d572 to a30c2d1 Compare November 2, 2023 16:43
@samuelkarp
Copy link
Member Author

samuelkarp force-pushed the config-deprecation-warnings branch from cb1d572 to a30c2d1

Rebase to resolve conflicts with #9316

@samuelkarp samuelkarp force-pushed the config-deprecation-warnings branch from a30c2d1 to b221457 Compare November 2, 2023 18:12
@samuelkarp
Copy link
Member Author

Rebased again to resolve conflicts with #9321

@samuelkarp samuelkarp force-pushed the config-deprecation-warnings branch from b221457 to a596d09 Compare November 2, 2023 18:17
@thaJeztah
Copy link
Member

Who wants to relief Sam from rebase hell? 😂 ❤️

@samuelkarp
Copy link
Member Author

I'm just waiting for CI to pass and then put this in the merge queue 😂

@samuelkarp samuelkarp added the area/cri Container Runtime Interface (CRI) label Nov 2, 2023
@samuelkarp samuelkarp enabled auto-merge November 2, 2023 19:07
@samuelkarp samuelkarp removed the request for review from ruiwen-zhao November 2, 2023 19:08
@samuelkarp
Copy link
Member Author

@thaJeztah Mind reviewing after the last rebase so this can merge?

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@samuelkarp samuelkarp added this pull request to the merge queue Nov 2, 2023
@samuelkarp samuelkarp added cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Nov 2, 2023
Merged via the queue into containerd:main with commit edbd387 Nov 2, 2023
@samuelkarp samuelkarp deleted the config-deprecation-warnings branch November 3, 2023 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cri Container Runtime Interface (CRI) cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants