Closed astoycos closed 1 year ago
Name | Link |
---|---|
Latest commit | bf6f6c21bfd5c1381646dda29bd624ceb004ca28 |
Latest deploy log | https://app.netlify.com/sites/kubernetes-sigs-network-policy-api/deploys/6467c27070c5be0008ddadf3 |
Deploy Preview | https://deploy-preview-91--kubernetes-sigs-network-policy-api.netlify.app/reference/spec |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: astoycos
The full list of commands accepted by this bot can be found here.
The pull request process is described here
/assign @tssurya @npinaeva @Dyanngg
@astoycos: GitHub didn't allow me to assign the following users: npinaeva.
Note that only kubernetes-sigs members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. For more information please see the contributor guide
Please take a look at these changes + the new version of the website in the netlify preview and let me know if it needs to change at all :)
Getting this in should allow us to cut a release of v1alpha1 early next week.
/hold
so that it doesn't automatically merge with an lgtm
TODO: Refer to all our APIs as NPV2
Fixed Up following the conversation in our sig-network-policy-api meeting today
once the cut PR is merged I can do a test in my implementation PR to see if things are working correctly.
/cc
which makes me curious how the yamls were generated... is the pkg/generator/main.go overwriting what we do from codegen? because I see this change in the yaml but we never changed the types.go file so... was the yaml file changes manually done?
So now we don't use the cotroller-gen CLI to do this the generator pkg does it by calling into the controller-gen go package.
log.Printf("generating CRD for %v\n", groupKind)
parser.NeedCRDFor(groupKind, nil)
crdRaw := parser.CustomResourceDefinitions[groupKind]
// Inline version of "addAttribution(&crdRaw)" ...
if crdRaw.ObjectMeta.Annotations == nil {
crdRaw.ObjectMeta.Annotations = map[string]string{}
}
crdRaw.ObjectMeta.Annotations[bundleVersionAnnotation] = bundleVersion
crdRaw.ObjectMeta.Annotations[apiext.KubeAPIApprovedAnnotation] = approvalLink
// Prevent the top level metadata for the CRD to be generated regardless of the intention in the arguments
crd.FixTopLevelMetadata(crdRaw)
conv, err := crd.AsVersion(crdRaw, apiext.SchemeGroupVersion)
if err != nil {
log.Fatalf("failed to convert CRD: %s", err)
}
out, err := yaml.Marshal(conv)
if err != nil {
log.Fatalf("failed to marshal CRD: %s", err)
}
fileName := fmt.Sprintf("config/crd/%s_%s.yaml", crdRaw.Spec.Group, crdRaw.Spec.Names.Plural)
err = os.WriteFile(fileName, out, 0o600)
if err != nil {
log.Fatalf("failed to write CRD: %s", err)
}
}
Generates the CRDs with the "sigs.k8s.io/controller-tools/pkg/crd"
package, adds the specified annotations and writes the CRD to disk
Generates the CRDs with the
"sigs.k8s.io/controller-tools/pkg/crd"
package, adds the specified annotations and writes the CRD to disk
+1 way neater. Almost lgtm: I think we still need to add a warning comment for same/notSame labels before the cut:
we probably want to include Dan's suggestion in the description part of same and notsame lables saying "this is subject to change in future, not stable" ?
+1 @tssurya If it's alright with you I think we can go ahead and merge this, then do a final look at the tooling + any other small API comments before we complete #93
ack fine with me, let's merge this!
/lgtm
/lgtm
Partially fixes #59 Fixes #89