Skip to content

bug: --source-kubernetes-version flag is needed in directory-mode #39

Description

@skoenig

I can reproduce the error mentioned in #5 with kubedd built from 6de142b452f36d0114b87c666a858f0812d78651 (v0.1.2). I have following outdated HPA manifest in fixtures/:

kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2beta1
metadata:
  labels:
    app.kubernetes.io/instance: cross-products-currency-service
  name: cross-products-currency-service-hpa
  namespace: example
spec:
  maxReplicas: 10
  metrics:
  - resource:
      name: memory
      target:
        averageUtilization: 70
        type: Utilization
    type: Resource
  - resource:
      name: cpu
      target:
        averageUtilization: 70
        type: Utilization
    type: Resource
  minReplicas: 2
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: cross-products-currency-service-deployment

If I omit --source-kubernetes-version flag like so:

./bin/kubedd --target-kubernetes-version 1.29 -d fixtures/

I also get the mentioned unmarshall error without any further output.

In contrast to this, adding the --source-kubernetes-version flag (although the help text states: "In case of directory defaults to same as target-kubernetes-version." ) yields the expected output:

./bin/kubedd --source-kubernetes-version 1.29 --target-kubernetes-version 1.29 -d fixtures

Results for file fixtures/hpa.yaml
-------------------------------------------
>>>> Newer Versions available <<<<
 Namespace   Name                                  Kind                      API Version (Current Available)   Replace With API Version (Latest Available)   Migration Status                             
 example     cross-products-currency-service-hpa   HorizontalPodAutoscaler   autoscaling/v2beta1               autoscaling/v2                                can be migrated with just apiVersion change  

@pghildiyal To me, this looks like a bug, should I open a new issue?

Originally posted by @skoenig in #5 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions