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

chore: bump k8s.io dependency #788

Merged
merged 3 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion itest/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (b *DeploymentBuilder) Build() *appsv1.Deployment {
Namespace: b.namespace,
},
Spec: appsv1.DeploymentSpec{
Replicas: pointer.Int32Ptr(1),
Replicas: pointer.Int32(1),
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": b.name,
Expand Down
8 changes: 4 additions & 4 deletions itest/matcher/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func (m *vulnerabilityReportMatcher) Match(actual interface{}) (bool, error) {
Kind: gvk.Kind,
Name: m.owner.GetName(),
UID: m.owner.GetUID(),
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(false),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(false),
}),
}),
"Report": MatchFields(IgnoreExtras, Fields{
Expand Down Expand Up @@ -165,8 +165,8 @@ func (m *configAuditReportMatcher) Match(actual interface{}) (bool, error) {
Kind: gvk.Kind,
Name: m.owner.GetName(),
UID: m.owner.GetUID(),
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(false),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(false),
}),
}),
"Report": MatchFields(IgnoreExtras, Fields{
Expand Down
8 changes: 4 additions & 4 deletions itest/matcher/matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func TestVulnerabilityReportMatcher(t *testing.T) {
Kind: "Pod",
Name: "nginx-pod",
UID: "56d53a84-c81b-4620-81a1-e226c35d3983",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(false),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(false),
},
},
},
Expand Down Expand Up @@ -100,8 +100,8 @@ func TestConfigAuditReportMatcher(t *testing.T) {
Kind: "ReplicaSet",
Name: "nginx-6d4cf56db6",
UID: "494b2727-5d52-4057-9a9b-8b508c753fea",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(false),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(false),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/configauditreport/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (b *ReportBuilder) GetClusterReport() (v1alpha1.ClusterConfigAuditReport, e
// additional RBAC permissions are not required when the OwnerReferencesPermissionsEnforcement
// is enabled.
// See https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement
report.OwnerReferences[0].BlockOwnerDeletion = pointer.BoolPtr(false)
report.OwnerReferences[0].BlockOwnerDeletion = pointer.Bool(false)
return report, nil
}

Expand Down Expand Up @@ -160,7 +160,7 @@ func (b *ReportBuilder) GetReport() (v1alpha1.ConfigAuditReport, error) {
// additional RBAC permissions are not required when the OwnerReferencesPermissionsEnforcement
// is enabled.
// See https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement
report.OwnerReferences[0].BlockOwnerDeletion = pointer.BoolPtr(false)
report.OwnerReferences[0].BlockOwnerDeletion = pointer.Bool(false)
return report, nil
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/configauditreport/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ func TestReportBuilder(t *testing.T) {
APIVersion: "apps/v1",
Kind: "ReplicaSet",
Name: "some-owner",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(false),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(false),
},
},
Labels: map[string]string{
Expand Down Expand Up @@ -95,8 +95,8 @@ func TestReportBuilder(t *testing.T) {
APIVersion: "rbac.authorization.k8s.io/v1",
Kind: "ClusterRole",
Name: "system:controller:node-controller",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(false),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(false),
},
},
Labels: map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion pkg/exposedsecretreport/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ func (b *ReportBuilder) Get() (v1alpha1.ExposedSecretReport, error) {
// additional RBAC permissions are not required when the OwnerReferencesPermissionsEnforcement
// is enabled.
// See https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement
report.OwnerReferences[0].BlockOwnerDeletion = pointer.BoolPtr(false)
report.OwnerReferences[0].BlockOwnerDeletion = pointer.Bool(false)
return report, nil
}
4 changes: 2 additions & 2 deletions pkg/exposedsecretreport/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func TestReportBuilder(t *testing.T) {
APIVersion: "apps/v1",
Kind: "ReplicaSet",
Name: "some-owner",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(false),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(false),
},
},
Labels: map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion pkg/infraassessment/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (b *ReportBuilder) GetReport() (v1alpha1.InfraAssessmentReport, error) {
// additional RBAC permissions are not required when the OwnerReferencesPermissionsEnforcement
// is enabled.
// See https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement
report.OwnerReferences[0].BlockOwnerDeletion = pointer.BoolPtr(false)
report.OwnerReferences[0].BlockOwnerDeletion = pointer.Bool(false)
return report, nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/infraassessment/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func TestReportBuilder(t *testing.T) {
APIVersion: "apps/v1",
Kind: "ReplicaSet",
Name: "some-owner",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(false),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(false),
},
},
Labels: map[string]string{
Expand Down
36 changes: 18 additions & 18 deletions pkg/kube/object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ func TestObjectResolver_RelatedReplicaSetName(t *testing.T) {
APIVersion: "apps/v1",
Kind: "ReplicaSet",
Name: "nginx-549f5fcb58",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(true),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
},
},
},
Expand Down Expand Up @@ -827,8 +827,8 @@ func TestGetActivePodsMatchingLabels(t *testing.T) {
Kind: "Deployment",
Name: "nginx",
UID: "734c1370-2281-4946-9b5f-940b33f3e4b8",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(true),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
},
},
},
Expand Down Expand Up @@ -861,8 +861,8 @@ func TestGetActivePodsMatchingLabels(t *testing.T) {
Kind: "ReplicaSet",
Name: "nginx-6d4cf56db6",
UID: "ecfff877-784c-4f05-8b70-abe441ca1976",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(true),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
},
},
},
Expand Down Expand Up @@ -909,7 +909,7 @@ func TestObjectResolver_ReportOwner(t *testing.T) {
UID: "734c1370-2281-4946-9b5f-940b33f3e4b8",
},
Spec: appsv1.DeploymentSpec{
Replicas: pointer.Int32Ptr(1),
Replicas: pointer.Int32(1),
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": "nginx",
Expand Down Expand Up @@ -953,8 +953,8 @@ func TestObjectResolver_ReportOwner(t *testing.T) {
Kind: "Deployment",
Name: "nginx",
UID: "734c1370-2281-4946-9b5f-940b33f3e4b8",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(true),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
},
},
},
Expand Down Expand Up @@ -987,8 +987,8 @@ func TestObjectResolver_ReportOwner(t *testing.T) {
Kind: "ReplicaSet",
Name: "nginx-6d4cf56db6",
UID: "ecfff877-784c-4f05-8b70-abe441ca1976",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(true),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
},
},
},
Expand Down Expand Up @@ -1050,8 +1050,8 @@ func TestObjectResolver_ReportOwner(t *testing.T) {
Kind: "Job",
Name: "pi",
UID: "ef340242-b677-485e-b506-2ac1dde48bca",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(true),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
},
},
},
Expand Down Expand Up @@ -1147,7 +1147,7 @@ func TestObjectResolver_IsActiveReplicaSet(t *testing.T) {
UID: "734c1370-2281-4946-9b5f-940b33f3e4b8",
},
Spec: appsv1.DeploymentSpec{
Replicas: pointer.Int32Ptr(1),
Replicas: pointer.Int32(1),
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": "nginx",
Expand Down Expand Up @@ -1191,8 +1191,8 @@ func TestObjectResolver_IsActiveReplicaSet(t *testing.T) {
Kind: "Deployment",
Name: "nginx",
UID: "734c1370-2281-4946-9b5f-940b33f3e4b8",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(true),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
},
},
},
Expand Down Expand Up @@ -1230,8 +1230,8 @@ func TestObjectResolver_IsActiveReplicaSet(t *testing.T) {
Kind: "Deployment",
Name: "nginx",
UID: "734c1370-2281-4946-9b5f-940b33f3e4b8",
Controller: pointer.BoolPtr(true),
BlockOwnerDeletion: pointer.BoolPtr(true),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
},
},
},
Expand Down
Loading