Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package okteto for openSUSE:Factory checked 
in at 2022-03-04 00:17:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/okteto (Old)
 and      /work/SRC/openSUSE:Factory/.okteto.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "okteto"

Fri Mar  4 00:17:42 2022 rev:6 rq:958684 version:1.15.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/okteto/okteto.changes    2022-02-18 
23:03:27.217410449 +0100
+++ /work/SRC/openSUSE:Factory/.okteto.new.1958/okteto.changes  2022-03-04 
00:18:24.996295039 +0100
@@ -1,0 +2,9 @@
+Wed Mar 02 14:06:15 UTC 2022 - [email protected]
+
+- Update to version 1.15.6:
+  * fix: okteto down cause nil pointer exception (#2303)
+  * fix: stop other okteto for the same app (#2299)
+  * Fix: UI not showing unmarshal errors (#2296)
+  * check if there is an error after start (#2302)
+
+-------------------------------------------------------------------

Old:
----
  okteto-1.15.5.tar.gz

New:
----
  okteto-1.15.6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ okteto.spec ++++++
--- /var/tmp/diff_new_pack.tkbCKO/_old  2022-03-04 00:18:25.944295238 +0100
+++ /var/tmp/diff_new_pack.tkbCKO/_new  2022-03-04 00:18:25.948295239 +0100
@@ -19,7 +19,7 @@
 %define __arch_install_post export NO_BRP_STRIP_DEBUG=true
 
 Name:           okteto
-Version:        1.15.5
+Version:        1.15.6
 Release:        0
 Summary:        Develop your applications directly in your Kubernetes Cluster
 License:        Apache-2.0

++++++ _service ++++++
--- /var/tmp/diff_new_pack.tkbCKO/_old  2022-03-04 00:18:25.988295248 +0100
+++ /var/tmp/diff_new_pack.tkbCKO/_new  2022-03-04 00:18:25.992295248 +0100
@@ -3,7 +3,7 @@
     <param name="url">https://github.com/okteto/okteto</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="revision">1.15.5</param>
+    <param name="revision">1.15.6</param>
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="changesgenerate">enable</param>
   </service>
@@ -15,7 +15,7 @@
     <param name="compression">gz</param>
   </service>
   <service name="go_modules" mode="disabled">
-    <param name="archive">okteto-1.15.5.tar.gz</param>
+    <param name="archive">okteto-1.15.6.tar.gz</param>
   </service>
 </services>
 

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.tkbCKO/_old  2022-03-04 00:18:26.016295254 +0100
+++ /var/tmp/diff_new_pack.tkbCKO/_new  2022-03-04 00:18:26.020295255 +0100
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/okteto/okteto</param>
-              <param 
name="changesrevision">bd2355772061c5f33bc2ce40936df57fabfca5fd</param></service></servicedata>
+              <param 
name="changesrevision">19045494c4b6ea30f91c1b0280e0f30bdcbec6d2</param></service></servicedata>
 (No newline at EOF)
 

++++++ okteto-1.15.5.tar.gz -> okteto-1.15.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/cmd/deploy/deploy.go 
new/okteto-1.15.6/cmd/deploy/deploy.go
--- old/okteto-1.15.5/cmd/deploy/deploy.go      2022-02-18 00:32:33.000000000 
+0100
+++ new/okteto-1.15.6/cmd/deploy/deploy.go      2022-03-02 13:29:22.000000000 
+0100
@@ -99,7 +99,9 @@
                        os.Setenv(model.OktetoWithinDeployCommandContextEnvVar, 
"false")
 
                        if err := contextCMD.LoadManifestV2WithContext(ctx, 
options.Namespace, options.ManifestPath); err != nil {
-                               return err
+                               if err := 
contextCMD.NewContextCommand().Run(ctx, &contextCMD.ContextOptions{Namespace: 
options.Namespace}); err != nil {
+                                       return err
+                               }
                        }
 
                        if okteto.IsOkteto() {
@@ -211,6 +213,7 @@
                return err
        }
        var err error
+       oktetoLog.SetStage("Read manifest")
        if contextCMD.IsManifestV2Enabled() {
                opts.Manifest, err = contextCMD.GetManifestV2(cwd, 
opts.ManifestPath)
                if err != nil {
@@ -279,6 +282,7 @@
                        return fmt.Errorf("found okteto manifest, but no deploy 
commands where defined")
                }
        }
+       oktetoLog.SetStage("")
        opts.Manifest.Context = okteto.Context().Name
        opts.Manifest.Namespace = okteto.Context().Namespace
        dc.PipelineType = opts.Manifest.Type
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/cmd/down.go 
new/okteto-1.15.6/cmd/down.go
--- old/okteto-1.15.5/cmd/down.go       2022-02-18 00:32:33.000000000 +0100
+++ new/okteto-1.15.6/cmd/down.go       2022-03-02 13:29:22.000000000 +0100
@@ -118,7 +118,7 @@
                }
                spinner.Start()
 
-               trMap, err := apps.GetTranslations(ctx, dev, app, false, c)
+               trMap, err := apps.GetTranslations(ctx, dev, app, false, "", c)
                if err != nil {
                        exit <- err
                        return
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/cmd/push.go 
new/okteto-1.15.6/cmd/push.go
--- old/okteto-1.15.5/cmd/push.go       2022-02-18 00:32:33.000000000 +0100
+++ new/okteto-1.15.6/cmd/push.go       2022-03-02 13:29:22.000000000 +0100
@@ -19,6 +19,7 @@
        "os"
        "os/signal"
 
+       "github.com/google/uuid"
        contextCMD "github.com/okteto/okteto/cmd/context"
        "github.com/okteto/okteto/cmd/utils"
        "github.com/okteto/okteto/pkg/analytics"
@@ -172,8 +173,11 @@
                        pushOpts.ImageTag = registry.GetImageTag("", dev.Name, 
dev.Namespace, oktetoRegistryURL)
                }
        }
-
-       trMap, err := apps.GetTranslations(ctx, dev, app, false, c)
+       id := uuid.New().String()
+       if value, ok := 
app.ObjectMeta().Annotations[model.OktetoSessionIDAnnotation]; ok {
+               id = value
+       }
+       trMap, err := apps.GetTranslations(ctx, dev, app, false, id, c)
        if err != nil {
                return err
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/cmd/up/activate.go 
new/okteto-1.15.6/cmd/up/activate.go
--- old/okteto-1.15.5/cmd/up/activate.go        2022-02-18 00:32:33.000000000 
+0100
+++ new/okteto-1.15.6/cmd/up/activate.go        2022-03-02 13:29:22.000000000 
+0100
@@ -247,7 +247,7 @@
        }
 
        resetOnDevContainerStart := up.resetSyncthing || 
!up.Dev.PersistentVolumeEnabled()
-       trMap, err := apps.GetTranslations(ctx, up.Dev, app, 
resetOnDevContainerStart, up.Client)
+       trMap, err := apps.GetTranslations(ctx, up.Dev, app, 
resetOnDevContainerStart, up.ID, up.Client)
        if err != nil {
                return err
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/cmd/up/forwards.go 
new/okteto-1.15.6/cmd/up/forwards.go
--- old/okteto-1.15.5/cmd/up/forwards.go        2022-02-18 00:32:33.000000000 
+0100
+++ new/okteto-1.15.6/cmd/up/forwards.go        2022-03-02 13:29:22.000000000 
+0100
@@ -16,8 +16,10 @@
 import (
        "context"
        "fmt"
+       "time"
 
        "github.com/okteto/okteto/cmd/utils"
+       oktetoErrors "github.com/okteto/okteto/pkg/errors"
        "github.com/okteto/okteto/pkg/k8s/forward"
        oktetoLog "github.com/okteto/okteto/pkg/log"
        "github.com/okteto/okteto/pkg/model"
@@ -89,6 +91,12 @@
                        up.Dev.Forward[idx] = forwardWithServiceName
                        f = forwardWithServiceName
                }
+
+               err := waitUntilPortIsAvailable(up.Dev.Interface, f.Local)
+               if err != nil {
+                       return err
+               }
+
                if err := up.Forwarder.Add(f); err != nil {
                        return err
                }
@@ -107,3 +115,22 @@
 
        return up.Forwarder.Start(up.Pod.Name, up.Dev.Namespace)
 }
+
+func waitUntilPortIsAvailable(iface string, port int) error {
+       ticker := time.NewTicker(1 * time.Second)
+       timeoutTicker := time.NewTicker(30 * time.Second)
+
+       for {
+               select {
+               case <-ticker.C:
+                       if model.IsPortAvailable(iface, port) {
+                               return nil
+                       }
+               case <-timeoutTicker.C:
+                       return oktetoErrors.UserError{
+                               E:    fmt.Errorf("local port %d is already 
in-use in your local machine", port),
+                               Hint: "Please release the port and try again",
+                       }
+               }
+       }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/cmd/up/types.go 
new/okteto-1.15.6/cmd/up/types.go
--- old/okteto-1.15.5/cmd/up/types.go   2022-02-18 00:32:33.000000000 +0100
+++ new/okteto-1.15.6/cmd/up/types.go   2022-03-02 13:29:22.000000000 +0100
@@ -52,6 +52,7 @@
        spinner           *utils.Spinner
        StartTime         time.Time
        Options           *UpOptions
+       ID                string
 }
 
 // Forwarder is an interface for the port-forwarding features
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/cmd/up/up.go 
new/okteto-1.15.6/cmd/up/up.go
--- old/okteto-1.15.5/cmd/up/up.go      2022-02-18 00:32:33.000000000 +0100
+++ new/okteto-1.15.6/cmd/up/up.go      2022-03-02 13:29:22.000000000 +0100
@@ -22,6 +22,7 @@
        "strings"
        "time"
 
+       "github.com/google/uuid"
        "github.com/moby/term"
        contextCMD "github.com/okteto/okteto/cmd/context"
        initCMD "github.com/okteto/okteto/cmd/init"
@@ -156,6 +157,7 @@
                                resetSyncthing: upOptions.Reset,
                                StartTime:      time.Now(),
                                Options:        upOptions,
+                               ID:             uuid.New().String(),
                        }
                        up.inFd, up.isTerm = term.GetFdInfo(os.Stdin)
                        if up.isTerm {
@@ -170,20 +172,19 @@
 
                        err = up.start()
 
-                       if err := 
up.Client.CoreV1().PersistentVolumeClaims(dev.Namespace).Delete(ctx, 
fmt.Sprintf(model.DeprecatedOktetoVolumeNameTemplate, dev.Name), 
metav1.DeleteOptions{}); err != nil {
-                               oktetoLog.Infof("error deleting deprecated 
volume: %v", err)
-                       }
-
                        if err != nil {
                                switch err.(type) {
                                default:
                                        err = fmt.Errorf("%w\n    Find 
additional logs at: %s/okteto.log", err, config.GetAppHome(dev.Namespace, 
dev.Name))
                                case oktetoErrors.CommandError:
                                        oktetoLog.Infof("CommandError: %v", err)
+                               case oktetoErrors.UserError:
+                                       return err
                                }
-
                        }
-
+                       if err := 
up.Client.CoreV1().PersistentVolumeClaims(dev.Namespace).Delete(ctx, 
fmt.Sprintf(model.DeprecatedOktetoVolumeNameTemplate, dev.Name), 
metav1.DeleteOptions{}); err != nil {
+                               oktetoLog.Infof("error deleting deprecated 
volume: %v", err)
+                       }
                        return err
                },
        }
@@ -301,6 +302,7 @@
 
        defer config.DeleteStateFile(up.Dev)
 
+       ctx := context.Background()
        for {
                if up.isRetry || isTransientError {
                        oktetoLog.Infof("waiting for shutdown sequence to 
finish")
@@ -314,7 +316,13 @@
                                <-t.C
                        }
                }
-
+               if up.isRetry && up.hasSessionIDChanged(ctx) {
+                       up.Exit <- oktetoErrors.UserError{
+                               E:    fmt.Errorf("session disconnected: there 
is another `okteto up` session on this container"),
+                               Hint: "Try running 'okteto exec' to get another 
session on this container",
+                       }
+                       return
+               }
                err := up.activate()
                if err != nil {
                        oktetoLog.Infof("activate failed with: %s", err)
@@ -338,6 +346,17 @@
        }
 }
 
+func (up *upContext) hasSessionIDChanged(ctx context.Context) bool {
+       app, err := utils.GetDevApp(ctx, up.Dev, up.Client)
+       if err != nil || app == nil {
+               return false
+       }
+       if value, ok := 
app.ObjectMeta().Annotations[model.OktetoSessionIDAnnotation]; ok {
+               return value != up.ID
+       }
+       return false
+}
+
 // waitUntilExitOrInterruptOrApply blocks execution until a stop signal is 
sent, a disconnect event or an error or the app is modify
 func (up *upContext) waitUntilExitOrInterruptOrApply(ctx context.Context) 
error {
        for {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/cmd/utils/dev.go 
new/okteto-1.15.6/cmd/utils/dev.go
--- old/okteto-1.15.5/cmd/utils/dev.go  2022-02-18 00:32:33.000000000 +0100
+++ new/okteto-1.15.6/cmd/utils/dev.go  2022-03-02 13:29:22.000000000 +0100
@@ -317,3 +317,16 @@
        }
        return err == nil
 }
+
+// GetDevApp returns the cloned app if exists, error otherwise
+func GetDevApp(ctx context.Context, dev *model.Dev, c kubernetes.Interface) 
(apps.App, error) {
+       devAppDev := *dev
+       devAppDev.Name = model.DevCloneName(dev.Name)
+       app, err := apps.Get(ctx, &devAppDev, dev.Namespace, c)
+       if err != nil && !oktetoErrors.IsNotFound(err) {
+               oktetoLog.Infof("getApp autocreate k8s error, retrying...")
+               _, err := apps.Get(ctx, &devAppDev, dev.Namespace, c)
+               return nil, err
+       }
+       return app, nil
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/pkg/k8s/apps/crud.go 
new/okteto-1.15.6/pkg/k8s/apps/crud.go
--- old/okteto-1.15.5/pkg/k8s/apps/crud.go      2022-02-18 00:32:33.000000000 
+0100
+++ new/okteto-1.15.6/pkg/k8s/apps/crud.go      2022-03-02 13:29:22.000000000 
+0100
@@ -101,12 +101,13 @@
 }
 
 //GetTranslations fills all the deployments pointed by a development container
-func GetTranslations(ctx context.Context, dev *model.Dev, app App, reset bool, 
c kubernetes.Interface) (map[string]*Translation, error) {
+func GetTranslations(ctx context.Context, dev *model.Dev, app App, reset bool, 
uid string, c kubernetes.Interface) (map[string]*Translation, error) {
        mainTr := &Translation{
                MainDev: dev,
                Dev:     dev,
                App:     app,
                Rules:   []*model.TranslationRule{dev.ToTranslationRule(dev, 
reset)},
+               ID:      uid,
        }
        result := map[string]*Translation{app.ObjectMeta().Name: mainTr}
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/pkg/k8s/apps/translate.go 
new/okteto-1.15.6/pkg/k8s/apps/translate.go
--- old/okteto-1.15.5/pkg/k8s/apps/translate.go 2022-02-18 00:32:33.000000000 
+0100
+++ new/okteto-1.15.6/pkg/k8s/apps/translate.go 2022-03-02 13:29:22.000000000 
+0100
@@ -47,6 +47,7 @@
        App     App
        DevApp  App
        Rules   []*model.TranslationRule
+       ID      string
 }
 
 func (tr *Translation) translate() error {
@@ -78,6 +79,8 @@
                tr.DevApp.SetReplicas(1)
                
tr.DevApp.TemplateObjectMeta().Labels[model.InteractiveDevLabel] = tr.Dev.Name
                TranslateOktetoSyncSecret(tr.DevApp.PodSpec(), tr.Dev.Name)
+               
tr.DevApp.ObjectMeta().Annotations[model.OktetoSessionIDAnnotation] = tr.ID
+               
tr.DevApp.TemplateObjectMeta().Annotations[model.OktetoSessionIDAnnotation] = 
tr.ID
        } else {
                tr.DevApp.TemplateObjectMeta().Labels[model.DetachedDevLabel] = 
tr.Dev.Name
                TranslatePodAffinity(tr.DevApp.PodSpec(), tr.MainDev.Name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/pkg/k8s/apps/translate_test.go 
new/okteto-1.15.6/pkg/k8s/apps/translate_test.go
--- old/okteto-1.15.5/pkg/k8s/apps/translate_test.go    2022-02-18 
00:32:33.000000000 +0100
+++ new/okteto-1.15.6/pkg/k8s/apps/translate_test.go    2022-03-02 
13:29:22.000000000 +0100
@@ -418,11 +418,11 @@
        if !reflect.DeepEqual(tr1.DevApp.TemplateObjectMeta().Labels, 
expectedPodLabels) {
                t.Fatalf("Wrong dev d1 pod labels: '%v'", 
tr1.DevApp.TemplateObjectMeta().Labels)
        }
-       expectedAnnotations = map[string]string{"key1": "value1"}
+       expectedAnnotations = 
map[string]string{model.OktetoSessionIDAnnotation: "", "key1": "value1"}
        if !reflect.DeepEqual(tr1.DevApp.ObjectMeta().Annotations, 
expectedAnnotations) {
                t.Fatalf("Wrong dev d1 annotations: '%v'", 
tr1.DevApp.ObjectMeta().Annotations)
        }
-       expectedPodAnnotations := map[string]string{"key1": "value1"}
+       expectedPodAnnotations := 
map[string]string{model.OktetoSessionIDAnnotation: "", "key1": "value1"}
        if !reflect.DeepEqual(tr1.DevApp.TemplateObjectMeta().Annotations, 
expectedPodAnnotations) {
                t.Fatalf("Wrong dev d1 pod annotations: '%v'", 
tr1.DevApp.TemplateObjectMeta().Annotations)
        }
@@ -1720,11 +1720,11 @@
        if !reflect.DeepEqual(tr1.DevApp.TemplateObjectMeta().Labels, 
expectedPodLabels) {
                t.Fatalf("Wrong dev sfs1 pod labels: '%v'", 
tr1.DevApp.TemplateObjectMeta().Labels)
        }
-       expectedAnnotations = map[string]string{"key1": "value1"}
+       expectedAnnotations = 
map[string]string{model.OktetoSessionIDAnnotation: "", "key1": "value1"}
        if !reflect.DeepEqual(tr1.DevApp.ObjectMeta().Annotations, 
expectedAnnotations) {
                t.Fatalf("Wrong dev sfs1 annotations: '%v'", 
tr1.DevApp.ObjectMeta().Annotations)
        }
-       expectedPodAnnotations := map[string]string{"key1": "value1"}
+       expectedPodAnnotations := 
map[string]string{model.OktetoSessionIDAnnotation: "", "key1": "value1"}
        if !reflect.DeepEqual(tr1.DevApp.TemplateObjectMeta().Annotations, 
expectedPodAnnotations) {
                t.Fatalf("Wrong dev sfs1 pod annotations: '%v'", 
tr1.DevApp.TemplateObjectMeta().Annotations)
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/pkg/log/json.go 
new/okteto-1.15.6/pkg/log/json.go
--- old/okteto-1.15.5/pkg/log/json.go   2022-02-18 00:32:33.000000000 +0100
+++ new/okteto-1.15.6/pkg/log/json.go   2022-03-02 13:29:22.000000000 +0100
@@ -22,6 +22,10 @@
        "github.com/sirupsen/logrus"
 )
 
+const (
+       defaultErrorStage = "Internal server error"
+)
+
 //JSONWriter writes into a JSON terminal
 type JSONWriter struct {
        out  *logrus.Logger
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/okteto-1.15.5/pkg/model/const.go 
new/okteto-1.15.6/pkg/model/const.go
--- old/okteto-1.15.5/pkg/model/const.go        2022-02-18 00:32:33.000000000 
+0100
+++ new/okteto-1.15.6/pkg/model/const.go        2022-03-02 13:29:22.000000000 
+0100
@@ -34,6 +34,9 @@
        // OktetoSampleAnnotation indicates that the repo is a okteto sample
        OktetoSampleAnnotation = "dev.okteto.com/sample"
 
+       // OktetoSessionIDAnnotation indicates that the dev uid
+       OktetoSessionIDAnnotation = "dev.okteto.com/session-id"
+
        // DetachedDevLabel indicates the detached dev pods
        DetachedDevLabel = "detached.dev.okteto.com"
 

++++++ vendor.tar.gz ++++++
/work/SRC/openSUSE:Factory/okteto/vendor.tar.gz 
/work/SRC/openSUSE:Factory/.okteto.new.1958/vendor.tar.gz differ: char 5, line 1

Reply via email to