oam-dev / rudr

A Kubernetes implementation of the Open Application Model specification
https://oam.dev
MIT License
1.54k stars 136 forks source link

Volume Mounter trait works without specifying "sharingPolicy" #523

Open abhirockzz opened 4 years ago

abhirockzz commented 4 years ago

Output of helm version:

version.BuildInfo{Version:"v3.0.1", GitCommit:"7c22ef9ce89e0ebeb7125ba2ebf7d421f3e82ffa", GitTreeState:"clean", GoVersion:"go1.13.4"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.7", GitCommit:"6c143d35bb11d74970e7bc0b6c45b6bfdffc0bd4", GitTreeState:"clean", BuildDate:"2019-12-13T18:46:24Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):

AKS

Describe the bug

The doc states that sharingPolicy is required. But omitting it from the component does not cause any issue

OAM yaml files used

Component

apiVersion: core.oam.dev/v1alpha1
kind: ComponentSchematic
metadata:
  name: emphemeral-vol-example
spec:
  workloadType: core.oam.dev/v1alpha1.Server
  containers:
    - name: server
      image: nginx:latest
      resources:
        volumes:
          - name: emphemeral-vol
            mountPath: /emphemeral-vol
            disk:
              required: "50M"
              ephemeral: true

What happened:

Component was created

What you expected to happen:

Error during Component creation

Relevant screenshots:

How to reproduce it (as minimally and precisely as possible):

Create Component (pasted above)

Anything else we need to know:

I am not sure whether the documentation is inaccurate

zhxu2 commented 4 years ago

Seems the doc contradicts with rudr implementation. If not specified the default sharing policy is "Exclusive" as stated on this page https://github.com/oam-dev/spec/blob/master/3.component_model.md#volume

if @vturecek confirms it we can update that page https://github.com/oam-dev/rudr/blob/master/docs/concepts/component-schematic.md#volumes

change tag -> docs