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

Control the policy controller monitoring resources from chart, enhanc… #1687

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
44b4cc6
Add check for ACR registry in ACR credential helper (#1658)
codysoyland Oct 31, 2024
7895e28
chore(deps): Bump google-github-actions/auth from 2.1.6 to 2.1.7 (#1683)
dependabot[bot] Oct 31, 2024
513fa0c
Control the policy controller monitoring resources from chart, enhanc…
Nov 3, 2024
515484d
Merge branch 'sigstore:main' into issues_1388
senanz Nov 12, 2024
3be400a
Merge branch 'sigstore:main' into issues_1388
senanz Nov 12, 2024
3743c98
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Nov 12, 2024
471eeb4
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Nov 12, 2024
2a8b34c
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Nov 12, 2024
ed8e23c
Merge branch 'sigstore:main' into issues_1388
senanz Nov 17, 2024
c11762b
Merge branch 'sigstore:main' into issues_1388
senanz Nov 20, 2024
f5173ff
Merge branch 'sigstore:main' into issues_1388
senanz Nov 27, 2024
c985ec4
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Nov 12, 2024
dc0d9f6
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Nov 28, 2024
5756c09
Merge branch 'sigstore:main' into issues_1388
senanz Dec 9, 2024
12ea994
Merge branch 'sigstore:main' into issues_1388
senanz Dec 12, 2024
8bf379c
--amend
Dec 12, 2024
ee188b3
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Dec 12, 2024
0adb803
Merge branch 'sigstore:main' into issues_1388
senanz Dec 19, 2024
d276c31
Merge branch 'sigstore:main' into issues_1388
senanz Dec 23, 2024
e9fbf09
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Dec 12, 2024
790238f
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Dec 23, 2024
2663fba
Merge branch 'sigstore:main' into issues_1388
senanz Dec 30, 2024
034ca94
Merge branch 'sigstore:main' into issues_1388
senanz Dec 30, 2024
aa63abe
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Dec 30, 2024
2d7d559
Merge branch 'sigstore:main' into issues_1388
senanz Jan 2, 2025
4045d4e
Merge branch 'sigstore:main' into issues_1388
senanz Jan 3, 2025
29ee753
Control the policy controller monitoring resources from chart, enhanc…
Nov 3, 2024
e3b82ef
--amend
Dec 12, 2024
391f086
Merge branch 'issues_1388' of https://github.com/senanz/policy-contro…
Jan 3, 2025
8723902
Fix the formatting of the files and change misleading test name
Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/kind-cluster-custom-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name: Test policy-controller with custom resource

on:
pull_request:
branches: [ 'main', 'release-*' ]
branches: ["main", "release-*"]

defaults:
run:
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: './go.mod'
go-version-file: "./go.mod"
check-latest: true

# will use the latest release available for ko
Expand All @@ -122,7 +122,7 @@ jobs:
k8s-version: ${{ matrix.k8s-version}}
version: ${{ env.SCAFFOLDING_RELEASE_VERSION }}

- name: Install policy-controller-with-only-pod-resource
- name: Install policy-controller-with-replicasets-daemonsets-resource
env:
GIT_HASH: ${{ github.sha }}
GIT_VERSION: ci
Expand All @@ -141,6 +141,7 @@ jobs:
- name: Run Custom resources Tests
senanz marked this conversation as resolved.
Show resolved Hide resolved
timeout-minutes: 5
run: |
chmod +x ./test/e2e_test_policy_custom_resource.sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI, you should be able to make this change in git so that you don't have to do this here.

./test/e2e_test_policy_custom_resource.sh

- name: Collect diagnostics
Expand Down
14 changes: 7 additions & 7 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@
disableTUF = flag.Bool("disable-tuf", false, "Disable TUF support.")

// Validate specific resources.
// https://github.com/sigstore/policy-controller/issues/1388
resourcesNames = flag.String("resource-name", "replicasets, deployments, pods, cronjobs, jobs, statefulsets, daemonsets", "Comma-separated list of resources")
// Split the input string into a slice of strings
listResources []string
types map[schema.GroupVersionKind]resourcesemantics.GenericCRD
// https://github.com/sigstore/policy-controller/issues/1388
resourcesNames = flag.String("resource-name", "replicasets, deployments, pods, cronjobs, jobs, statefulsets, daemonsets", "Comma-separated list of resources")
// Split the input string into a slice of strings
listResources []string
types map[schema.GroupVersionKind]resourcesemantics.GenericCRD

// mutatingCIPWebhookName holds the name of the mutating webhook configuration
// resource dispatching admission requests to policy-webhook.
Expand Down Expand Up @@ -124,8 +124,8 @@
flag.IntVar(&opts.Port, "secure-port", opts.Port, "The port on which to serve HTTPS.")

flag.Parse()
resourcesNamesList := strings.Split(*resourcesNames, ",")
listResources = append(listResources, resourcesNamesList...)
listResources = append(listResources, resourcesNamesList...)

Check warning on line 128 in cmd/webhook/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/webhook/main.go#L127-L128

Added lines #L127 - L128 were not covered by tests

// If TUF has been disabled do not try to set it up.
if !*disableTUF {
Expand All @@ -150,7 +150,7 @@

// This must match the set of resources we configure in
// cmd/webhook/main.go in the "types" map.
common.ValidResourceNames = sets.NewString(resourcesNamesList...)

Check warning on line 153 in cmd/webhook/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/webhook/main.go#L153

Added line #L153 was not covered by tests

v := version.GetVersionInfo()
vJSON, _ := v.JSONString()
Expand Down Expand Up @@ -207,29 +207,29 @@
}
}

func createTypesMap(kindsList []string) map[schema.GroupVersionKind]resourcesemantics.GenericCRD {
types := make(map[schema.GroupVersionKind]resourcesemantics.GenericCRD)
for _, kind := range kindsList {
kind = strings.TrimSpace(kind)
switch kind {
case "pods":
types[corev1.SchemeGroupVersion.WithKind("Pod")] = &crdEphemeralContainers{GenericCRD: &duckv1.Pod{}}
case "replicasets":
types[appsv1.SchemeGroupVersion.WithKind("ReplicaSet")] = &crdNoStatusUpdatesOrDeletes{GenericCRD: &policyduckv1beta1.PodScalable{}}
case "deployments":
types[appsv1.SchemeGroupVersion.WithKind("Deployment")] = &crdNoStatusUpdatesOrDeletes{GenericCRD: &policyduckv1beta1.PodScalable{}}
case "statefulsets":
types[appsv1.SchemeGroupVersion.WithKind("StatefulSet")] = &crdNoStatusUpdatesOrDeletes{GenericCRD: &policyduckv1beta1.PodScalable{}}
case "daemonsets":
types[appsv1.SchemeGroupVersion.WithKind("DaemonSet")] = &crdNoStatusUpdatesOrDeletes{GenericCRD: &duckv1.WithPod{}}
case "jobs":
types[batchv1.SchemeGroupVersion.WithKind("Job")] = &crdNoStatusUpdatesOrDeletes{GenericCRD: &duckv1.WithPod{}}
case "cronjobs":
types[batchv1.SchemeGroupVersion.WithKind("CronJob")] = &crdNoStatusUpdatesOrDeletes{GenericCRD: &duckv1.CronJob{}}
types[batchv1beta1.SchemeGroupVersion.WithKind("CronJob")] = &crdNoStatusUpdatesOrDeletes{GenericCRD: &duckv1.CronJob{}}

Check warning on line 229 in cmd/webhook/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/webhook/main.go#L210-L229

Added lines #L210 - L229 were not covered by tests
}
}
return types

Check warning on line 232 in cmd/webhook/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/webhook/main.go#L232

Added line #L232 was not covered by tests
}

var typesCIP = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
Expand All @@ -242,7 +242,7 @@

func NewValidatingAdmissionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
// Decorate contexts with the current state of the config.
types = createTypesMap(listResources)

Check warning on line 245 in cmd/webhook/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/webhook/main.go#L245

Added line #L245 was not covered by tests
store := config.NewStore(logging.FromContext(ctx).Named("config-store"))
store.WatchConfigs(cmw)
policyControllerConfigStore := policycontrollerconfig.NewStore(logging.FromContext(ctx).Named("config-policy-controller"))
Expand Down Expand Up @@ -300,7 +300,7 @@
}
ctx = webhook.WithOptions(ctx, *woptions)
validator := cwebhook.NewValidator(ctx)
types = createTypesMap(listResources)
types = createTypesMap(listResources)

