github.com/containerd/Containerd@v1.4.13/contrib/apparmor/apparmor_unsupported.go (about)

     1  // +build !linux
     2  
     3  /*
     4     Copyright The containerd Authors.
     5  
     6     Licensed under the Apache License, Version 2.0 (the "License");
     7     you may not use this file except in compliance with the License.
     8     You may obtain a copy of the License at
     9  
    10         http://www.apache.org/licenses/LICENSE-2.0
    11  
    12     Unless required by applicable law or agreed to in writing, software
    13     distributed under the License is distributed on an "AS IS" BASIS,
    14     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15     See the License for the specific language governing permissions and
    16     limitations under the License.
    17  */
    18  
    19  package apparmor
    20  
    21  import (
    22  	"context"
    23  
    24  	"github.com/containerd/containerd/containers"
    25  	"github.com/containerd/containerd/oci"
    26  	specs "github.com/opencontainers/runtime-spec/specs-go"
    27  	"github.com/pkg/errors"
    28  )
    29  
    30  // WithProfile sets the provided apparmor profile to the spec
    31  func WithProfile(profile string) oci.SpecOpts {
    32  	return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
    33  		return errors.New("apparmor is not supported")
    34  	}
    35  }
    36  
    37  // WithDefaultProfile will generate a default apparmor profile under the provided name
    38  // for the container.  It is only generated if a profile under that name does not exist.
    39  func WithDefaultProfile(name string) oci.SpecOpts {
    40  	return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
    41  		return errors.New("apparmor is not supported")
    42  	}
    43  }