Skip to content

Conversation

@MichalFupso
Copy link
Contributor

@MichalFupso MichalFupso commented Apr 23, 2025

Description

Allow the use of short names for Staged Policies

StagedNetworkPolicy -> snp
StagedGlobalNetworkPolicy -> sgnp
StagedKubernetesNetworkPolicy -> sknp

Related issues/PRs

Todos

  • Tests
  • Documentation
  • Release note

Release Note

TBD

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@MichalFupso MichalFupso requested a review from a team as a code owner April 23, 2025 16:45
@marvin-tigera marvin-tigera added this to the Calico v3.31.0 milestone Apr 23, 2025
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 23, 2025
@MichalFupso MichalFupso added docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact and removed release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Apr 23, 2025
p.StorageType,
authorizer,
[]string{},
[]string{"sgnp", "csgnp", "calicostagedglobalnetworkpolicies"},
Copy link
Member

Choose a reason for hiding this comment

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

We should add calicostagedglobalnetworkpolicy.

@mazdakn
Copy link
Member

mazdakn commented Apr 23, 2025

I think we should add short names for stagedkubernetespolicy as well.

@MichalFupso MichalFupso force-pushed the stagedpolicy-shortname branch from 8135f19 to e79d543 Compare April 23, 2025 19:01
Copy link
Member

@matthewdupre matthewdupre left a comment

Choose a reason for hiding this comment

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

Some name tweaks

p.StorageType,
authorizer,
[]string{},
[]string{"csnp", "calicostagednetworkpolicy", "calicostagednetworkpolicies"},
Copy link
Member

Choose a reason for hiding this comment

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

I think these names are a bit confusing: the resource kind is StagedNetworkPolicy, so these should allude to that. I think it's also preferable to have the s appear at the start. So here I think the good options would be "snp", "stagednetworkpolicy".

Copy link
Member

Choose a reason for hiding this comment

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

And then maybe add "scnp", "stagedcaliconetworkpolicy"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think for this one we might be good with just the "snp", if we would want to add the calico differentiation we should follow the same order as for networkpolicy which has calico at front (caliconetworkpolicy)

Copy link
Member

Choose a reason for hiding this comment

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

:( - so much inconsistency. Ah well. I think the names I'd like to see most are the ones that are just word->letter mappings from the kind in the same ordering.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, agreed - the important one here is snp I think

p.StorageType,
authorizer,
[]string{},
[]string{"sgnp", "csgnp", "calicostagedglobalnetworkpolicies", "calicostagedglobalnetworkpolicy"},
Copy link
Member

@matthewdupre matthewdupre Apr 23, 2025

Choose a reason for hiding this comment

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

I don't think we should have the csgnp option (keep staged in front), and I don't think we need the Calico qualifier either since there is no k8s GlobalNetworkPolicy

@MichalFupso MichalFupso merged commit 7764bd5 into projectcalico:master Apr 28, 2025
5 checks passed
MichalFupso added a commit to MichalFupso/calico that referenced this pull request May 16, 2025
caseydavenport pushed a commit that referenced this pull request May 16, 2025
@MichalFupso MichalFupso added cherry-pick-completed PR has been cherry-picked and removed cherry-pick-candidate labels May 16, 2025
lubronzhan pushed a commit to lubronzhan/calico that referenced this pull request May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-completed PR has been cherry-picked docs-not-required Docs not required for this change release-note-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants