https://pulumi.com logo
Docs
Join the conversationJoin Slack
Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
plugin-framework
pulumi-cdk
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumi-service
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by Linen
python
  • l

    little-river-49422

    02/07/2019, 9:20 PM
    apiVersion: <http://rbac.authorization.k8s.io/v1beta1|rbac.authorization.k8s.io/v1beta1>
    kind: RoleBinding
    metadata:
      name: {{ .Values.serviceAccount }}
    roleRef:
      apiGroup: <http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>
      kind: Role
      name: orleans-cluster
      namespace: {{ .Release.Namespace }}
    subjects:
    - kind: ServiceAccount
      name: {{ .Values.serviceAccount }}
      namespace: {{ .Release.Namespace }}
  • l

    little-river-49422

    02/07/2019, 9:33 PM
    wait, is it really a bug? https://github.com/pulumi/pulumi-kubernetes/blob/master/sdk/python/pulumi_kubernetes/rbac/v1/RoleBinding.py#L25
  • l

    little-river-49422

    02/07/2019, 9:35 PM
    if not roleRef:
                raise TypeError('Missing required property roleRef')
            __props__['roleRef'] = role_ref
  • c

    creamy-potato-29402

    02/07/2019, 9:36 PM
    I’m not sure if it’s a bug. If the Kubernetes API server is opinionated about this, it should reject the resource outright.
  • l

    little-river-49422

    02/07/2019, 9:36 PM
    well, it looks like its a typo in the code
  • l

    little-river-49422

    02/07/2019, 9:36 PM
    nothing to do with k8s
  • l

    little-river-49422

    02/07/2019, 9:36 PM
    parameter name is role_ref
  • l

    little-river-49422

    02/07/2019, 9:36 PM
    but the check is on roleRef
  • l

    little-river-49422

    02/07/2019, 9:36 PM
    so it will always throw
  • c

    creamy-potato-29402

    02/07/2019, 9:37 PM
    mmm
  • c

    creamy-potato-29402

    02/07/2019, 9:37 PM
    bug.
  • l

    little-river-49422

    02/07/2019, 9:38 PM
    ugh. can you release a fix? 🙂
  • c

    creamy-potato-29402

    02/07/2019, 9:38 PM
    does this actually throw for you?
  • c

    creamy-potato-29402

    02/07/2019, 9:38 PM
    yes. we will try to do it today.
  • l

    little-river-49422

    02/07/2019, 9:38 PM
    yeah, the usual way:
    error: Program failed with an unhandled exception:
        error: NoneType: None
        error: an unhandled error occurred: Program exited with non-zero exit code: 1
  • c

    creamy-potato-29402

    02/07/2019, 9:38 PM
    cc @gorgeous-egg-16927
  • c

    creamy-potato-29402

    02/07/2019, 9:39 PM
    https://github.com/pulumi/pulumi-kubernetes/issues/411
  • c

    creamy-potato-29402

    02/07/2019, 9:39 PM
    we should fix this asap
  • l

    little-river-49422

    02/07/2019, 9:40 PM
    ok, at least i'm not going mad and this should work, lol
  • l

    little-river-49422

    02/07/2019, 9:40 PM
    but my 2 hours 😞
  • i

    incalculable-sundown-82514

    02/07/2019, 9:42 PM
    I’m on it, I’ll see about a fix
  • i

    incalculable-sundown-82514

    02/07/2019, 9:48 PM
    by the way, do you have a repro for the
    NoneType: None
    thing? I’ve never seen anything like that before and I’ve been struggling to reproduce it.
  • l

    little-river-49422

    02/07/2019, 9:49 PM
    well, just try creating that rolebinding
  • l

    little-river-49422

    02/07/2019, 9:49 PM
    hold on, let me try fast repro
  • i

    incalculable-sundown-82514

    02/07/2019, 9:51 PM
    PR for the issue: https://github.com/pulumi/pulumi-kubernetes/pull/412
  • l

    little-river-49422

    02/07/2019, 9:51 PM
    page not found 😉
  • i

    incalculable-sundown-82514

    02/07/2019, 9:51 PM
    need to wait a bit for GitHub to catch up, I guess
  • l

    little-river-49422

    02/07/2019, 9:52 PM
    repro:
    import pulumi
    from pulumi import ResourceOptions
    from pulumi_kubernetes.rbac.v1 import RoleBinding
    
    RoleBinding(
        "orleans-rbac-rb",
        metadata={
            "name": "orleans-rbac",
            "namespace": "default"
        },
        role_ref={
            "apiGroup": "<http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>",
            "kind": "ClusterRole",
            "name": "orleans-rbac"
        },
        subjects=[
            {
                "kind": "ServiceAccount",
                "name": "orleans-rbac",
                "namespace": "default"
            }
        ]
    )
  • i

    incalculable-sundown-82514

    02/07/2019, 9:55 PM
    This is what I get:
    ▶ p pre
    Previewing update (pyrepro-dev):
    
         Type                 Name                 Plan       Info
     +   pulumi:pulumi:Stack  pyrepro-pyrepro-dev  create     3 errors
    
    Diagnostics:
      pulumi:pulumi:Stack (pyrepro-pyrepro-dev):
        error: Program failed with an unhandled exception:
        error: Traceback (most recent call last):
          File "/usr/local/pulumi/bin/pulumi-language-python-exec", line 85, in <module>
            loop.run_until_complete(coro)
          File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
            return future.result()
          File "/Users/swgillespie/go/src/github.com/pulumi/scratch/pyrepro/venv/lib/python3.6/site-packages/pulumi/runtime/stack.py", line 34, in run_in_stack
            Stack(func)
          File "/Users/swgillespie/go/src/github.com/pulumi/scratch/pyrepro/venv/lib/python3.6/site-packages/pulumi/runtime/stack.py", line 93, in __init__
            func()
          File "/usr/local/pulumi/bin/pulumi-language-python-exec", line 84, in <lambda>
            coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
          File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 280, in run_path
            run_name, mod_spec, pkg_name).copy()
          File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
            exec(code, run_globals)
          File "./__main__.py", line 20, in <module>
            "namespace": "default"
          File "/Users/swgillespie/go/src/github.com/pulumi/scratch/pyrepro/venv/lib/python3.6/site-packages/pulumi_kubernetes/rbac/v1/RoleBinding.py", line 25, in __init__
            if not roleRef:
        NameError: name 'roleRef' is not defined
        error: an unhandled error occurred: Program exited with non-zero exit code: 1
    
    Permalink: <https://app.pulumi.com/swgillespie/pyrepro/pyrepro-dev/previews/ba8171a5-665e-433e-a59b-106436ee7ab3>
    error: an error occurred while advancing the preview
  • l

    little-river-49422

    02/07/2019, 9:56 PM
    ok, I'm using windows 🙂
Powered by Linen
Title
l

little-river-49422

02/07/2019, 9:56 PM
ok, I'm using windows 🙂
View count: 1