Skip to content

Commit

Permalink
more linting woes
Browse files Browse the repository at this point in the history
  • Loading branch information
soneillf5 committed Dec 7, 2021
1 parent 05c7290 commit e09b093
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions internal/configs/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type IngressEx struct {
SecretRefs map[string]*secrets.SecretReference
}

// DosEx holds a DosProtectedResource and the dos policy and log confs it references.
type DosEx struct {
DosProtected *v1beta1.DosProtectedResource
DosPolicy *unstructured.Unstructured
Expand Down
8 changes: 4 additions & 4 deletions internal/k8s/appprotect/app_protect_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ func (fc *FakeConfiguration) AddOrUpdateLogConf(logConfObj *unstructured.Unstruc
}

// AddOrUpdateUserSig adds or updates App Protect User Defined Signature to App Protect Configuration
func (fc *FakeConfiguration) AddOrUpdateUserSig(userSigObj *unstructured.Unstructured) (change UserSigChange, problems []Problem) {
func (fc *FakeConfiguration) AddOrUpdateUserSig(_ *unstructured.Unstructured) (change UserSigChange, problems []Problem) {
return change, problems
}

Expand All @@ -610,16 +610,16 @@ func (fc *FakeConfiguration) GetAppResource(kind, key string) (*unstructured.Uns
}

// DeletePolicy deletes an App Protect Policy from App Protect Configuration
func (fc *FakeConfiguration) DeletePolicy(key string) (changes []Change, problems []Problem) {
func (fc *FakeConfiguration) DeletePolicy(_ string) (changes []Change, problems []Problem) {
return changes, problems
}

// DeleteLogConf deletes an App Protect Log Configuration from App Protect Configuration
func (fc *FakeConfiguration) DeleteLogConf(key string) (changes []Change, problems []Problem) {
func (fc *FakeConfiguration) DeleteLogConf(_ string) (changes []Change, problems []Problem) {
return changes, problems
}

// DeleteUserSig deletes an App Protect User Defined Signature from App Protect Configuration
func (fc *FakeConfiguration) DeleteUserSig(key string) (change UserSigChange, problems []Problem) {
func (fc *FakeConfiguration) DeleteUserSig(_ string) (change UserSigChange, problems []Problem) {
return change, problems
}
2 changes: 2 additions & 0 deletions internal/k8s/appprotectdos/app_protect_dos_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func getNsName(defaultNamespace string, name string) string {
return name
}

// GetDosProtectedThatReferencedDosPolicy gets dos protected resources that mention the given dos policy
func (ci *Configuration) GetDosProtectedThatReferencedDosPolicy(key string) []*v1beta1.DosProtectedResource {
var protectedResources []*v1beta1.DosProtectedResource
for _, protectedEx := range ci.dosProtectedResource {
Expand All @@ -278,6 +279,7 @@ func (ci *Configuration) GetDosProtectedThatReferencedDosPolicy(key string) []*v
return protectedResources
}

// GetDosProtectedThatReferencedDosLogConf gets dos protected resources that mention the given dos log conf
func (ci *Configuration) GetDosProtectedThatReferencedDosLogConf(key string) []*v1beta1.DosProtectedResource {
var protectedResources []*v1beta1.DosProtectedResource
for _, protectedEx := range ci.dosProtectedResource {
Expand Down
8 changes: 2 additions & 6 deletions internal/metrics/syslog_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,13 @@ func (l LatencyMetricsListener) Stop() {

func isErrorRecoverable(err error) bool {
var nerr *net.OpError
if errors.As(err, &nerr) && nerr.Temporary() {
return true
} else {
return false
}
return errors.As(err, &nerr) && nerr.Temporary()
}

// SyslogFakeListener is a fake implementation of the SyslogListener interface
type SyslogFakeListener struct{}

// NewFakeSyslogServer returns a SyslogFakeListener
// NewSyslogFakeServer returns a SyslogFakeListener
func NewSyslogFakeServer() *SyslogFakeListener {
return &SyslogFakeListener{}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/configuration/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ type VirtualServerRouteSpec struct {

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VirtualServerRouteList is a list of VirtualServerRoute
type VirtualServerRouteList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Expand Down
4 changes: 3 additions & 1 deletion pkg/apis/configuration/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ func Resource(resource string) schema.GroupResource {
}

var (
// SchemeBuilder build a scheme
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
// AddToScheme exported add function
AddToScheme = SchemeBuilder.AddToScheme
)

// Adds the list of known types to Scheme.
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/dos/register.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dos

const (
// GroupName the name of the group used by kubernetes.
GroupName = "appprotectdos.f5.com"
)

0 comments on commit e09b093

Please sign in to comment.