Skip to content

Commit

Permalink
[YUNIKORN2729] remove --new-from-rev from Makefile (#875)
Browse files Browse the repository at this point in the history
Closes: #875

Signed-off-by: Chia-Ping Tsai <[email protected]>
  • Loading branch information
rich7420 authored and chia7712 committed Jul 10, 2024
1 parent a5e8750 commit 8105123
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ lint: $(GOLANGCI_LINT_BIN)
@git symbolic-ref -q HEAD && REV="origin/HEAD" || REV="HEAD^" ; \
headSHA=$$(git rev-parse --short=12 $${REV}) ; \
echo "checking against commit sha $${headSHA}" ; \
"${GOLANGCI_LINT_BIN}" run --new-from-rev=$${headSHA}
"${GOLANGCI_LINT_BIN}" run

# Check scripts
.PHONY: check_scripts
Expand Down
2 changes: 1 addition & 1 deletion pkg/cache/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ func (ctx *Context) AssumePod(name, node string) error {
// assume pod volumes, this will update bindings info in cache
// assume pod volumes before assuming the pod
// this will update scheduler cache with essential PV/PVC binding info
var allBound = true
var allBound bool
var err error
// retrieve the volume claims
podVolumeClaims, err := ctx.apiProvider.GetAPIs().VolumeBinder.GetPodVolumeClaims(ctx.klogger, pod)
Expand Down
26 changes: 13 additions & 13 deletions pkg/cache/task_state_test.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cache

Expand Down
1 change: 1 addition & 0 deletions pkg/cache/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func TestTaskIllegalEventHandling(t *testing.T) {
assert.Equal(t, task.GetTaskState(), TaskStates().Pending)
}

//nolint:funlen
func TestReleaseTaskAllocation(t *testing.T) {
mockedSchedulerApi := newMockSchedulerAPI()
mockedContext := initContextForTest()
Expand Down
1 change: 0 additions & 1 deletion pkg/client/kubeclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ func (nc SchedulerKubeClient) Create(pod *v1.Pod) (*v1.Pod, error) {
}

func (nc SchedulerKubeClient) Delete(pod *v1.Pod) error {
// TODO make this configurable for pods
gracefulSeconds := int64(3)
if err := nc.clientSet.CoreV1().Pods(pod.Namespace).Delete(context.Background(), pod.Name, apis.DeleteOptions{
GracePeriodSeconds: &gracefulSeconds,
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/shim/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"os/signal"
"syscall"

"go.uber.org/zap"

"github.com/apache/yunikorn-k8shim/pkg/client"
"github.com/apache/yunikorn-k8shim/pkg/common/constants"
"go.uber.org/zap"

"github.com/apache/yunikorn-core/pkg/entrypoint"
"github.com/apache/yunikorn-k8shim/pkg/conf"
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/predicates/predicate_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func newPod(host string, hostPortInfos ...string) *v1.Pod {
for _, portInfo := range hostPortInfos {
split := strings.Split(portInfo, "/")
//nolint:errcheck
hostPort, _ := strconv.Atoi(split[2])
hostPort, _ := strconv.ParseInt(split[2], 10, 32)

networkPorts = append(networkPorts, v1.ContainerPort{
HostIP: split[1],
Expand Down
1 change: 1 addition & 0 deletions test/e2e/framework/helpers/common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func RandSeq(n int) string {
var letters = []rune("abcdefghijklmnopqrstuvwxyz0123456789")
b := make([]rune, n)
for i := range b {
//nolint:gosec
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/gang_scheduling/gang_scheduling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,12 +708,12 @@ func verifyOriginatorDeletionCase(withOwnerRef bool) {
},
}
defer func() {
err := kClient.DeleteConfigMap(testConfigmap.Name, ns)
Ω(err).NotTo(HaveOccurred())
deleteErr := kClient.DeleteConfigMap(testConfigmap.Name, ns)
Ω(deleteErr).NotTo(HaveOccurred())
}()

testConfigmap, err := kClient.CreateConfigMap(testConfigmap, ns)
Ω(err).NotTo(HaveOccurred())
testConfigmap, testErr := kClient.CreateConfigMap(testConfigmap, ns)
Ω(testErr).NotTo(HaveOccurred())

podTest.OwnerReferences = []metav1.OwnerReference{
{
Expand Down
10 changes: 3 additions & 7 deletions test/e2e/spark_jobs_scheduling/spark_jobs_scheduling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,22 @@ var _ = Describe("", func() {

var kClient k8s.KubeCtl
var restClient yunikorn.RClient
var err error
var exErr error
var sparkNS = "spark-" + common.RandSeq(10)
var svcAcc = "svc-acc-" + common.RandSeq(10)
var config *rest.Config
var masterURL string
var roleName = "spark-jobs-role-" + common.RandSeq(5)
var clusterEditRole = "edit"
var sparkImage = os.Getenv("SPARK_PYTHON_IMAGE")
var sparkHome = os.Getenv("SPARK_HOME")
if sparkHome == "" {
sparkHome = "/usr/local/"
}
var sparkExecutorCount = 3

BeforeEach(func() {
By(fmt.Sprintf("Spark image is: %s", sparkImage))
Ω(sparkImage).NotTo(BeEmpty())
kClient = k8s.KubeCtl{}
Ω(kClient.SetClient()).To(BeNil())
Ω(err).NotTo(HaveOccurred())
Ω(exErr).NotTo(HaveOccurred())
By(fmt.Sprintf("Creating namespace: %s for spark jobs", sparkNS))
ns1, err := kClient.CreateNamespace(sparkNS, nil)
Ω(err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -158,7 +154,7 @@ var _ = Describe("", func() {

By("Killing all spark jobs")
// delete the Spark pods one by one
err = kClient.DeletePods(sparkNS)
err := kClient.DeletePods(sparkNS)
Ω(err).NotTo(HaveOccurred())

By("Deleting cluster role bindings ")
Expand Down

0 comments on commit 8105123

Please sign in to comment.