Check warning on line 303 in cmd/webhook/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/webhook/main.go#L303

Added line #L303 was not covered by tests
return defaulting.NewAdmissionController(ctx,
// Name of the resource webhook.
*webhookName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package cleanhttp offers convenience utilities for acquiring "clean"

Check failure on line 1 in third_party/VENDOR-LICENSE/github.com/hashicorp/go-cleanhttp/doc.go

View workflow job for this annotation

GitHub Actions / Verify codegen

Please run ./hack/update-codegen.sh. diff --git a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-cleanhttp/doc.go b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-cleanhttp/doc.go index 905859c7..05841092 100644 --- a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-cleanhttp/doc.go +++ b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-cleanhttp/doc.go @@ -16,4 +16,5 @@ // connecting to the same hosts repeatedly from the same client, you can use // DefaultPooledClient to receive a client that has connection pooling // semantics similar to http.DefaultClient. +// package cleanhttp
// http.Transport and http.Client structs.
//
// Values set on http.DefaultClient and http.DefaultTransport affect all
Expand All @@ -16,5 +16,4 @@
// connecting to the same hosts repeatedly from the same client, you can use
// DefaultPooledClient to receive a client that has connection pooling
// semantics similar to http.DefaultClient.
//
package cleanhttp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package strutil

Check failure on line 1 in third_party/VENDOR-LICENSE/github.com/hashicorp/go-secure-stdlib/strutil/strutil.go

View workflow job for this annotation

GitHub Actions / Verify codegen

Please run ./hack/update-codegen.sh. diff --git a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-secure-stdlib/strutil/strutil.go b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-secure-stdlib/strutil/strutil.go index b342b506..102462dc 100644 --- a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-secure-stdlib/strutil/strutil.go +++ b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-secure-stdlib/strutil/strutil.go @@ -110,11 +110,11 @@ func ParseKeyValues(input string, out map[string]string, sep string) error { // ParseArbitraryKeyValues parses arbitrary <key,value> tuples. The input // can be one of the following: -// - JSON string -// - Base64 encoded JSON string -// - Comma separated list of `<key>=<value>` pairs -// - Base64 encoded string containing comma separated list of -// `<key>=<value>` pairs +// * JSON string +// * Base64 encoded JSON string +// * Comma separated list of `<key>=<value>` pairs +// * Base64 encoded string containing comma separated list of +// `<key>=<value>` pairs // // Input will be parsed into the output parameter, which should // be a non-nil map[string]string.

import (
"encoding/base64"
Expand Down Expand Up @@ -110,11 +110,11 @@

// ParseArbitraryKeyValues parses arbitrary <key,value> tuples. The input
// can be one of the following:
// * JSON string
// * Base64 encoded JSON string
// * Comma separated list of `<key>=<value>` pairs
// * Base64 encoded string containing comma separated list of
// `<key>=<value>` pairs
// - JSON string
// - Base64 encoded JSON string
// - Comma separated list of `<key>=<value>` pairs
// - Base64 encoded string containing comma separated list of
// `<key>=<value>` pairs
//
// Input will be parsed into the output parameter, which should
// be a non-nil map[string]string.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sockaddr

Check failure on line 1 in third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddr.go

View workflow job for this annotation

GitHub Actions / Verify codegen

Please run ./hack/update-codegen.sh. diff --git a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddr.go b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddr.go index 27767887..0811b275 100644 --- a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddr.go +++ b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddr.go @@ -17,7 +17,7 @@ func init() { // // ``` // $ sockaddr eval -r '{{GetPrivateInterfaces | attr "address"}}' -// / ``` +/// ``` func GetPrivateIP() (string, error) { privateIfs, err := GetPrivateInterfaces() if err != nil { @@ -39,7 +39,7 @@ func GetPrivateIP() (string, error) { // // ``` // $ sockaddr eval -r '{{GetAllInterfaces | include "RFC" "6890" | join "address" " "}}' -// / ``` +/// ``` func GetPrivateIPs() (string, error) { ifAddrs, err := GetAllInterfaces() if err != nil { @@ -86,7 +86,7 @@ func GetPrivateIPs() (string, error) { // // ``` // $ sockaddr eval -r '{{GetPublicInterfaces | attr "address"}}' -// / ``` +/// ``` func GetPublicIP() (string, error) { publicIfs, err := GetPublicInterfaces() if err != nil { @@ -108,7 +108,7 @@ func GetPublicIP() (string, error) { // // ``` // $ sockaddr eval -r '{{GetAllInterfaces | exclude "RFC" "6890" | join "address" " "}}' -// / ``` +/// ``` func GetPublicIPs() (string, error) { ifAddrs, err := GetAllInterfaces() if err != nil { @@ -147,7 +147,7 @@ func GetPublicIPs() (string, error) { // // ``` // $ sockaddr eval -r '{{GetAllInterfaces | include "name" <<ARG>> | sort "type,size" | include "flag" "forwardable" | attr "address" }}' -// / ``` +/// ``` func GetInterfaceIP(namedIfRE string) (string, error) { ifAddrs, err := GetAllInterfaces() if err != nil { @@ -188,7 +188,7 @@ func GetInterfaceIP(namedIfRE string) (string, error) { // // ``` // $ sockaddr eval -r '{{GetAllInterfaces | include "name" <<ARG>> | sort "type,size" | join "address" " "}}' -// / ``` +/// ``` func GetInterfaceIPs(namedIfRE string) (string, error) { ifAddrs, err := GetAllInterfaces() if err != nil {

import "strings"

Expand All @@ -17,7 +17,7 @@
//
// ```
// $ sockaddr eval -r '{{GetPrivateInterfaces | attr "address"}}'
/// ```
// / ```
func GetPrivateIP() (string, error) {
privateIfs, err := GetPrivateInterfaces()
if err != nil {
Expand All @@ -39,7 +39,7 @@
//
// ```
// $ sockaddr eval -r '{{GetAllInterfaces | include "RFC" "6890" | join "address" " "}}'
/// ```
// / ```
func GetPrivateIPs() (string, error) {
ifAddrs, err := GetAllInterfaces()
if err != nil {
Expand Down Expand Up @@ -86,7 +86,7 @@
//
// ```
// $ sockaddr eval -r '{{GetPublicInterfaces | attr "address"}}'
/// ```
// / ```
func GetPublicIP() (string, error) {
publicIfs, err := GetPublicInterfaces()
if err != nil {
Expand All @@ -108,7 +108,7 @@
//
// ```
// $ sockaddr eval -r '{{GetAllInterfaces | exclude "RFC" "6890" | join "address" " "}}'
/// ```
// / ```
func GetPublicIPs() (string, error) {
ifAddrs, err := GetAllInterfaces()
if err != nil {
Expand Down Expand Up @@ -147,7 +147,7 @@
//
// ```
// $ sockaddr eval -r '{{GetAllInterfaces | include "name" <<ARG>> | sort "type,size" | include "flag" "forwardable" | attr "address" }}'
/// ```
// / ```
func GetInterfaceIP(namedIfRE string) (string, error) {
ifAddrs, err := GetAllInterfaces()
if err != nil {
Expand Down Expand Up @@ -188,7 +188,7 @@
//
// ```
// $ sockaddr eval -r '{{GetAllInterfaces | include "name" <<ARG>> | sort "type,size" | join "address" " "}}'
/// ```
// / ```
func GetInterfaceIPs(namedIfRE string) (string, error) {
ifAddrs, err := GetAllInterfaces()
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sockaddr

Check failure on line 1 in third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddrs.go

View workflow job for this annotation

GitHub Actions / Verify codegen

Please run ./hack/update-codegen.sh. diff --git a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddrs.go b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddrs.go index 8f51fc1b..d2713afb 100644 --- a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddrs.go +++ b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ifaddrs.go @@ -303,7 +303,7 @@ func GetDefaultInterfaces() (IfAddrs, error) { // // ``` // $ sockaddr eval -r '{{GetAllInterfaces | include "type" "ip" | include "flags" "forwardable" | include "flags" "up" | sort "default,type,size" | include "RFC" "6890" }}' -// / ``` +/// ``` func GetPrivateInterfaces() (IfAddrs, error) { privateIfs, err := GetAllInterfaces() if err != nil { @@ -351,7 +351,7 @@ func GetPrivateInterfaces() (IfAddrs, error) { // // ``` // $ sockaddr eval -r '{{GetAllInterfaces | include "type" "ip" | include "flags" "forwardable" | include "flags" "up" | sort "default,type,size" | exclude "RFC" "6890" }}' -// / ``` +/// ``` func GetPublicInterfaces() (IfAddrs, error) { publicIfs, err := GetAllInterfaces() if err != nil {

import (
"encoding/binary"
Expand Down Expand Up @@ -303,7 +303,7 @@
//
// ```
// $ sockaddr eval -r '{{GetAllInterfaces | include "type" "ip" | include "flags" "forwardable" | include "flags" "up" | sort "default,type,size" | include "RFC" "6890" }}'
/// ```
// / ```
func GetPrivateInterfaces() (IfAddrs, error) {
privateIfs, err := GetAllInterfaces()
if err != nil {
Expand Down Expand Up @@ -351,7 +351,7 @@
//
// ```
// $ sockaddr eval -r '{{GetAllInterfaces | include "type" "ip" | include "flags" "forwardable" | include "flags" "up" | sort "default,type,size" | exclude "RFC" "6890" }}'
/// ```
// / ```
func GetPublicInterfaces() (IfAddrs, error) {
publicIfs, err := GetAllInterfaces()
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sockaddr

Check failure on line 1 in third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv4addr.go

View workflow job for this annotation

GitHub Actions / Verify codegen

Please run ./hack/update-codegen.sh. diff --git a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv4addr.go b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv4addr.go index 356eb856..4d395dc9 100644 --- a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv4addr.go +++ b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv4addr.go @@ -165,10 +165,10 @@ func (ipv4 IPv4Addr) BroadcastAddress() IPv4Network { // CmpAddress follows the Cmp() standard protocol and returns: // -// - -1 If the receiver should sort first because its address is lower than arg -// - 0 if the SockAddr arg is equal to the receiving IPv4Addr or the argument is -// of a different type. -// - 1 If the argument should sort first. +// - -1 If the receiver should sort first because its address is lower than arg +// - 0 if the SockAddr arg is equal to the receiving IPv4Addr or the argument is +// of a different type. +// - 1 If the argument should sort first. func (ipv4 IPv4Addr) CmpAddress(sa SockAddr) int { ipv4b, ok := sa.(IPv4Addr) if !ok { @@ -187,10 +187,10 @@ func (ipv4 IPv4Addr) CmpAddress(sa SockAddr) int { // CmpPort follows the Cmp() standard protocol and returns: // -// - -1 If the receiver should sort first because its port is lower than arg -// - 0 if the SockAddr arg's port number is equal to the receiving IPv4Addr, -// regardless of type. -// - 1 If the argument should sort first. +// - -1 If the receiver should sort first because its port is lower than arg +// - 0 if the SockAddr arg's port number is equal to the receiving IPv4Addr, +// regardless of type. +// - 1 If the argument should sort first. func (ipv4 IPv4Addr) CmpPort(sa SockAddr) int { var saPort IPPort switch v := sa.(type) { @@ -214,10 +214,10 @@ func (ipv4 IPv4Addr) CmpPort(sa SockAddr) int { // CmpRFC follows the Cmp() standard protocol and returns: // -// - -1 If the receiver should sort first because it belongs to the RFC and its -// arg does not -// - 0 if the receiver and arg both belong to the same RFC or neither do. -// - 1 If the arg belongs to the RFC but receiver does not. +// - -1 If the receiver should sort first because it belongs to the RFC and its +// arg does not +// - 0 if the receiver and arg both belong to the same RFC or neither do. +// - 1 If the arg belongs to the RFC but receiver does not. func (ipv4 IPv4Addr) CmpRFC(rfcNum uint, sa SockAddr) int { recvInRFC := IsRFC(rfcNum, ipv4) ipv4b, ok := sa.(IPv4Addr)

import (
"encoding/binary"
Expand Down Expand Up @@ -165,10 +165,10 @@

// CmpAddress follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because its address is lower than arg
// - 0 if the SockAddr arg is equal to the receiving IPv4Addr or the argument is
// of a different type.
// - 1 If the argument should sort first.
// - -1 If the receiver should sort first because its address is lower than arg
// - 0 if the SockAddr arg is equal to the receiving IPv4Addr or the argument is
// of a different type.
// - 1 If the argument should sort first.
func (ipv4 IPv4Addr) CmpAddress(sa SockAddr) int {
ipv4b, ok := sa.(IPv4Addr)
if !ok {
Expand All @@ -187,10 +187,10 @@

// CmpPort follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because its port is lower than arg
// - 0 if the SockAddr arg's port number is equal to the receiving IPv4Addr,
// regardless of type.
// - 1 If the argument should sort first.
// - -1 If the receiver should sort first because its port is lower than arg
// - 0 if the SockAddr arg's port number is equal to the receiving IPv4Addr,
// regardless of type.
// - 1 If the argument should sort first.
func (ipv4 IPv4Addr) CmpPort(sa SockAddr) int {
var saPort IPPort
switch v := sa.(type) {
Expand All @@ -214,10 +214,10 @@

// CmpRFC follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because it belongs to the RFC and its
// arg does not
// - 0 if the receiver and arg both belong to the same RFC or neither do.
// - 1 If the arg belongs to the RFC but receiver does not.
// - -1 If the receiver should sort first because it belongs to the RFC and its
// arg does not
// - 0 if the receiver and arg both belong to the same RFC or neither do.
// - 1 If the arg belongs to the RFC but receiver does not.
func (ipv4 IPv4Addr) CmpRFC(rfcNum uint, sa SockAddr) int {
recvInRFC := IsRFC(rfcNum, ipv4)
ipv4b, ok := sa.(IPv4Addr)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package sockaddr

Check failure on line 1 in third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv6addr.go

View workflow job for this annotation

GitHub Actions / Verify codegen

Please run ./hack/update-codegen.sh. diff --git a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv6addr.go b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv6addr.go index bd49fb7a..d7f41211 100644 --- a/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv6addr.go +++ b/third_party/VENDOR-LICENSE/github.com/hashicorp/go-sockaddr/ipv6addr.go @@ -173,10 +173,10 @@ func (ipv6 IPv6Addr) AddressHexString() string { // CmpAddress follows the Cmp() standard protocol and returns: // -// - -1 If the receiver should sort first because its address is lower than arg -// - 0 if the SockAddr arg equal to the receiving IPv6Addr or the argument is of a -// different type. -// - 1 If the argument should sort first. +// - -1 If the receiver should sort first because its address is lower than arg +// - 0 if the SockAddr arg equal to the receiving IPv6Addr or the argument is of a +// different type. +// - 1 If the argument should sort first. func (ipv6 IPv6Addr) CmpAddress(sa SockAddr) int { ipv6b, ok := sa.(IPv6Addr) if !ok { @@ -193,10 +193,10 @@ func (ipv6 IPv6Addr) CmpAddress(sa SockAddr) int { // CmpPort follows the Cmp() standard protocol and returns: // -// - -1 If the receiver should sort first because its port is lower than arg -// - 0 if the SockAddr arg's port number is equal to the receiving IPv6Addr, -// regardless of type. -// - 1 If the argument should sort first. +// - -1 If the receiver should sort first because its port is lower than arg +// - 0 if the SockAddr arg's port number is equal to the receiving IPv6Addr, +// regardless of type. +// - 1 If the argument should sort first. func (ipv6 IPv6Addr) CmpPort(sa SockAddr) int { var saPort IPPort switch v := sa.(type) { @@ -220,10 +220,10 @@ func (ipv6 IPv6Addr) CmpPort(sa SockAddr) int { // CmpRFC follows the Cmp() standard protocol and returns: // -// - -1 If the receiver should sort first because it belongs to the RFC and its -// arg does not -// - 0 if the receiver and arg both belong to the same RFC or neither do. -// - 1 If the arg belongs to the RFC but receiver does not. +// - -1 If the receiver should sort first because it belongs to the RFC and its +// arg does not +// - 0 if the receiver and arg both belong to the same RFC or neither do. +// - 1 If the arg belongs to the RFC but receiver does not. func (ipv6 IPv6Addr) CmpRFC(rfcNum uint, sa SockAddr) int { recvInRFC := IsRFC(rfcNum, ipv6) ipv6b, ok := sa.(IPv6Addr)

import (
"bytes"
Expand Down Expand Up @@ -173,10 +173,10 @@

// CmpAddress follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because its address is lower than arg
// - 0 if the SockAddr arg equal to the receiving IPv6Addr or the argument is of a
// different type.
// - 1 If the argument should sort first.
// - -1 If the receiver should sort first because its address is lower than arg
// - 0 if the SockAddr arg equal to the receiving IPv6Addr or the argument is of a
// different type.
// - 1 If the argument should sort first.
func (ipv6 IPv6Addr) CmpAddress(sa SockAddr) int {
ipv6b, ok := sa.(IPv6Addr)
if !ok {
Expand All @@ -193,10 +193,10 @@

// CmpPort follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because its port is lower than arg
// - 0 if the SockAddr arg's port number is equal to the receiving IPv6Addr,
// regardless of type.
// - 1 If the argument should sort first.
// - -1 If the receiver should sort first because its port is lower than arg
// - 0 if the SockAddr arg's port number is equal to the receiving IPv6Addr,
// regardless of type.
// - 1 If the argument should sort first.
func (ipv6 IPv6Addr) CmpPort(sa SockAddr) int {
var saPort IPPort
switch v := sa.(type) {
Expand All @@ -220,10 +220,10 @@

// CmpRFC follows the Cmp() standard protocol and returns:
//
// - -1 If the receiver should sort first because it belongs to the RFC and its
// arg does not
// - 0 if the receiver and arg both belong to the same RFC or neither do.
// - 1 If the arg belongs to the RFC but receiver does not.
// - -1 If the receiver should sort first because it belongs to the RFC and its
// arg does not
// - 0 if the receiver and arg both belong to the same RFC or neither do.
// - 1 If the arg belongs to the RFC but receiver does not.
func (ipv6 IPv6Addr) CmpRFC(rfcNum uint, sa SockAddr) int {
recvInRFC := IsRFC(rfcNum, ipv6)
ipv6b, ok := sa.(IPv6Addr)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package printer

Check failure on line 1 in third_party/VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/printer/nodes.go

View workflow job for this annotation

GitHub Actions / Verify codegen

Please run ./hack/update-codegen.sh. diff --git a/third_party/VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/printer/nodes.go b/third_party/VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/printer/nodes.go index f207bf92..7c038d12 100644 --- a/third_party/VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/printer/nodes.go +++ b/third_party/VENDOR-LICENSE/github.com/hashicorp/hcl/hcl/printer/nodes.go @@ -721,9 +721,10 @@ func (p *printer) heredocIndent(buf []byte) []byte { // // A single line object: // -// - has no lead comments (hence multi-line) -// - has no assignment -// - has no values in the stanza (within {}) +// * has no lead comments (hence multi-line) +// * has no assignment +// * has no values in the stanza (within {}) +// func (p *printer) isSingleLineObject(val *ast.ObjectItem) bool { // If there is a lead comment, can't be one line if val.LeadComment != nil {

import (
"bytes"
Expand Down Expand Up @@ -721,10 +721,9 @@
//
// A single line object:
//
// * has no lead comments (hence multi-line)
// * has no assignment
// * has no values in the stanza (within {})
//
// - has no lead comments (hence multi-line)
// - has no assignment
// - has no values in the stanza (within {})
func (p *printer) isSingleLineObject(val *ast.ObjectItem) bool {
// If there is a lead comment, can't be one line
if val.LeadComment != nil {
Expand Down
Loading